OpenXRAPIExtension

package
v0.0.0-...-a66c66c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 12, 2025 License: MIT Imports: 26 Imported by: 0

Documentation

Overview

Package OpenXRAPIExtension provides methods for working with OpenXRAPIExtension object instances.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OpenxrIsEnabled

func OpenxrIsEnabled(check_run_in_editor bool) bool

Returns [code]true[/code] if OpenXR is enabled.

Types

type Advanced

type Advanced = class

Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.

type Any

type Any interface {
	gd.IsClass
	AsOpenXRAPIExtension() Instance
}

type Extension

type Extension[T gdclass.Interface] struct{ gdclass.Extension[T, Instance] }

Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this Extension

func (*Extension[T]) AsObject

func (self *Extension[T]) AsObject() [1]gd.Object

func (*Extension[T]) AsOpenXRAPIExtension

func (self *Extension[T]) AsOpenXRAPIExtension() Instance

func (*Extension[T]) AsRefCounted

func (self *Extension[T]) AsRefCounted() [1]gd.RefCounted

type ID

type ID Object.ID

ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.

func (ID) Instance

func (id ID) Instance() (Instance, bool)

type Instance

type Instance [1]gdclass.OpenXRAPIExtension

[OpenXRAPIExtension] makes OpenXR available for GDExtension. It provides the OpenXR API to GDExtension through the [method get_instance_proc_addr] method, and the OpenXR instance through [method get_instance]. It also provides methods for querying the status of OpenXR initialization, and helper methods for ease of use of the API with GDExtension.

var Nil Instance

Nil is a nil/null instance of the class. Equivalent to the zero value.

func GetFromWrapperExtension

func GetFromWrapperExtension(peer OpenXRExtensionWrapperExtension.Instance) Instance

Returns the created [OpenXRAPIExtension], which can be used to access the OpenXR API.

func New

func New() Instance

func (Instance) ActionGetHandle

func (self Instance) ActionGetHandle(action RID.Action) int

Returns the corresponding [code]XrAction[/code] OpenXR handle for the given action RID.

func (Instance) AsObject

func (self Instance) AsObject() [1]gd.Object

func (Instance) AsOpenXRAPIExtension

func (self Instance) AsOpenXRAPIExtension() Instance

func (Instance) AsRefCounted

func (self Instance) AsRefCounted() [1]gd.RefCounted

func (Instance) BeginDebugLabelRegion

func (self Instance) BeginDebugLabelRegion(label_name string)

Begins a new debug label region, this label will be reported in debug messages for any calls following this until [method end_debug_label_region] is called. Debug labels can be stacked.

func (Instance) CanRender

func (self Instance) CanRender() bool

Returns [code]true[/code] if OpenXR is initialized for rendering with an XR viewport.

func (Instance) EndDebugLabelRegion

func (self Instance) EndDebugLabelRegion()

Marks the end of a debug label region. Removes the latest debug label region added by calling [method begin_debug_label_region].

func (Instance) FindAction

func (self Instance) FindAction(name string, action_set RID.ActionSet) RID.Action

Returns the [RID] corresponding to an [code]Action[/code] of a matching name, optionally limited to a specified action set.

func (Instance) GetErrorString

func (self Instance) GetErrorString(result int) string

Returns an error string for the given [url=https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrResult.html]XrResult[/url].

func (Instance) GetHandTracker

func (self Instance) GetHandTracker(hand_index int) int

Returns the corresponding [code]XRHandTrackerEXT[/code] handle for the given hand index value.

func (Instance) GetInstance

func (self Instance) GetInstance() int

Returns the [url=https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrInstance.html]XrInstance[/url] created during the initialization of the OpenXR API.

func (Instance) GetInstanceProcAddr

func (self Instance) GetInstanceProcAddr(name string) int

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 [code]0[/code]. [b]Note:[/b] [code]openxr/util.h[/code] contains utility macros for acquiring OpenXR functions, e.g. [code]GDEXTENSION_INIT_XR_FUNC_V(xrCreateAction)[/code].

func (Instance) GetNextFrameTime

func (self Instance) GetNextFrameTime() int

Returns the predicted display timing for the next frame.

func (Instance) GetPlaySpace

func (self Instance) GetPlaySpace() int

Returns the play space, which is an [url=https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrSpace.html]XrSpace[/url] cast to an integer.

func (Instance) GetPredictedDisplayTime

func (self Instance) GetPredictedDisplayTime() int

Returns the predicted display timing for the current frame.

func (Instance) GetProjectionLayer

func (self Instance) GetProjectionLayer() int

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

func (Instance) GetRenderStateZFar

func (self Instance) GetRenderStateZFar() Float.X

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

func (Instance) GetRenderStateZNear

func (self Instance) GetRenderStateZNear() Float.X

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

func (Instance) GetSession

func (self Instance) GetSession() int

Returns the OpenXR session, which is an [url=https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrSession.html]XrSession[/url] cast to an integer.

func (Instance) GetSupportedSwapchainFormats

func (self Instance) GetSupportedSwapchainFormats() []int64

Returns an array of supported swapchain formats.

func (Instance) GetSwapchainFormatName

func (self Instance) GetSwapchainFormatName(swapchain_format int) string

Returns the name of the specified swapchain format.

func (Instance) GetSystemId

func (self Instance) GetSystemId() int

Returns the id of the system, which is a [url=https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrSystemId.html]XrSystemId[/url] cast to an integer.

func (Instance) ID

func (self Instance) ID() ID

func (Instance) InsertDebugLabel

func (self Instance) InsertDebugLabel(label_name string)

Inserts a debug label, this label is reported in any debug message resulting from the OpenXR calls that follows, until any of [method begin_debug_label_region], [method end_debug_label_region], or [method insert_debug_label] is called.

