Class BGFXAttachment

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

    public class BGFXAttachment
    extends Struct
    implements NativeResource
    Frame buffer texture attachment info.

    Member documentation

    • access – attachment access
    • handle – render target texture handle
    • mip – mip level
    • layer – cubemap side or depth layer/slice
    • resolve – resolve flags. One of:
      RESOLVE_NONERESOLVE_AUTO_GEN_MIPS

    Layout

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

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • ACCESS, HANDLE, MIP, LAYER, RESOLVE

        The struct member offsets.
    • Constructor Detail

      • BGFXAttachment

        public BGFXAttachment​(java.nio.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 Detail

      • sizeof

        public int sizeof()
        Description copied from class: Struct
        Returns sizeof(struct).
        Specified by:
        sizeof in class Struct
      • 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.
      • 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.
      • 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,
                                  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​(long address)
        Returns a new BGFXAttachment instance for the specified memory address.
      • createSafe

        @Nullable
        public static BGFXAttachment createSafe​(long address)
        Like create, but returns null if address is NULL.
      • 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

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

        public static BGFXAttachment mallocStack()
        Returns a new BGFXAttachment instance allocated on the thread-local MemoryStack.
      • callocStack

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

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

        public static BGFXAttachment callocStack​(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
      • 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().
      • 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.
      • nresolve

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