Package org.lwjgl.sdl

Class SDL_GPUVertexAttribute

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class SDL_GPUVertexAttribute extends Struct<SDL_GPUVertexAttribute> implements NativeResource

 struct SDL_GPUVertexAttribute {
     Uint32 location;
     Uint32 buffer_slot;
     SDL_GPUVertexElementFormat format;
     Uint32 offset;
 }
  • Field Details

    • SIZEOF

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

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

      public static final int LOCATION
      The struct member offsets.
    • BUFFER_SLOT

      public static final int BUFFER_SLOT
      The struct member offsets.
    • FORMAT

      public static final int FORMAT
      The struct member offsets.
    • OFFSET

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

    • SDL_GPUVertexAttribute

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

      public int location()
      Returns:
      the value of the location field.
    • buffer_slot

      public int buffer_slot()
      Returns:
      the value of the buffer_slot field.
    • format

      public int format()
      Returns:
      the value of the format field.
    • offset

      public int offset()
      Returns:
      the value of the offset field.
    • location

      public SDL_GPUVertexAttribute location(int value)
      Sets the specified value to the location field.
    • buffer_slot

      public SDL_GPUVertexAttribute buffer_slot(int value)
      Sets the specified value to the buffer_slot field.
    • format

      public SDL_GPUVertexAttribute format(int value)
      Sets the specified value to the format field.
    • offset

      public SDL_GPUVertexAttribute offset(int value)
      Sets the specified value to the offset field.
    • set

      public SDL_GPUVertexAttribute set(int location, int buffer_slot, int format, int offset)
      Initializes this struct with the specified values.
    • set

      Copies the specified struct data to this struct.
      Parameters:
      src - the source struct
      Returns:
      this struct
    • malloc

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      public static int nlocation(long struct)
      Unsafe version of location().
    • nbuffer_slot

      public static int nbuffer_slot(long struct)
      Unsafe version of buffer_slot().
    • nformat

      public static int nformat(long struct)
      Unsafe version of format().
    • noffset

      public static int noffset(long struct)
      Unsafe version of offset().
    • nlocation

      public static void nlocation(long struct, int value)
      Unsafe version of location.
    • nbuffer_slot

      public static void nbuffer_slot(long struct, int value)
      Unsafe version of buffer_slot.
    • nformat

      public static void nformat(long struct, int value)
      Unsafe version of format.
    • noffset

      public static void noffset(long struct, int value)
      Unsafe version of offset.