Package org.lwjgl.bgfx
Class BGFXPlatform
- java.lang.Object
-
- org.lwjgl.bgfx.BGFXPlatform
-
public class BGFXPlatform extends java.lang.Object
Native bindings to the C platform API of the bgfx library.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BGFXPlatform.Functions
Contains the function pointers loaded fromBGFX.getLibrary()
.
-
Field Summary
Fields Modifier and Type Field Description static int
BGFX_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 BGFXInternalData
bgfx_get_internal_data()
Gets internal data for interop.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.static long
bgfx_override_internal_texture_ptr(short _handle, long _ptr)
Overrides internal texture with externally created texture.static int
bgfx_render_frame(int _msecs)
Render frame.static void
bgfx_set_platform_data(BGFXPlatformData _data)
Sets platform data.static long
nbgfx_get_internal_data()
Unsafe version of:get_internal_data
static long
nbgfx_override_internal_texture(short _handle, short _width, short _height, byte _numMips, int _format, long _flags)
Unsafe version of:override_internal_texture
static void
nbgfx_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_frame
is blocking call. It waits forframe
to be called from API thread to process frame. If timeout value is passed call will timeout and return even ifbgfx_frame
is 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 byinit
call.- Parameters:
_msecs
- timeout in milliseconds- Returns:
- current renderer state. One of:
RENDER_FRAME_NO_CONTEXT
RENDER_FRAME_RENDER
RENDER_FRAME_TIMEOUT
RENDER_FRAME_EXITING
RENDER_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.
-
-