Class BGFXInstanceDataBuffer

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class BGFXInstanceDataBuffer extends Struct<BGFXInstanceDataBuffer> implements NativeResource

 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 Details

    • SIZEOF

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

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

      public static final int DATA
      The struct member offsets.
    • SIZE

      public static final int SIZE
      The struct member offsets.
    • OFFSET

      public static final int OFFSET
      The struct member offsets.
    • NUM

      public static final int NUM
      The struct member offsets.
    • STRIDE

      public static final int STRIDE
      The struct member offsets.
    • HANDLE

      public static final int HANDLE
      The struct member offsets.
  • Constructor Details

    • BGFXInstanceDataBuffer

      public BGFXInstanceDataBuffer(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 Details

    • sizeof

      public int sizeof()
      Description copied from class: Struct
      Returns sizeof(struct).
      Specified by:
      sizeof in class Struct<BGFXInstanceDataBuffer>
    • data

      public 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(ByteBuffer value)
      Sets the address of the specified ByteBuffer to the data field.
    • offset

      public BGFXInstanceDataBuffer offset(int value)
      Sets the specified value to the offset field.
    • num

      public BGFXInstanceDataBuffer num(int value)
      Sets the specified value to the num 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(ByteBuffer data, int offset, int num, short stride, short handle)
      Initializes this struct with the specified values.
    • set

      Copies the specified struct data to this struct.
      Parameters:
      src - the source struct
      Returns:
      this struct
    • 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()
      Returns a new BGFXInstanceDataBuffer instance allocated with BufferUtils.
    • create

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

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

      public static BGFXInstanceDataBuffer.Buffer malloc(int capacity)
      Returns a new BGFXInstanceDataBuffer.Buffer instance allocated with memAlloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • calloc

      public static BGFXInstanceDataBuffer.Buffer calloc(int capacity)
      Returns a new BGFXInstanceDataBuffer.Buffer instance allocated with memCalloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • create

      public static BGFXInstanceDataBuffer.Buffer create(int capacity)
      Returns a new BGFXInstanceDataBuffer.Buffer instance allocated with BufferUtils.
      Parameters:
      capacity - the buffer capacity
    • create

      public static BGFXInstanceDataBuffer.Buffer create(long address, int capacity)
      Create a BGFXInstanceDataBuffer.Buffer instance at the specified memory.
      Parameters:
      address - the memory address
      capacity - the buffer capacity
    • createSafe

      public static @Nullable BGFXInstanceDataBuffer.Buffer createSafe(long address, int capacity)
      Like create, but returns null if address is NULL.
    • malloc

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

      public static BGFXInstanceDataBuffer calloc(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
    • malloc

      public static BGFXInstanceDataBuffer.Buffer malloc(int capacity, MemoryStack stack)
      Returns a new BGFXInstanceDataBuffer.Buffer instance allocated on the specified MemoryStack.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • calloc

      public static BGFXInstanceDataBuffer.Buffer calloc(int capacity, MemoryStack stack)
      Returns a new BGFXInstanceDataBuffer.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • ndata

      public static 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, 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