OpenXRAPIExtension
Makes the OpenXR API available for GDExtension.
OpenXRAPIExtension.swift:20class OpenXRAPIExtension
OpenXRAPIExtension
makes OpenXR available for GDExtension. It provides the OpenXR API to GDExtension through the getInstanceProcAddr(name:)
method, and the OpenXR instance through getInstance
.
It also provides methods for querying the status of OpenXR initialization, and helper methods for ease of use of the API with GDExtension.
Superclasses
class RefCounted
Base class for reference-counted objects.
Citizens in SwiftGodot
Conformances
protocol CustomStringConvertible
A type with a customized textual representation.
protocol Equatable
A type that can be compared for value equality.
protocol Hashable
A type that can be hashed into a
Hasher
to produce an integer hash value.protocol Identifiable<ID>
A class of types whose instances hold the value of an entity with stable identity.
protocol VariantRepresentable
Types that conform to VariantRepresentable can be stored directly in
Variant
with no conversion. These include all of the Variant types from Godot (for exampleGString
,Rect
,Plane
), Godot objects (those that subclass SwiftGodot.Object) as well as the built-in Swift types UInt8, Int64 and Double.protocol VariantStorable
Types that conform to VariantStorable can be stored in a Variant and can be extracted back out of a Variant.
Types
Type members
static func openxrIsEnabled(checkRunInEditor: Bool
) -> Bool Returns
true
if OpenXR is enabled.class var godotClassName: StringName
Instance members
func canRender(
) -> Bool Returns
true
if OpenXR is initialized for rendering with an XR viewport.func getErrorString(result: UInt
) -> String Returns an error string for the given XrResult.
func getHandTracker(handIndex: Int32
) -> UInt Returns the corresponding
XRHandTrackerEXT
handle for the given hand index value.func getInstance(
) -> UInt Returns the XrInstance created during the initialization of the OpenXR API.
func getInstanceProcAddr(name: String
) -> UInt 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
.func getNextFrameTime(
) -> Int Returns the predicted display timing for the next frame.
func getPlaySpace(
) -> UInt Returns the play space, which is an XrSpace cast to an integer.
func getPredictedDisplayTime(
) -> Int Returns the predicted display timing for the current frame.
func getSession(
) -> UInt Returns the OpenXR session, which is an XrSession cast to an integer.
func getSwapchainFormatName(swapchainFormat: Int
) -> String Returns the name of the specified swapchain format.
func getSystemId(
) -> UInt Returns the id of the system, which is a XrSystemId cast to an integer.
func isEnvironmentBlendModeAlphaSupported(
) -> OpenXRAPIExtension.OpenXRAlphaBlendModeSupport Returns
OpenXRAPIExtension.OpenXRAlphaBlendModeSupport
denoting ifXRInterface/EnvironmentBlendMode/xrEnvBlendModeAlphaBlend
is really supported, emulated or not supported at all.func isInitialized(
) -> Bool Returns
true
if OpenXR is initialized.func isRunning(
) -> Bool Returns
true
if OpenXR is running (xrBeginSession was successfully called and the swapchains were created).func registerCompositionLayerProvider(extension: OpenXRExtensionWrapperExtension?
) Registers the given extension as a composition layer provider.
func setEmulateEnvironmentBlendModeAlphaBlend(enabled: Bool
) If set to
true
, an OpenXR extension is loaded which is capable of emulating theXRInterface/EnvironmentBlendMode/xrEnvBlendModeAlphaBlend
blend mode.func transformFromPose(OpaquePointer?
) -> Transform3D Creates a
Transform3D
from an XrPosef.func unregisterCompositionLayerProvider(extension: OpenXRExtensionWrapperExtension?
) Unregisters the given extension as a composition layer provider.
func xrResult(UInt, format: String, args: GArray
) -> Bool Returns
true
if the provided XrResult (cast to an integer) is successful. Otherwise returnsfalse
and prints the XrResult converted to a string, with the specified additional information.