Class KHRConvertTimespecTime
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe extension name.static final intThe extension specification version. -
Method Summary
Modifier and TypeMethodDescriptionstatic intnxrConvertTimespecTimeToTimeKHR(org.lwjgl.openxr.XrInstance instance, long timespecTime, long time) Unsafe version of:ConvertTimespecTimeToTimeKHRstatic intxrConvertTimespecTimeToTimeKHR(org.lwjgl.openxr.XrInstance instance, long timespecTime, LongBuffer time) Convert timespec monotonic time to XrTime.static intxrConvertTimeToTimespecTimeKHR(org.lwjgl.openxr.XrInstance instance, long time, long timespecTime) Convert XrTime to timespec monotonic time.
-
Field Details
-
XR_KHR_convert_timespec_time_SPEC_VERSION
public static final int XR_KHR_convert_timespec_time_SPEC_VERSIONThe extension specification version.- See Also:
-
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
ConvertTimespecTimeToTimeKHRfunction converts a time obtained by theclock_gettimefunction to the equivalentXrTime.If the output
timecannot represent the inputtimespecTime, the runtime must returnERROR_TIME_INVALID.Valid Usage (Implicit)
- The
XR_KHR_convert_timespec_timeextension must be enabled prior to callingConvertTimespecTimeToTimeKHR instancemust be a validXrInstancehandletimespecTimemust be a pointer to a validtimespecvaluetimemust be a pointer to anXrTimevalue
Return Codes
- On success, this command returns
- On failure, this command returns
- Parameters:
instance- anXrInstancehandle previously created withCreateInstance.timespecTime- atimespecobtained fromclock_gettimewithCLOCK_MONOTONIC.time- the resultingXrTimethat is equivalent to thetimespecTime.
- The
-
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
XrTimeto timespec monotonic time, call:XrResult xrConvertTimeToTimespecTimeKHR( XrInstance instance, XrTime time, struct timespec* timespecTime);Description
The
ConvertTimeToTimespecTimeKHRfunction converts anXrTimeto time as if generated byclock_gettime.If the output
timespecTimecannot represent the inputtime, the runtime must returnERROR_TIME_INVALID.Valid Usage (Implicit)
- The
XR_KHR_convert_timespec_timeextension must be enabled prior to callingConvertTimeToTimespecTimeKHR instancemust be a validXrInstancehandletimespecTimemust be a pointer to atimespecvalue
Return Codes
- On success, this command returns
- On failure, this command returns
- Parameters:
instance- anXrInstancehandle previously created withCreateInstance.time- anXrTime.timespecTime- the resulting timespec time that is equivalent to atimespecobtained fromclock_gettimewithCLOCK_MONOTONIC.
- The
-