Class BGFXTransientVertexBuffer

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class BGFXTransientVertexBuffer extends Struct<BGFXTransientVertexBuffer> implements NativeResource

 struct bgfx_transient_vertex_buffer_t {
     uint8_t * data;
     uint32_t size;
     uint32_t startVertex;
     uint16_t stride;
     bgfx_vertex_buffer_handle_t handle;
     bgfx_vertex_layout_handle_t layoutHandle;
 }
  • 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.
    • STARTVERTEX

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

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

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

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

    • BGFXTransientVertexBuffer

      public BGFXTransientVertexBuffer(ByteBuffer container)
      Creates a BGFXTransientVertexBuffer 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<BGFXTransientVertexBuffer>
    • 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.
    • startVertex

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

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

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

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

      Sets the address of the specified ByteBuffer to the data field.
    • startVertex

      public BGFXTransientVertexBuffer startVertex(int value)
      Sets the specified value to the startVertex field.
    • stride

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

      public BGFXTransientVertexBuffer handle(short value)
      Sets the specified value to the handle field.
    • layoutHandle

      public BGFXTransientVertexBuffer layoutHandle(short value)
      Sets the specified value to the layoutHandle field.
    • set

      public BGFXTransientVertexBuffer set(ByteBuffer data, int startVertex, short stride, short handle, short layoutHandle)
      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 BGFXTransientVertexBuffer malloc()
      Returns a new BGFXTransientVertexBuffer instance allocated with memAlloc. The instance must be explicitly freed.
    • calloc

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

      public static BGFXTransientVertexBuffer create()
      Returns a new BGFXTransientVertexBuffer instance allocated with BufferUtils.
    • create

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

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

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

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

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

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

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

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

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

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

      public static BGFXTransientVertexBuffer.Buffer calloc(int capacity, MemoryStack stack)
      Returns a new BGFXTransientVertexBuffer.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().
    • nstartVertex

      public static int nstartVertex(long struct)
      Unsafe version of startVertex().
    • nstride

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

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

      public static short nlayoutHandle(long struct)
      Unsafe version of layoutHandle().
    • 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.
    • nstartVertex

      public static void nstartVertex(long struct, int value)
      Unsafe version of startVertex.
    • 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.
    • nlayoutHandle

      public static void nlayoutHandle(long struct, short value)
      Unsafe version of layoutHandle.
    • validate

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