Class BGFXCallbackInterface

  • All Implemented Interfaces:
    java.lang.AutoCloseable, NativeResource, Pointer

    public class BGFXCallbackInterface
    extends Struct
    implements NativeResource
    Callback interface to implement application specific behavior.

    Cached items are currently used for OpenGL and Direct3D 12 binary shaders.

    fatal and trace_vargs callbacks can be called from any thread. Other callbacks are called from the render thread.

    Member documentation

    • vtbl – the callback virtual table

    Layout

    
     struct bgfx_callback_interface_t {
         bgfx_callback_vtbl_t const * vtbl;
     }
    • Field Detail

      • SIZEOF

        public static final int SIZEOF
        The struct size in bytes.
      • ALIGNOF

        public static final int ALIGNOF
        The struct alignment in bytes.
      • VTBL

        public static final int VTBL
        The struct member offsets.
    • Constructor Detail

      • BGFXCallbackInterface

        public BGFXCallbackInterface​(java.nio.ByteBuffer container)
        Creates a BGFXCallbackInterface instance at the current position of the specified ByteBuffer container. Changes to the buffer's content will be visible to the struct instance and vice versa.

        The created instance holds a strong reference to the container object.

    • Method Detail

      • sizeof

        public int sizeof()
        Description copied from class: Struct
        Returns sizeof(struct).
        Specified by:
        sizeof in class Struct
      • malloc

        public static BGFXCallbackInterface malloc()
        Returns a new BGFXCallbackInterface instance allocated with memAlloc. The instance must be explicitly freed.
      • calloc

        public static BGFXCallbackInterface calloc()
        Returns a new BGFXCallbackInterface instance allocated with memCalloc. The instance must be explicitly freed.
      • create

        public static BGFXCallbackInterface create​(long address)
        Returns a new BGFXCallbackInterface instance for the specified memory address.
      • createSafe

        @Nullable
        public static BGFXCallbackInterface createSafe​(long address)
        Like create, but returns null if address is NULL.
      • callocStack

        public static BGFXCallbackInterface callocStack()
        Returns a new BGFXCallbackInterface instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
      • mallocStack

        public static BGFXCallbackInterface mallocStack​(MemoryStack stack)
        Returns a new BGFXCallbackInterface instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
      • callocStack

        public static BGFXCallbackInterface callocStack​(MemoryStack stack)
        Returns a new BGFXCallbackInterface instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
      • nvtbl

        public static void nvtbl​(long struct,
                                 BGFXCallbackVtbl value)
        Unsafe version of vtbl.
      • validate

        public static void validate​(long struct)
        Validates pointer members that should not be NULL.
        Parameters:
        struct - the struct to validate
      • validate

        public static void validate​(long array,
                                    int count)
        Calls validate(long) for each struct contained in the specified struct array.
        Parameters:
        array - the struct array to validate
        count - the number of structs in array