Class BGFXPlatform


  • public class BGFXPlatform
    extends java.lang.Object
    Native bindings to the C platform API of the bgfx library.
    • Method Detail

      • bgfx_render_frame

        public static int bgfx_render_frame​(int _msecs)
        Render frame.

        bgfx_render_frame is blocking call. It waits for frame to be called from API thread to process frame. If timeout value is passed call will timeout and return even if bgfx_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 by init 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,
                                                           int _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,
                                                          int _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.