Class XrFrameState

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

    public class XrFrameState
    extends org.lwjgl.system.Struct
    implements org.lwjgl.system.NativeResource
    Frame prediction structure.
    Description

    XrFrameState describes the time at which the next frame will be displayed to the user. predictedDisplayTime must refer to the midpoint of the interval during which the frame is displayed. The runtime may report a different predictedDisplayPeriod from the hardware’s refresh cycle.

    For any frame where shouldRender is FALSE, the application should avoid heavy GPU work for that frame, for example by not rendering its layers. This typically happens when the application is transitioning into or out of a running session, or when some system UI is fully covering the application at the moment. As long as the session is running, the application should keep running the frame loop to maintain the frame synchronization to the runtime, even if this requires calling EndFrame with all layers omitted.

    Valid Usage (Implicit)
    See Also

    XrFrameWaitInfo, WaitFrame

    Layout

    
     struct XrFrameState {
         XrStructureType type();
         void * next();
         XrTime predictedDisplayTime();
         XrDuration predictedDisplayPeriod();
         XrBool32 shouldRender();
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • TYPE, NEXT, PREDICTEDDISPLAYTIME, PREDICTEDDISPLAYPERIOD, SHOULDRENDER

        The struct member offsets.
    • Constructor Detail

      • XrFrameState

        public XrFrameState​(java.nio.ByteBuffer container)
        Creates a XrFrameState 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
      • type

        public int type()
        the XrStructureType of this structure.
      • next

        public long next()
        NULL or a pointer to the next structure in a structure chain. No such structures are defined in core OpenXR.
      • predictedDisplayTime

        public long predictedDisplayTime()
        the anticipated display XrTime for the next application-generated frame.
      • predictedDisplayPeriod

        public long predictedDisplayPeriod()
        the XrDuration of the display period for the next application-generated frame, for use in predicting display times beyond the next one.
      • shouldRender

        public boolean shouldRender()
        TRUE if the application should render its layers as normal and submit them to EndFrame. When this value is FALSE, the application should avoid heavy GPU work where possible, for example by skipping layer rendering and then omitting those layers when calling EndFrame.
      • type

        public XrFrameState type​(int value)
        Sets the specified value to the type() field.
      • next

        public XrFrameState next​(long value)
        Sets the specified value to the next() field.
      • set

        public XrFrameState set​(int type,
                                long next,
                                long predictedDisplayTime,
                                long predictedDisplayPeriod,
                                boolean shouldRender)
        Initializes this struct with the specified values.
      • set

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

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

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

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

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

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

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

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

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

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

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

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

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

        public static XrFrameState.Buffer calloc​(int capacity,
                                                 org.lwjgl.system.MemoryStack stack)
        Returns a new XrFrameState.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
      • ntype

        public static int ntype​(long struct)
        Unsafe version of type().
      • nnext

        public static long nnext​(long struct)
        Unsafe version of next().
      • npredictedDisplayTime

        public static long npredictedDisplayTime​(long struct)
        Unsafe version of predictedDisplayTime().
      • npredictedDisplayPeriod

        public static long npredictedDisplayPeriod​(long struct)
        Unsafe version of predictedDisplayPeriod().
      • nshouldRender

        public static int nshouldRender​(long struct)
        Unsafe version of shouldRender().
      • ntype

        public static void ntype​(long struct,
                                 int value)
        Unsafe version of type.
      • nnext

        public static void nnext​(long struct,
                                 long value)
        Unsafe version of next.
      • npredictedDisplayTime

        public static void npredictedDisplayTime​(long struct,
                                                 long value)
        Unsafe version of predictedDisplayTime.
      • npredictedDisplayPeriod

        public static void npredictedDisplayPeriod​(long struct,
                                                   long value)
        Unsafe version of predictedDisplayPeriod.
      • nshouldRender

        public static void nshouldRender​(long struct,
                                         int value)
        Unsafe version of shouldRender.