func (Instance) IsEnvironmentBlendModeAlphaSupported

func (self Instance) IsEnvironmentBlendModeAlphaSupported() OpenXRAlphaBlendModeSupport

Returns [enum OpenXRAPIExtension.OpenXRAlphaBlendModeSupport] denoting if [constant XRInterface.XR_ENV_BLEND_MODE_ALPHA_BLEND] is really supported, emulated or not supported at all.

func (Instance) IsInitialized

func (self Instance) IsInitialized() bool

Returns [code]true[/code] if OpenXR is initialized.

func (Instance) IsRunning

func (self Instance) IsRunning() bool

Returns [code]true[/code] if OpenXR is running ([url=https://registry.khronos.org/OpenXR/specs/1.0/man/html/xrBeginSession.html]xrBeginSession[/url] was successfully called and the swapchains were created).

func (Instance) OpenxrSwapchainAcquire

func (self Instance) OpenxrSwapchainAcquire(swapchain int)

Acquires the image of the provided swapchain.

func (Instance) OpenxrSwapchainCreate

func (self Instance) OpenxrSwapchainCreate(create_flags int, usage_flags int, swapchain_format int, width int, height int, sample_count int, array_size int) int

Returns a pointer to a new swapchain created using the provided parameters.

func (Instance) OpenxrSwapchainFree

func (self Instance) OpenxrSwapchainFree(swapchain int)

Destroys the provided swapchain and frees it from memory.

func (Instance) OpenxrSwapchainGetImage

func (self Instance) OpenxrSwapchainGetImage(swapchain int) RID.Texture

Returns the RID of the provided swapchain's image.

func (Instance) OpenxrSwapchainGetSwapchain

func (self Instance) OpenxrSwapchainGetSwapchain(swapchain int) int

Returns the [code]XrSwapchain[/code] handle of the provided swapchain.

func (Instance) OpenxrSwapchainRelease

func (self Instance) OpenxrSwapchainRelease(swapchain int)

Releases the image of the provided swapchain.

func (Instance) RegisterCompositionLayerProvider

func (self Instance) RegisterCompositionLayerProvider(extension OpenXRExtensionWrapperExtension.Instance)

Registers the given extension as a composition layer provider.

func (Instance) RegisterProjectionViewsExtension

func (self Instance) RegisterProjectionViewsExtension(extension OpenXRExtensionWrapperExtension.Instance)

Registers the given extension as a provider of additional data structures to projections views.

func (Instance) SetEmulateEnvironmentBlendModeAlphaBlend

func (self Instance) SetEmulateEnvironmentBlendModeAlphaBlend(enabled bool)

If set to [code]true[/code], an OpenXR extension is loaded which is capable of emulating the [constant XRInterface.XR_ENV_BLEND_MODE_ALPHA_BLEND] blend mode.

func (*Instance) SetObject

func (self *Instance) SetObject(obj [1]gd.Object) bool

func (Instance) SetObjectName

func (self Instance) SetObjectName(object_type int, object_handle int, object_name string)

Set the object name of an OpenXR object, used for debug output. [param object_type] must be a valid OpenXR [code]XrObjectType[/code] enum and [param object_handle] must be a valid OpenXR object handle.

func (Instance) SetRenderRegion

func (self Instance) SetRenderRegion(render_region Rect2i.PositionSize)

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

func (Instance) SetVelocityDepthTexture

func (self Instance) SetVelocityDepthTexture(render_target RID.Framebuffer)

Sets the render target of the velocity depth texture.

func (Instance) SetVelocityTargetSize

func (self Instance) SetVelocityTargetSize(target_size Vector2i.XY)

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

func (Instance) SetVelocityTexture

func (self Instance) SetVelocityTexture(render_target RID.Framebuffer)

Sets the render target of the velocity texture.

func (Instance) TransformFromPose

func (self Instance) TransformFromPose(pose gdextension.Pointer) Transform3D.BasisOrigin

Creates a [Transform3D] from an [url=https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrPosef.html]XrPosef[/url].

func (Instance) UnregisterCompositionLayerProvider

func (self Instance) UnregisterCompositionLayerProvider(extension OpenXRExtensionWrapperExtension.Instance)

Unregisters the given extension as a composition layer provider.

func (Instance) UnregisterProjectionViewsExtension

func (self Instance) UnregisterProjectionViewsExtension(extension OpenXRExtensionWrapperExtension.Instance)

Unregisters the given extension as a provider of additional data structures to projections views.

func (Instance) Virtual

func (self Instance) Virtual(name string) reflect.Value

func (Instance) XrResult

func (self Instance) XrResult(result int, format string, args []any) bool

Returns [code]true[/code] if the provided [url=https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrResult.html]XrResult[/url] (cast to an integer) is successful. Otherwise returns [code]false[/code] and prints the [url=https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrResult.html]XrResult[/url] converted to a string, with the specified additional information.

type OpenXRAlphaBlendModeSupport

type OpenXRAlphaBlendModeSupport int //gd:OpenXRAPIExtension.OpenXRAlphaBlendModeSupport
const (
	/*Means that [constant XRInterface.XR_ENV_BLEND_MODE_ALPHA_BLEND] isn't supported at all.*/
	OpenxrAlphaBlendModeSupportNone OpenXRAlphaBlendModeSupport = 0
	/*Means that [constant XRInterface.XR_ENV_BLEND_MODE_ALPHA_BLEND] is really supported.*/
	OpenxrAlphaBlendModeSupportReal OpenXRAlphaBlendModeSupport = 1
	/*Means that [constant XRInterface.XR_ENV_BLEND_MODE_ALPHA_BLEND] is emulated.*/
	OpenxrAlphaBlendModeSupportEmulating OpenXRAlphaBlendModeSupport = 2
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL