Class XrFrameState

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

public class XrFrameState extends org.lwjgl.system.Struct<XrFrameState> 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 Details

    • SIZEOF

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

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

      public static final int TYPE
      The struct member offsets.
    • NEXT

      public static final int NEXT
      The struct member offsets.
    • PREDICTEDDISPLAYTIME

      public static final int PREDICTEDDISPLAYTIME
      The struct member offsets.
    • PREDICTEDDISPLAYPERIOD

      public static final int PREDICTEDDISPLAYPERIOD
      The struct member offsets.
    • SHOULDRENDER

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

    • XrFrameState

      public XrFrameState(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 Details

    • sizeof

      public int sizeof()
      Specified by:
      sizeof in class org.lwjgl.system.Struct<XrFrameState>
    • 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.
    • type$Default

      public XrFrameState type$Default()
      Sets the TYPE_FRAME_STATE value to the type() field.
    • next

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

      Prepends the specified XrSecondaryViewConfigurationFrameStateMSFT value to the next chain.
    • predictedDisplayTime

      public XrFrameState predictedDisplayTime(long value)
      Sets the specified value to the predictedDisplayTime() field.
    • predictedDisplayPeriod

      public XrFrameState predictedDisplayPeriod(long value)
      Sets the specified value to the predictedDisplayPeriod() field.
    • shouldRender

      public XrFrameState shouldRender(boolean value)
      Sets the specified value to the shouldRender() 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

      public static @Nullable 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(int capacity)
      Returns a new XrFrameState.Buffer instance allocated with BufferUtils.
      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

      public static @Nullable 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:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • 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:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • 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.