Package org.lwjgl.bgfx
Class BGFXPlatform
- java.lang.Object
-
- org.lwjgl.bgfx.BGFXPlatform
-
public class BGFXPlatform extends java.lang.ObjectNative bindings to the C platform API of the bgfx library.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBGFXPlatform.FunctionsContains the function pointers loaded fromBGFX.getLibrary().
-
Field Summary
Fields Modifier and Type Field Description static intBGFX_RENDER_FRAME_COUNT
BGFX_RENDER_FRAME_EXITING
BGFX_RENDER_FRAME_NO_CONTEXT
BGFX_RENDER_FRAME_RENDER
BGFX_RENDER_FRAME_TIMEOUTRender frame.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static BGFXInternalDatabgfx_get_internal_data()Gets 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 voidbgfx_set_platform_data(BGFXPlatformData _data)Sets platform data.static longnbgfx_get_internal_data()Unsafe 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 Detail
-
BGFX_RENDER_FRAME_NO_CONTEXT, BGFX_RENDER_FRAME_RENDER, BGFX_RENDER_FRAME_TIMEOUT, BGFX_RENDER_FRAME_EXITING, BGFX_RENDER_FRAME_COUNT
Render frame. (bgfx_renderer_frame_t)Enum values:
-
-
Method Detail
-
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
public static void bgfx_set_platform_data(BGFXPlatformData _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
@Nullable public static BGFXInternalData 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.
-
-