Class VkRect2D

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

    public class VkRect2D
    extends org.lwjgl.system.Struct
    implements org.lwjgl.system.NativeResource
    Structure specifying a two-dimensional subregion.

    Member documentation

    • offset – a VkOffset2D specifying the rectangle offset.
    • extent – a VkExtent2D specifying the rectangle extent.

    Layout

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

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • OFFSET, EXTENT

        The struct member offsets.
    • Constructor Detail

      • VkRect2D

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

      • sizeof

        public int sizeof()
        Specified by:
        sizeof in class org.lwjgl.system.Struct
      • offset

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

        public VkRect2D extent​(java.util.function.Consumer<VkExtent2D> consumer)
        Passes the extent field to the specified Consumer.
      • 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

        @Nullable
        public static 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

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

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

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

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

        public static VkRect2D callocStack​(org.lwjgl.system.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
      • mallocStack

        public static VkRect2D.Buffer mallocStack​(int capacity)
        Returns a new VkRect2D.Buffer instance allocated on the thread-local MemoryStack.
        Parameters:
        capacity - the buffer capacity
      • callocStack

        public static VkRect2D.Buffer callocStack​(int capacity)
        Returns a new VkRect2D.Buffer instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
        Parameters:
        capacity - the buffer capacity
      • mallocStack

        public static VkRect2D.Buffer mallocStack​(int capacity,
                                                  org.lwjgl.system.MemoryStack stack)
        Returns a new VkRect2D.Buffer instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
        capacity - the buffer capacity
      • callocStack

        public static VkRect2D.Buffer callocStack​(int capacity,
                                                  org.lwjgl.system.MemoryStack stack)
        Returns a new VkRect2D.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
        capacity - the buffer capacity
      • 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.