Class BGFXAttachment

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class BGFXAttachment extends Struct<BGFXAttachment> implements NativeResource

 struct bgfx_attachment_t {
     bgfx_access_t access;
     bgfx_texture_handle_t handle;
     uint16_t mip;
     uint16_t layer;
     uint16_t numLayers;
     uint8_t resolve;
 }
  • Field Details

    • SIZEOF

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

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

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

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

      public static final int MIP
      The struct member offsets.
    • LAYER

      public static final int LAYER
      The struct member offsets.
    • NUMLAYERS

      public static final int NUMLAYERS
      The struct member offsets.
    • RESOLVE

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

    • BGFXAttachment

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

      public int access()
      Returns:
      the value of the access field.
    • handle

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

      public short mip()
      Returns:
      the value of the mip field.
    • layer

      public short layer()
      Returns:
      the value of the layer field.
    • numLayers

      public short numLayers()
      Returns:
      the value of the numLayers field.
    • resolve

      public byte resolve()
      Returns:
      the value of the resolve field.
    • access

      public BGFXAttachment access(int value)
      Sets the specified value to the access field.
    • handle

      public BGFXAttachment handle(short value)
      Sets the specified value to the handle field.
    • mip

      public BGFXAttachment mip(short value)
      Sets the specified value to the mip field.
    • layer

      public BGFXAttachment layer(short value)
      Sets the specified value to the layer field.
    • numLayers

      public BGFXAttachment numLayers(short value)
      Sets the specified value to the numLayers field.
    • resolve

      public BGFXAttachment resolve(byte value)
      Sets the specified value to the resolve field.
    • set

      public BGFXAttachment set(int access, short handle, short mip, short layer, short numLayers, byte resolve)
      Initializes this struct with the specified values.
    • set

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

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

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

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

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

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

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

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

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

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

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

      @Deprecated public static BGFXAttachment mallocStack()
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.
    • callocStack

      @Deprecated public static BGFXAttachment callocStack()
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.
    • mallocStack

      @Deprecated public static BGFXAttachment mallocStack(MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.
    • callocStack

      @Deprecated public static BGFXAttachment callocStack(MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.
    • mallocStack

      @Deprecated public static BGFXAttachment.Buffer mallocStack(int capacity)
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(int, MemoryStack) instead.
    • callocStack

      @Deprecated public static BGFXAttachment.Buffer callocStack(int capacity)
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(int, MemoryStack) instead.
    • mallocStack

      @Deprecated public static BGFXAttachment.Buffer mallocStack(int capacity, MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(int, MemoryStack) instead.
    • callocStack

      @Deprecated public static BGFXAttachment.Buffer callocStack(int capacity, MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(int, MemoryStack) instead.
    • malloc

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

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

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

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

      public static int naccess(long struct)
      Unsafe version of access().
    • nhandle

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

      public static short nmip(long struct)
      Unsafe version of mip().
    • nlayer

      public static short nlayer(long struct)
      Unsafe version of layer().
    • nnumLayers

      public static short nnumLayers(long struct)
      Unsafe version of numLayers().
    • nresolve

      public static byte nresolve(long struct)
      Unsafe version of resolve().
    • naccess

      public static void naccess(long struct, int value)
      Unsafe version of access.
    • nhandle

      public static void nhandle(long struct, short value)
      Unsafe version of handle.
    • nmip

      public static void nmip(long struct, short value)
      Unsafe version of mip.
    • nlayer

      public static void nlayer(long struct, short value)
      Unsafe version of layer.
    • nnumLayers

      public static void nnumLayers(long struct, short value)
      Unsafe version of numLayers.
    • nresolve

      public static void nresolve(long struct, byte value)
      Unsafe version of resolve.