reckfellENGINE

OpenXRApiExtension

Makes the OpenXR API available for ReckfellExtension.

On this page
class OpenXRApiExtensionReckfellSharpInherits RefCounted

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
# OpenXRApiExtension
C#
public OpenXRApiExtension();

Methods54

ActionGetHandleulong
# ActionGetHandle
C#
public ulong ActionGetHandle(Rid action);

Returns the corresponding XrAction OpenXR handle for the given action RID.

Parameters
NameTypeDefault
actionRid—
Returns ulong
BeginDebugLabelRegionvoid
# BeginDebugLabelRegion
C#
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.

Parameters
NameTypeDefault
labelNamestring—
CanRenderbool
# CanRender
C#
public bool CanRender();

Returns true if OpenXR is initialized for rendering with an XR viewport.

Returns bool
EndDebugLabelRegionvoid
# EndDebugLabelRegion
C#
public void EndDebugLabelRegion();

Marks the end of a debug label region. Removes the latest debug label region added by calling OpenXRApiExtension.BeginDebugLabelRegion.

FindActionRid
# FindAction
C#
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.

Parameters
NameTypeDefault
namestring—
actionSetRid—
Returns Rid
GetErrorStringstring
# GetErrorString
C#
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).

Parameters
NameTypeDefault
resultulong—
Returns string
GetHandTrackerulong
# GetHandTracker
C#
public ulong GetHandTracker(int handIndex);

Returns the corresponding XRHandTrackerEXT handle for the given hand index value.

Parameters
NameTypeDefault
handIndexint—
Returns ulong
GetInstanceulong
# GetInstance
C#
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.

Returns ulong
GetInstanceProcAddrulong
# GetInstanceProcAddr
C#
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).

Parameters
NameTypeDefault
namestring—
Returns ulong
GetNextFrameTimelong
# GetNextFrameTime
C#
public long GetNextFrameTime();

Returns the predicted display timing for the next frame.

Returns long
GetOpenxrVersionulong
# GetOpenxrVersion
C#
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.

Returns ulong
GetPlaySpaceulong
# GetPlaySpace
C#
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.

Returns ulong
GetPredictedDisplayTimelong
# GetPredictedDisplayTime
C#
public long GetPredictedDisplayTime();

Returns the predicted display timing for the current frame.

Returns long
GetPrimaryViewCountuint
# GetPrimaryViewCount
C#
public uint GetPrimaryViewCount();

Returns the view count for the primary viewport.

Returns uint
GetProjectionLayerulong
# GetProjectionLayer
C#
public ulong GetProjectionLayer();

Returns a pointer to the render state's XrCompositionLayerProjection struct. Note: This method should only be called from the rendering thread.

Returns ulong
GetRenderStateZFardouble
# GetRenderStateZFar
C#
public double GetRenderStateZFar();

Returns the far boundary value of the camera frustum. Note: This is only accessible in the render thread.

Returns double
GetRenderStateZNeardouble
# GetRenderStateZNear
C#
public double GetRenderStateZNear();

Returns the near boundary value of the camera frustum. Note: This is only accessible in the render thread.

Returns double
GetSessionulong
# GetSession
C#
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.

Returns ulong
GetSupportedSwapchainFormatslong[]
# GetSupportedSwapchainFormats
C#
public long[] GetSupportedSwapchainFormats();

Returns an array of supported swapchain formats.

Returns long[]
GetSwapchainFormatNamestring
# GetSwapchainFormatName
C#
public string GetSwapchainFormatName(long swapchainFormat);

Returns the name of the specified swapchain format.

Parameters
NameTypeDefault
swapchainFormatlong—
Returns string
GetSystemIdulong
# GetSystemId
C#
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.

Returns ulong
GetViewConfigurationulong
# GetViewConfiguration
C#
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.

Returns ulong
GetViewCountuint
# GetViewCount
C#
public uint GetViewCount();

Returns the number of views. It is usually two, one for each eye, but may differ with different view configurations.

Returns uint
InsertDebugLabelvoid
# InsertDebugLabel
C#
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.

Parameters
NameTypeDefault
labelNamestring—
IsEnvironmentBlendModeAlphaSupportedOpenXRApiExtension.OpenXRAlphaBlendModeSupport
# IsEnvironmentBlendModeAlphaSupported
C#
public OpenXRApiExtension.OpenXRAlphaBlendModeSupport IsEnvironmentBlendModeAlphaSupported();

Returns OpenXRApiExtension.OpenXRAlphaBlendModeSupport denoting if XRInterface.EnvironmentBlendModeEnum.AlphaBlend is really supported, emulated or not supported at all.

Returns OpenXRApiExtension.OpenXRAlphaBlendModeSupport
IsInitializedbool
# IsInitialized
C#
public bool IsInitialized();

Returns true if OpenXR is initialized.

Returns bool
IsRunningbool
# IsRunning
C#
public bool IsRunning();

Returns true if OpenXR is running (xrBeginSession was successfully called and the swapchains were created).

Returns bool
OpenxrIsEnabledbool
# OpenxrIsEnabled
C#
public static bool OpenxrIsEnabled(bool checkRunInEditor);

Returns true if OpenXR is enabled.

Parameters
NameTypeDefault
checkRunInEditorbool—
Returns bool
OpenxrSwapchainAcquirevoid
# OpenxrSwapchainAcquire
C#
public void OpenxrSwapchainAcquire(ulong swapchain);

Acquires the image of the provided swapchain.

Parameters
NameTypeDefault
swapchainulong—
OpenxrSwapchainCreateulong
# OpenxrSwapchainCreate
C#
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.

