Class VkRect2D

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class VkRect2D extends Struct<VkRect2D> implements NativeResource

 struct VkRect2D {
     VkOffset2D offset;
     VkExtent2D extent;
 }
  • Field Details

    • SIZEOF

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

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

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

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

    • VkRect2D

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

      public VkOffset2D offset()
      Returns:
      a VkOffset2D view of the offset field.
    • extent

      public VkExtent2D extent()
      Returns:
      a VkExtent2D view of the extent field.
    • offset

      public VkRect2D offset(VkOffset2D value)
      Copies the specified VkOffset2D to the offset field.
    • offset

      public VkRect2D offset(Consumer<VkOffset2D> consumer)
      Passes the offset field to the specified Consumer.
    • extent

      public VkRect2D extent(VkExtent2D value)
      Copies the specified VkExtent2D to the extent field.
    • extent

      public VkRect2D extent(Consumer<VkExtent2D> consumer)
      Passes the extent field to the specified Consumer.
    • set

      public VkRect2D set(VkOffset2D offset, VkExtent2D extent)
      Initializes this struct with the specified values.
    • set

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      public static VkOffset2D noffset(long struct)
      Unsafe version of offset().
    • nextent

      public static VkExtent2D nextent(long struct)
      Unsafe version of extent().
    • noffset

      public static void noffset(long struct, VkOffset2D value)
      Unsafe version of offset.
    • nextent

      public static void nextent(long struct, VkExtent2D value)
      Unsafe version of extent.