Class BGFXVertexDecl

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

    public class BGFXVertexDecl
    extends Struct
    implements NativeResource
    Vertex declaration.

    Member documentation

    • stride – vertex stride
    • offset – relative attribute offset from the vertex

    Layout

    
     struct bgfx_vertex_decl_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

      • BGFXVertexDecl

        public BGFXVertexDecl​(java.nio.ByteBuffer container)
        Creates a BGFXVertexDecl 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 BGFXVertexDecl hash​(int value)
        Sets the specified value to the hash field.
      • stride

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

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

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

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

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

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

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

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

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

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