Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

OpenXRExtensionWrapperExtension

Inherits: Object

Allows clients to implement OpenXR extensions with GDExtension.

描述

OpenXRExtensionWrapperExtension allows clients to implement OpenXR extensions with GDExtension. The extension should be registered with register_extension_wrapper.

Methods

Dictionary

_get_requested_extensions ( ) virtual

void

_on_before_instance_created ( ) virtual

bool

_on_event_polled ( const void* event ) virtual

void

_on_instance_created ( int instance ) virtual

void

_on_instance_destroyed ( ) virtual

void

_on_pre_render ( ) virtual

void

_on_process ( ) virtual

void

_on_register_metadata ( ) virtual

void

_on_session_created ( int session ) virtual

void

_on_session_destroyed ( ) virtual

void

_on_state_exiting ( ) virtual

void

_on_state_focused ( ) virtual

void

_on_state_idle ( ) virtual

void

_on_state_loss_pending ( ) virtual

void

_on_state_ready ( ) virtual

void

_on_state_stopping ( ) virtual

void

_on_state_synchronized ( ) virtual

void

_on_state_visible ( ) virtual

int

_set_instance_create_info_and_get_next_pointer ( void* next_pointer ) virtual

int

_set_session_create_and_get_next_pointer ( void* next_pointer ) virtual

int

_set_swapchain_create_info_and_get_next_pointer ( void* next_pointer ) virtual

int

_set_system_properties_and_get_next_pointer ( void* next_pointer ) virtual

OpenXRAPIExtension

get_openxr_api ( )

void

register_extension_wrapper ( )


Method Descriptions

Dictionary _get_requested_extensions ( ) virtual

Returns a Dictionary of OpenXR extensions related to this extension. The Dictionary should contain the name of the extension, mapped to a bool * cast to an integer:

  • If the bool * is a nullptr this extension is mandatory.

  • If the bool * points to a boolean, the boolean will be updated to true if the extension is enabled.


void _on_before_instance_created ( ) virtual

Called before the OpenXR instance is created.


bool _on_event_polled ( const void* event ) virtual

Called when there is an OpenXR event to process. When implementing, return true if the event was handled, return false otherwise.


void _on_instance_created ( int instance ) virtual

Called right after the OpenXR instance is created.


void _on_instance_destroyed ( ) virtual

Called right before the OpenXR instance is destroyed.


void _on_pre_render ( ) virtual

Called right before the XR viewports begin their rendering step.


void _on_process ( ) virtual

Called as part of the OpenXR process handling. This happens right before general and physics processing steps of the main loop. During this step controller data is queried and made available to game logic.


void _on_register_metadata ( ) virtual

Allows extensions to register additional controller metadata. This function is called even when the OpenXR API is not constructed as the metadata needs to be available to the editor.

Extensions should also provide metadata regardless of whether they are supported on the host system. The controller data is used to setup action maps for users who may have access to the relevant hardware.


void _on_session_created ( int session ) virtual

Called right after the OpenXR session is created.


void _on_session_destroyed ( ) virtual

Called right before the OpenXR session is destroyed.


void _on_state_exiting ( ) virtual

Called when the OpenXR session state is changed to exiting.


void _on_state_focused ( ) virtual

Called when the OpenXR session state is changed to focused. This state is the active state when the game runs.


void _on_state_idle ( ) virtual

Called when the OpenXR session state is changed to idle.


void _on_state_loss_pending ( ) virtual

Called when the OpenXR session state is changed to loss pending.


void _on_state_ready ( ) virtual

Called when the OpenXR session state is changed to ready. This means OpenXR is ready to set up the session.


void _on_state_stopping ( ) virtual

Called when the OpenXR session state is changed to stopping.


void _on_state_synchronized ( ) virtual

Called when the OpenXR session state is changed to synchronized. OpenXR also returns to this state when the application loses focus.


void _on_state_visible ( ) virtual

Called when the OpenXR session state is changed to visible. This means OpenXR is now ready to receive frames.


int _set_instance_create_info_and_get_next_pointer ( void* next_pointer ) virtual

Adds additional data structures when the OpenXR instance is created.


int _set_session_create_and_get_next_pointer ( void* next_pointer ) virtual

Adds additional data structures when the OpenXR session is created.


int _set_swapchain_create_info_and_get_next_pointer ( void* next_pointer ) virtual

Adds additional data structures when creating OpenXR swapchains.


int _set_system_properties_and_get_next_pointer ( void* next_pointer ) virtual

Adds additional data structures when interogating OpenXR system abilities.


OpenXRAPIExtension get_openxr_api ( )

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


void register_extension_wrapper ( )

Registers the extension. This should happen at core module initialization level.