Class BGFXInstanceDataBuffer

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

    public class BGFXInstanceDataBuffer
    extends Struct
    implements NativeResource
    Instance data buffer info.

    Member documentation

    • data – pointer to data
    • size – data size
    • offset – offset in vertex buffer
    • num – number of instances
    • stride – vertex stride
    • handle – vertex buffer object handle

    Layout

    
     struct bgfx_instance_data_buffer_t {
         uint8_t * data;
         uint32_t size;
         uint32_t offset;
         uint32_t num;
         uint16_t stride;
         bgfx_vertex_buffer_handle_t handle;
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • DATA, SIZE, OFFSET, NUM, STRIDE, HANDLE

        The struct member offsets.
    • Constructor Detail

      • BGFXInstanceDataBuffer

        public BGFXInstanceDataBuffer​(java.nio.ByteBuffer container)
        Creates a BGFXInstanceDataBuffer 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
      • data

        public java.nio.ByteBuffer data()
        Returns a ByteBuffer view of the data pointed to by the data field.
      • size

        public int size()
        Returns the value of the size field.
      • offset

        public int offset()
        Returns the value of the offset field.
      • num

        public int num()
        Returns the value of the num field.
      • stride

        public short stride()
        Returns the value of the stride field.
      • handle

        public short handle()
        Returns the value of the handle field.
      • data

        public BGFXInstanceDataBuffer data​(java.nio.ByteBuffer value)
        Sets the address of the specified ByteBuffer to the data field.
      • stride

        public BGFXInstanceDataBuffer stride​(short value)
        Sets the specified value to the stride field.
      • handle

        public BGFXInstanceDataBuffer handle​(short value)
        Sets the specified value to the handle field.
      • set

        public BGFXInstanceDataBuffer set​(java.nio.ByteBuffer data,
                                          int offset,
                                          int num,
                                          short stride,
                                          short handle)
        Initializes this struct with the specified values.
      • malloc

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

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

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

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

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

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

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

        public static java.nio.ByteBuffer ndata​(long struct)
        Unsafe version of data.
      • nsize

        public static int nsize​(long struct)
        Unsafe version of size().
      • noffset

        public static int noffset​(long struct)
        Unsafe version of offset().
      • nnum

        public static int nnum​(long struct)
        Unsafe version of num().
      • nstride

        public static short nstride​(long struct)
        Unsafe version of stride().
      • nhandle

        public static short nhandle​(long struct)
        Unsafe version of handle().
      • ndata

        public static void ndata​(long struct,
                                 java.nio.ByteBuffer value)
        Unsafe version of data.
      • nsize

        public static void nsize​(long struct,
                                 int value)
        Sets the specified value to the size field of the specified struct.
      • noffset

        public static void noffset​(long struct,
                                   int value)
        Unsafe version of offset.
      • nnum

        public static void nnum​(long struct,
                                int value)
        Unsafe version of num.
      • nstride

        public static void nstride​(long struct,
                                   short value)
        Unsafe version of stride.
      • nhandle

        public static void nhandle​(long struct,
                                   short value)
        Unsafe version of handle.
      • 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