Parameters
NameTypeDefault
createFlagsulong—
usageFlagsulong—
swapchainFormatlong—
widthuint—
heightuint—
sampleCountuint—
arraySizeuint—
Returns ulong
OpenxrSwapchainFreevoid
# OpenxrSwapchainFree
C#
public void OpenxrSwapchainFree(ulong swapchain);

Destroys the provided swapchain and frees it from memory.

Parameters
NameTypeDefault
swapchainulong—
OpenxrSwapchainGetImageRid
# OpenxrSwapchainGetImage
C#
public Rid OpenxrSwapchainGetImage(ulong swapchain);

Returns the RID of the provided swapchain's image.

Parameters
NameTypeDefault
swapchainulong—
Returns Rid
OpenxrSwapchainGetSwapchainulong
# OpenxrSwapchainGetSwapchain
C#
public ulong OpenxrSwapchainGetSwapchain(ulong swapchain);

Returns the XrSwapchain handle of the provided swapchain.

Parameters
NameTypeDefault
swapchainulong—
Returns ulong
OpenxrSwapchainReleasevoid
# OpenxrSwapchainRelease
C#
public void OpenxrSwapchainRelease(ulong swapchain);

Releases the image of the provided swapchain.

Parameters
NameTypeDefault
swapchainulong—
RegisterCompositionLayerProvider2 overloads · Includes deprecated
# RegisterCompositionLayerProvider · 1/2
C#
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.

Parameters
NameTypeDefault
extensionOpenXRExtensionWrapper—
# RegisterCompositionLayerProvider · 2/2
C#
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.

Parameters
NameTypeDefault
extensionOpenXRExtensionWrapperExtension—
RegisterFrameInfoExtensionvoid
# RegisterFrameInfoExtension
C#
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.

Parameters
NameTypeDefault
extensionOpenXRExtensionWrapper—
RegisterProjectionLayerExtensionvoid
# RegisterProjectionLayerExtension
C#
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.

Parameters
NameTypeDefault
extensionOpenXRExtensionWrapper—
RegisterProjectionViewsExtension2 overloads · Includes deprecated
# RegisterProjectionViewsExtension · 1/2
C#
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.

Parameters
NameTypeDefault
extensionOpenXRExtensionWrapper—
# RegisterProjectionViewsExtension · 2/2
C#
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.

Parameters
NameTypeDefault
extensionOpenXRExtensionWrapperExtension—
SetEmulateEnvironmentBlendModeAlphaBlendvoid
# SetEmulateEnvironmentBlendModeAlphaBlend
C#
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.

Parameters
NameTypeDefault
enabledbool—
SetObjectNamevoid
# SetObjectName
C#
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.

Parameters
NameTypeDefault
objectTypelong—
objectHandleulong—
objectNamestring—
SetRenderRegionvoid
# SetRenderRegion
C#
public void SetRenderRegion(Rect2I renderRegion);

Sets the render region to render_region, overriding the normal render target's rect.

Parameters
NameTypeDefault
renderRegionRect2I—
SetVelocityDepthTexturevoid
# SetVelocityDepthTexture
C#
public void SetVelocityDepthTexture(Rid renderTarget);

Sets the render target of the velocity depth texture.

Parameters
NameTypeDefault
renderTargetRid—
SetVelocityTargetSizevoid
# SetVelocityTargetSize
C#
public void SetVelocityTargetSize(Vector2I targetSize);

Sets the target size of the velocity and velocity depth textures.

Parameters
NameTypeDefault
targetSizeVector2I—
SetVelocityTexturevoid
# SetVelocityTexture
C#
public void SetVelocityTexture(Rid renderTarget);

Sets the render target of the velocity texture.

Parameters
NameTypeDefault
renderTargetRid—
UnregisterCompositionLayerProvider2 overloads · Includes deprecated
# UnregisterCompositionLayerProvider · 1/2
C#
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.

Parameters
NameTypeDefault
extensionOpenXRExtensionWrapper—
# UnregisterCompositionLayerProvider · 2/2
C#
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.

Parameters
NameTypeDefault
extensionOpenXRExtensionWrapperExtension—
UnregisterFrameInfoExtensionvoid
# UnregisterFrameInfoExtension
C#
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.

Parameters
NameTypeDefault
extensionOpenXRExtensionWrapper—
UnregisterProjectionLayerExtensionvoid
# UnregisterProjectionLayerExtension
C#
public void UnregisterProjectionLayerExtension(OpenXRExtensionWrapper extension);

Unregisters the given extension as modifying XrCompositionLayerProjection. Note: This cannot be called while the OpenXR session is still running.

Parameters
NameTypeDefault
extensionOpenXRExtensionWrapper—
UnregisterProjectionViewsExtension2 overloads · Includes deprecated
# UnregisterProjectionViewsExtension · 1/2
C#
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.

Parameters
NameTypeDefault
extensionOpenXRExtensionWrapper—
# UnregisterProjectionViewsExtension · 2/2
C#
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.

Parameters
NameTypeDefault
extensionOpenXRExtensionWrapperExtension—
UpdateMainSwapchainSizevoid
# UpdateMainSwapchainSize
C#
public void UpdateMainSwapchainSize();

Request the recommended resolution from the OpenXR runtime and update the main swapchain size if it has changed.

XRResultbool
# XRResult
C#
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.

Parameters
NameTypeDefault
resultulong—
formatstring—
argsReckfell.Collections.Array—
Returns bool

OpenXRApiExtension.OpenXRAlphaBlendModeSupport

Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.