Package org.lwjgl.bgfx
Class BGFXPlatform
java.lang.Object
org.lwjgl.bgfx.BGFXPlatform
Native bindings to the C platform API of the bgfx library.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classContains the function pointers loaded fromBGFX.getLibrary(). -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intRender frame.static final intRender frame.static final intRender frame.static final intRender frame.static final intRender frame. -
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable BGFXInternalDataGets internal data for interop.static longbgfx_override_internal_texture(short _handle, int _width, int _height, int _numMips, int _format, long _flags) Overrides internal texture by creating new texture.static longbgfx_override_internal_texture_ptr(short _handle, long _ptr) Overrides internal texture with externally created texture.static intbgfx_render_frame(int _msecs) Render frame.static voidSets platform data.static longUnsafe version of:get_internal_datastatic longnbgfx_override_internal_texture(short _handle, short _width, short _height, byte _numMips, int _format, long _flags) Unsafe version of:override_internal_texturestatic voidnbgfx_set_platform_data(long _data) Unsafe version of:set_platform_data
-
Field Details
-
BGFX_RENDER_FRAME_NO_CONTEXT
public static final int BGFX_RENDER_FRAME_NO_CONTEXTRender frame. (bgfx_render_frame_t)Enum values:
- See Also:
-
BGFX_RENDER_FRAME_RENDER
public static final int BGFX_RENDER_FRAME_RENDERRender frame. (bgfx_render_frame_t)Enum values:
- See Also:
-
BGFX_RENDER_FRAME_TIMEOUT
public static final int BGFX_RENDER_FRAME_TIMEOUTRender frame. (bgfx_render_frame_t)Enum values:
- See Also:
-
BGFX_RENDER_FRAME_EXITING
public static final int BGFX_RENDER_FRAME_EXITINGRender frame. (bgfx_render_frame_t)Enum values:
- See Also:
-
BGFX_RENDER_FRAME_COUNT
public static final int BGFX_RENDER_FRAME_COUNTRender frame. (bgfx_render_frame_t)Enum values:
- See Also:
-
-
Method Details
-
bgfx_render_frame
public static int bgfx_render_frame(int _msecs) Render frame.bgfx_render_frameis blocking call. It waits forframeto be called from API thread to process frame. If timeout value is passed call will timeout and return even ifbgfx_frameis not called.This call should be only used on platforms that don't allow creating separate rendering thread. If it is called before to
init, render thread won't be created byinitcall.- Parameters:
_msecs- timeout in milliseconds- Returns:
- current renderer state. One of:
RENDER_FRAME_NO_CONTEXTRENDER_FRAME_RENDERRENDER_FRAME_TIMEOUTRENDER_FRAME_EXITINGRENDER_FRAME_COUNT
-
nbgfx_set_platform_data
public static void nbgfx_set_platform_data(long _data) Unsafe version of:set_platform_data -
bgfx_set_platform_data
Sets platform data.Must be called before
init.- Parameters:
_data- the platform data to set
-
nbgfx_get_internal_data
public static long nbgfx_get_internal_data()Unsafe version of:get_internal_data -
bgfx_get_internal_data
Gets internal data for interop. -
bgfx_override_internal_texture_ptr
public static long bgfx_override_internal_texture_ptr(short _handle, long _ptr) Overrides internal texture with externally created texture. Previously created internal texture will released.It's expected you understand some bgfx internals before you use this call.
Must be called only on render thread.
- Parameters:
_handle- texture handle_ptr- native API pointer to texture- Returns:
- native API pointer to texture. If result is 0, texture is not created yet from the main thread.
-
nbgfx_override_internal_texture
public static long nbgfx_override_internal_texture(short _handle, short _width, short _height, byte _numMips, int _format, long _flags) Unsafe version of:override_internal_texture -
bgfx_override_internal_texture
public static long bgfx_override_internal_texture(short _handle, int _width, int _height, int _numMips, int _format, long _flags) Overrides internal texture by creating new texture. Previously created internal texture will released.It's expected you understand some bgfx internals before you use this call.
Must be called only on render thread.
- Parameters:
_handle- texture handle_width- width_height- height_numMips- number of mip-maps_format- texture format_flags- default texture sampling mode is linear, and wrap mode is repeat- Returns:
- native API pointer to texture. If result is 0, texture is not created yet from the main thread.
-