Class BGFXVertexLayout

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

    public class BGFXVertexLayout
    extends Struct
    implements NativeResource
    Vertex layout.

    Member documentation

    • stride – vertex stride
    • offset[BGFX_ATTRIB_COUNT] – relative attribute offset from the vertex

    Layout

    
     struct bgfx_vertex_layout_t {
         uint32_t hash;
         uint16_t stride;
         uint16_t offset[BGFX_ATTRIB_COUNT];
         uint16_t attributes[BGFX_ATTRIB_COUNT];
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • HASH, STRIDE, OFFSET, ATTRIBUTES

        The struct member offsets.
    • Constructor Detail

      • BGFXVertexLayout

        public BGFXVertexLayout​(java.nio.ByteBuffer container)
        Creates a BGFXVertexLayout 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
      • hash

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

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

        public java.nio.ShortBuffer offset()
        Returns a ShortBuffer view of the offset field.
      • offset

        public short offset​(int index)
        Returns the value at the specified index of the offset field.
      • attributes

        public java.nio.ShortBuffer attributes()
        Returns a ShortBuffer view of the attributes field.
      • attributes

        public short attributes​(int index)
        Returns the value at the specified index of the attributes field.
      • hash

        public BGFXVertexLayout hash​(int value)
        Sets the specified value to the hash field.
      • stride

        public BGFXVertexLayout stride​(short value)
        Sets the specified value to the stride field.
      • offset

        public BGFXVertexLayout offset​(java.nio.ShortBuffer value)
        Copies the specified ShortBuffer to the offset field.
      • offset

        public BGFXVertexLayout offset​(int index,
                                       short value)
        Sets the specified value at the specified index of the offset field.
      • attributes

        public BGFXVertexLayout attributes​(java.nio.ShortBuffer value)
        Copies the specified ShortBuffer to the attributes field.
      • attributes

        public BGFXVertexLayout attributes​(int index,
                                           short value)
        Sets the specified value at the specified index of the attributes field.
      • set

        public BGFXVertexLayout set​(int hash,
                                    short stride,
                                    java.nio.ShortBuffer offset,
                                    java.nio.ShortBuffer attributes)
        Initializes this struct with the specified values.
      • set

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

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

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

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

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

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

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

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

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

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

        public static int nhash​(long struct)
        Unsafe version of hash().
      • nstride

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

        public static java.nio.ShortBuffer noffset​(long struct)
        Unsafe version of offset().
      • noffset

        public static short noffset​(long struct,
                                    int index)
        Unsafe version of offset.
      • nattributes

        public static java.nio.ShortBuffer nattributes​(long struct)
        Unsafe version of attributes().
      • nattributes

        public static short nattributes​(long struct,
                                        int index)
        Unsafe version of attributes.
      • nhash

        public static void nhash​(long struct,
                                 int value)
        Unsafe version of hash.
      • nstride

        public static void nstride​(long struct,
                                   short value)
        Unsafe version of stride.
      • noffset

        public static void noffset​(long struct,
                                   java.nio.ShortBuffer value)
        Unsafe version of offset.
      • noffset

        public static void noffset​(long struct,
                                   int index,
                                   short value)
        Unsafe version of offset.
      • nattributes

        public static void nattributes​(long struct,
                                       java.nio.ShortBuffer value)
        Unsafe version of attributes.
      • nattributes

        public static void nattributes​(long struct,
                                       int index,
                                       short value)
        Unsafe version of attributes.