Class KHRConvertTimespecTime

java.lang.Object
org.lwjgl.openxr.KHRConvertTimespecTime

public class KHRConvertTimespecTime extends Object
The XR_KHR_convert_timespec_time extension.

This extension provides two functions for converting between timespec monotonic time and XrTime. The ConvertTimespecTimeToTimeKHR function converts from timespec time to XrTime, while the ConvertTimeToTimespecTimeKHR function converts XrTime to timespec monotonic time. The primary use case for this functionality is to be able to synchronize events between the local system and the OpenXR system.

  • Field Details

    • XR_KHR_convert_timespec_time_SPEC_VERSION

      public static final int XR_KHR_convert_timespec_time_SPEC_VERSION
      The extension specification version.
      See Also:
    • XR_KHR_CONVERT_TIMESPEC_TIME_EXTENSION_NAME

      public static final String XR_KHR_CONVERT_TIMESPEC_TIME_EXTENSION_NAME
      The extension name.
      See Also:
  • Method Details

    • nxrConvertTimespecTimeToTimeKHR

      public static int nxrConvertTimespecTimeToTimeKHR(org.lwjgl.openxr.XrInstance instance, long timespecTime, long time)
      Unsafe version of: ConvertTimespecTimeToTimeKHR
    • xrConvertTimespecTimeToTimeKHR

      public static int xrConvertTimespecTimeToTimeKHR(org.lwjgl.openxr.XrInstance instance, long timespecTime, LongBuffer time)
      Convert timespec monotonic time to XrTime.
      C Specification

      To convert from timespec monotonic time to XrTime, call:

      
       XrResult xrConvertTimespecTimeToTimeKHR(
           XrInstance                                  instance,
           const struct timespec*                      timespecTime,
           XrTime*                                     time);
      Description

      The ConvertTimespecTimeToTimeKHR function converts a time obtained by the clock_gettime function to the equivalent XrTime.

      If the output time cannot represent the input timespecTime, the runtime must return ERROR_TIME_INVALID.

      Valid Usage (Implicit)
      Return Codes
      On success, this command returns
      On failure, this command returns
      Parameters:
      instance - an XrInstance handle previously created with CreateInstance.
      timespecTime - a timespec obtained from clock_gettime with CLOCK_MONOTONIC.
      time - the resulting XrTime that is equivalent to the timespecTime.
    • xrConvertTimeToTimespecTimeKHR

      public static int xrConvertTimeToTimespecTimeKHR(org.lwjgl.openxr.XrInstance instance, long time, long timespecTime)
      Convert XrTime to timespec monotonic time.
      C Specification

      To convert from XrTime to timespec monotonic time, call:

      
       XrResult xrConvertTimeToTimespecTimeKHR(
           XrInstance                                  instance,
           XrTime                                      time,
           struct timespec*                            timespecTime);
      Description

      The ConvertTimeToTimespecTimeKHR function converts an XrTime to time as if generated by clock_gettime.

      If the output timespecTime cannot represent the input time, the runtime must return ERROR_TIME_INVALID.

      Valid Usage (Implicit)
      Return Codes
      On success, this command returns
      On failure, this command returns
      Parameters:
      instance - an XrInstance handle previously created with CreateInstance.
      time - an XrTime.
      timespecTime - the resulting timespec time that is equivalent to a timespec obtained from clock_gettime with CLOCK_MONOTONIC.