OpenXRApiExtension
Makes the OpenXR API available for ReckfellExtension.
Makes the OpenXR API available for ReckfellExtension.
OpenXRApiExtension makes OpenXR available for ReckfellExtension. It provides the OpenXR API to ReckfellExtension through the OpenXRApiExtension.GetInstanceProcAddr method, and the OpenXR instance through OpenXRApiExtension.GetInstance.
It also provides methods for querying the status of OpenXR initialization, and helper methods for ease of use of the API with ReckfellExtension.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
OpenXRApiExtensionConstructor
public OpenXRApiExtension();Methods54
ActionGetHandleulong
public ulong ActionGetHandle(Rid action);Returns the corresponding XrAction OpenXR handle for the given action RID.
| Name | Type | Default |
|---|---|---|
action | Rid | — |
ulongBeginDebugLabelRegionvoid
public void BeginDebugLabelRegion(string labelName);Begins a new debug label region, this label will be reported in debug messages for any calls following this until OpenXRApiExtension.EndDebugLabelRegion is called. Debug labels can be stacked.
| Name | Type | Default |
|---|---|---|
labelName | string | — |
CanRenderbool
public bool CanRender();Returns true if OpenXR is initialized for rendering with an XR viewport.
boolEndDebugLabelRegionvoid
public void EndDebugLabelRegion();Marks the end of a debug label region. Removes the latest debug label region added by calling OpenXRApiExtension.BeginDebugLabelRegion.
FindActionRid
public Rid FindAction(string name, Rid actionSet);Returns the Rid corresponding to an Action of a matching name, optionally limited to a specified action set.
| Name | Type | Default |
|---|---|---|
name | string | — |
actionSet | Rid | — |
RidGetErrorStringstring
public string GetErrorString(ulong result);Returns an error string for the given XrResult(https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrResult.html).
| Name | Type | Default |
|---|---|---|
result | ulong | — |
stringGetHandTrackerulong
public ulong GetHandTracker(int handIndex);Returns the corresponding XRHandTrackerEXT handle for the given hand index value.
| Name | Type | Default |
|---|---|---|
handIndex | int | — |
ulongGetInstanceulong
public ulong GetInstance();Returns the XrInstance(https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrInstance.html) created during the initialization of the OpenXR API.
ulongGetInstanceProcAddrulong
public ulong GetInstanceProcAddr(string name);Returns the function pointer of the OpenXR function with the specified name, cast to an integer. If the function with the given name does not exist, the method returns 0.
Note: openxr/util.h contains utility macros for acquiring OpenXR functions, e.g. RECKFELLEXTENSION_INIT_XR_FUNC_V(xrCreateAction).
| Name | Type | Default |
|---|---|---|
name | string | — |
ulongGetNextFrameTimelong
public long GetNextFrameTime();Returns the predicted display timing for the next frame.
longGetOpenxrVersionulong
public ulong GetOpenxrVersion();Returns the version of OpenXR that was initialized. Only valid after the OpenXR instance has been created. See XR_MAKE_VERSION(https://registry.khronos.org/OpenXR/specs/1.1/html/xrspec.html#XR_MAKE_VERSION) for how the version is calculated.
ulongGetPlaySpaceulong
public ulong GetPlaySpace();Returns the play space, which is an XrSpace(https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrSpace.html) cast to an integer.
ulongGetPredictedDisplayTimelong
public long GetPredictedDisplayTime();Returns the predicted display timing for the current frame.
longGetPrimaryViewCountuint
public uint GetPrimaryViewCount();Returns the view count for the primary viewport.
uintGetProjectionLayerulong
public ulong GetProjectionLayer();Returns a pointer to the render state's XrCompositionLayerProjection struct.
Note: This method should only be called from the rendering thread.
ulongGetRenderStateZFardouble
public double GetRenderStateZFar();Returns the far boundary value of the camera frustum. Note: This is only accessible in the render thread.
doubleGetRenderStateZNeardouble
public double GetRenderStateZNear();Returns the near boundary value of the camera frustum. Note: This is only accessible in the render thread.
doubleGetSessionulong
public ulong GetSession();Returns the OpenXR session, which is an XrSession(https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrSession.html) cast to an integer.
ulongGetSupportedSwapchainFormatslong[]
public long[] GetSupportedSwapchainFormats();Returns an array of supported swapchain formats.
long[]GetSwapchainFormatNamestring
public string GetSwapchainFormatName(long swapchainFormat);Returns the name of the specified swapchain format.
| Name | Type | Default |
|---|---|---|
swapchainFormat | long | — |
stringGetSystemIdulong
public ulong GetSystemId();Returns the ID of the system, which is an XrSystemId(https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrSystemId.html) cast to an integer.
ulongGetViewConfigurationulong
public ulong GetViewConfiguration();Returns the view configuration type, which is an XrViewConfigurationType(https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrViewConfigurationType.html) cast to an integer.
ulongGetViewCountuint
public uint GetViewCount();Returns the number of views. It is usually two, one for each eye, but may differ with different view configurations.
uintInsertDebugLabelvoid
public void InsertDebugLabel(string labelName);Inserts a debug label, this label is reported in any debug message resulting from the OpenXR calls that follows, until any of OpenXRApiExtension.BeginDebugLabelRegion, OpenXRApiExtension.EndDebugLabelRegion, or OpenXRApiExtension.InsertDebugLabel is called.
| Name | Type | Default |
|---|---|---|
labelName | string | — |
IsEnvironmentBlendModeAlphaSupportedOpenXRApiExtension.OpenXRAlphaBlendModeSupport
public OpenXRApiExtension.OpenXRAlphaBlendModeSupport IsEnvironmentBlendModeAlphaSupported();Returns OpenXRApiExtension.OpenXRAlphaBlendModeSupport denoting if XRInterface.EnvironmentBlendModeEnum.AlphaBlend is really supported, emulated or not supported at all.
OpenXRApiExtension.OpenXRAlphaBlendModeSupportIsInitializedbool
public bool IsInitialized();Returns true if OpenXR is initialized.
boolIsRunningbool
public bool IsRunning();Returns true if OpenXR is running (xrBeginSession was successfully called and the swapchains were created).
boolOpenxrIsEnabledbool
public static bool OpenxrIsEnabled(bool checkRunInEditor);Returns true if OpenXR is enabled.
| Name | Type | Default |
|---|---|---|
checkRunInEditor | bool | — |
boolOpenxrSwapchainAcquirevoid
public void OpenxrSwapchainAcquire(ulong swapchain);Acquires the image of the provided swapchain.
| Name | Type | Default |
|---|---|---|
swapchain | ulong | — |
OpenxrSwapchainCreateulong
public ulong OpenxrSwapchainCreate(ulong createFlags, ulong usageFlags, long swapchainFormat, uint width, uint height, uint sampleCount, uint arraySize);Returns a pointer to a new swapchain created using the provided parameters.
| Name | Type | Default |
|---|---|---|
createFlags | ulong | — |
usageFlags | ulong | — |
swapchainFormat | long | — |
width | uint | — |
height | uint | — |
sampleCount | uint | — |
arraySize | uint | — |
ulongOpenxrSwapchainFreevoid
public void OpenxrSwapchainFree(ulong swapchain);Destroys the provided swapchain and frees it from memory.
| Name | Type | Default |
|---|---|---|
swapchain | ulong | — |
OpenxrSwapchainGetImageRid
public Rid OpenxrSwapchainGetImage(ulong swapchain);Returns the RID of the provided swapchain's image.
| Name | Type | Default |
|---|---|---|
swapchain | ulong | — |
RidOpenxrSwapchainGetSwapchainulong
public ulong OpenxrSwapchainGetSwapchain(ulong swapchain);Returns the XrSwapchain handle of the provided swapchain.
| Name | Type | Default |
|---|---|---|
swapchain | ulong | — |
ulongOpenxrSwapchainReleasevoid
public void OpenxrSwapchainRelease(ulong swapchain);Releases the image of the provided swapchain.
| Name | Type | Default |
|---|---|---|
swapchain | ulong | — |
RegisterCompositionLayerProvider2 overloads · Includes deprecated
public void RegisterCompositionLayerProvider(OpenXRExtensionWrapper extension);Registers the given extension as a composition layer provider.
Note: This cannot be called after the OpenXR session has started. However, it can be called in OpenXRExtensionWrapper._OnSessionCreated.
| Name | Type | Default |
|---|---|---|
extension | OpenXRExtensionWrapper | — |
public void RegisterCompositionLayerProvider(OpenXRExtensionWrapperExtension extension);Registers the given extension as a composition layer provider.
Note: This cannot be called after the OpenXR session has started. However, it can be called in OpenXRExtensionWrapper._OnSessionCreated.
| Name | Type | Default |
|---|---|---|
extension | OpenXRExtensionWrapperExtension | — |
RegisterFrameInfoExtensionvoid
public void RegisterFrameInfoExtension(OpenXRExtensionWrapper extension);Registers the given extension as modifying frame info via the OpenXRExtensionWrapper._set_frame_wait_info_and_get_next_pointer, OpenXRExtensionWrapper._set_view_locate_info_and_get_next_pointer, or OpenXRExtensionWrapper._set_frame_end_info_and_get_next_pointer virtual methods.
Note: This cannot be called after the OpenXR session has started. However, it can be called in OpenXRExtensionWrapper._OnSessionCreated.
| Name | Type | Default |
|---|---|---|
extension | OpenXRExtensionWrapper | — |
RegisterProjectionLayerExtensionvoid
public void RegisterProjectionLayerExtension(OpenXRExtensionWrapper extension);Registers the given extension as modifying XrCompositionLayerProjection via the OpenXRExtensionWrapper._set_projection_layer_and_get_next_pointer virtual method.
Note: This cannot be called after the OpenXR session has started. However, it can be called in OpenXRExtensionWrapper._OnSessionCreated.
| Name | Type | Default |
|---|---|---|
extension | OpenXRExtensionWrapper | — |
RegisterProjectionViewsExtension2 overloads · Includes deprecated
public void RegisterProjectionViewsExtension(OpenXRExtensionWrapper extension);Registers the given extension as a provider of additional data structures to projections views.
Note: This cannot be called after the OpenXR session has started. However, it can be called in OpenXRExtensionWrapper._OnSessionCreated.
| Name | Type | Default |
|---|---|---|
extension | OpenXRExtensionWrapper | — |
public void RegisterProjectionViewsExtension(OpenXRExtensionWrapperExtension extension);Registers the given extension as a provider of additional data structures to projections views.
Note: This cannot be called after the OpenXR session has started. However, it can be called in OpenXRExtensionWrapper._OnSessionCreated.
| Name | Type | Default |
|---|---|---|
extension | OpenXRExtensionWrapperExtension | — |
SetEmulateEnvironmentBlendModeAlphaBlendvoid
public void SetEmulateEnvironmentBlendModeAlphaBlend(bool enabled);If set to true, an OpenXR extension is loaded which is capable of emulating the XRInterface.EnvironmentBlendModeEnum.AlphaBlend blend mode.
| Name | Type | Default |
|---|---|---|
enabled | bool | — |
SetObjectNamevoid
public void SetObjectName(long objectType, ulong objectHandle, string objectName);Set the object name of an OpenXR object, used for debug output. object_type must be a valid OpenXR XrObjectType enum and object_handle must be a valid OpenXR object handle.
| Name | Type | Default |
|---|---|---|
objectType | long | — |
objectHandle | ulong | — |
objectName | string | — |
SetRenderRegionvoid
public void SetRenderRegion(Rect2I renderRegion);Sets the render region to render_region, overriding the normal render target's rect.
| Name | Type | Default |
|---|---|---|
renderRegion | Rect2I | — |
SetVelocityDepthTexturevoid
public void SetVelocityDepthTexture(Rid renderTarget);Sets the render target of the velocity depth texture.
| Name | Type | Default |
|---|---|---|
renderTarget | Rid | — |
SetVelocityTargetSizevoid
public void SetVelocityTargetSize(Vector2I targetSize);Sets the target size of the velocity and velocity depth textures.
| Name | Type | Default |
|---|---|---|
targetSize | Vector2I | — |
SetVelocityTexturevoid
public void SetVelocityTexture(Rid renderTarget);Sets the render target of the velocity texture.
| Name | Type | Default |
|---|---|---|
renderTarget | Rid | — |
UnregisterCompositionLayerProvider2 overloads · Includes deprecated
public void UnregisterCompositionLayerProvider(OpenXRExtensionWrapper extension);Unregisters the given extension as a composition layer provider. Note: This cannot be called while the OpenXR session is still running.
| Name | Type | Default |
|---|---|---|
extension | OpenXRExtensionWrapper | — |
public void UnregisterCompositionLayerProvider(OpenXRExtensionWrapperExtension extension);Unregisters the given extension as a composition layer provider. Note: This cannot be called while the OpenXR session is still running.
| Name | Type | Default |
|---|---|---|
extension | OpenXRExtensionWrapperExtension | — |
UnregisterFrameInfoExtensionvoid
public void UnregisterFrameInfoExtension(OpenXRExtensionWrapper extension);Unregisters the given extension as modifying frame info. Note: This cannot be called while the OpenXR session is still running.
| Name | Type | Default |
|---|---|---|
extension | OpenXRExtensionWrapper | — |
UnregisterProjectionLayerExtensionvoid
public void UnregisterProjectionLayerExtension(OpenXRExtensionWrapper extension);Unregisters the given extension as modifying XrCompositionLayerProjection.
Note: This cannot be called while the OpenXR session is still running.
| Name | Type | Default |
|---|---|---|
extension | OpenXRExtensionWrapper | — |
UnregisterProjectionViewsExtension2 overloads · Includes deprecated
public void UnregisterProjectionViewsExtension(OpenXRExtensionWrapper extension);Unregisters the given extension as a provider of additional data structures to projections views. Note: This cannot be called while the OpenXR session is still running.
| Name | Type | Default |
|---|---|---|
extension | OpenXRExtensionWrapper | — |
public void UnregisterProjectionViewsExtension(OpenXRExtensionWrapperExtension extension);Unregisters the given extension as a provider of additional data structures to projections views. Note: This cannot be called while the OpenXR session is still running.
| Name | Type | Default |
|---|---|---|
extension | OpenXRExtensionWrapperExtension | — |
UpdateMainSwapchainSizevoid
public void UpdateMainSwapchainSize();Request the recommended resolution from the OpenXR runtime and update the main swapchain size if it has changed.
XRResultbool
public bool XRResult(ulong result, string format, Reckfell.Collections.Array args);Returns true if the provided XrResult(https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrResult.html) (cast to an integer) is successful. Otherwise returns false and prints the XrResult(https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrResult.html) converted to a string, with the specified additional information.
| Name | Type | Default |
|---|---|---|
result | ulong | — |
format | string | — |
args | Reckfell.Collections.Array | — |
boolOpenXRApiExtension.OpenXRAlphaBlendModeSupport
| Value | Description |
|---|---|
Emulating = 2 | Means that |
None = 0 | Means that |
Real = 1 | Means that |