Class XrRect2Di

java.lang.Object
org.lwjgl.system.Pointer.Default
org.lwjgl.system.Struct<XrRect2Di>
org.lwjgl.openxr.XrRect2Di
All Implemented Interfaces:
AutoCloseable, org.lwjgl.system.NativeResource, org.lwjgl.system.Pointer

public class XrRect2Di extends org.lwjgl.system.Struct<XrRect2Di> implements org.lwjgl.system.NativeResource
Rect in two dimensions, integer values.
Description

This variant is for representing discrete values such as texels. For representing physical distances, the floating-point variant XrRect2Df is used instead.

The offset is the position of the rectangle corner with minimum value coordinates. The other three corners are computed by adding the XrExtent2Di::width to the x offset, XrExtent2Di::height to the y offset, or both.

See Also

XrExtent2Di, XrOffset2Di, XrRect2Df, XrSwapchainSubImage

Layout


 struct XrRect2Di {
     XrOffset2Di offset();
     XrExtent2Di 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

    • XrRect2Di

      public XrRect2Di(ByteBuffer container)
      Creates a XrRect2Di 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()
      Specified by:
      sizeof in class org.lwjgl.system.Struct<XrRect2Di>
    • offset

      public XrOffset2Di offset()
      the XrOffset2Di specifying the integer rectangle offset.
    • extent

      public XrExtent2Di extent()
      the XrExtent2Di specifying the integer rectangle extent.
    • offset

      public XrRect2Di offset(XrOffset2Di value)
      Copies the specified XrOffset2Di to the offset() field.
    • offset

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

      public XrRect2Di extent(XrExtent2Di value)
      Copies the specified XrExtent2Di to the extent() field.
    • extent

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

      public XrRect2Di set(XrOffset2Di offset, XrExtent2Di extent)
      Initializes this struct with the specified values.
    • set

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      public static XrRect2Di.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack)
      Returns a new XrRect2Di.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 XrOffset2Di noffset(long struct)
      Unsafe version of offset().
    • nextent

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

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

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