Class BGFXUniformInfo

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class BGFXUniformInfo extends Struct<BGFXUniformInfo> implements NativeResource

 struct bgfx_uniform_info_t {
     char name[256];
     bgfx_uniform_type_t type;
     uint16_t num;
 }
  • Field Details

    • SIZEOF

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

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

      public static final int NAME
      The struct member offsets.
    • TYPE

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

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

    • BGFXUniformInfo

      public BGFXUniformInfo(ByteBuffer container)
      Creates a BGFXUniformInfo 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<BGFXUniformInfo>
    • name

      public ByteBuffer name()
      Returns:
      a ByteBuffer view of the name field.
    • nameString

      public String nameString()
      Returns:
      the null-terminated string stored in the name field.
    • type

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

      public short num()
      Returns:
      the value of the num field.
    • name

      public BGFXUniformInfo name(ByteBuffer value)
      Copies the specified encoded string to the name field.
    • type

      public BGFXUniformInfo type(int value)
      Sets the specified value to the type field.
    • num

      public BGFXUniformInfo num(short value)
      Sets the specified value to the num field.
    • set

      public BGFXUniformInfo set(ByteBuffer name, int type, short num)
      Initializes this struct with the specified values.
    • set

      public BGFXUniformInfo set(BGFXUniformInfo src)
      Copies the specified struct data to this struct.
      Parameters:
      src - the source struct
      Returns:
      this struct
    • malloc

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      public static ByteBuffer nname(long struct)
      Unsafe version of name().
    • nnameString

      public static String nnameString(long struct)
      Unsafe version of nameString().
    • ntype

      public static int ntype(long struct)
      Unsafe version of type().
    • nnum

      public static short nnum(long struct)
      Unsafe version of num().
    • nname

      public static void nname(long struct, ByteBuffer value)
      Unsafe version of name.
    • ntype

      public static void ntype(long struct, int value)
      Unsafe version of type.
    • nnum

      public static void nnum(long struct, short value)
      Unsafe version of num.