summaryrefslogtreecommitdiffstats
path: root/modules/openxr/register_types.cpp
diff options
context:
space:
mode:
authorGabor Koncz <gabor.koncz@migeran.com>2022-12-29 16:34:25 +1100
committerGabor Koncz <gabor.koncz@migeran.com>2023-07-26 10:27:14 +0200
commitd600e6eb1bc0aad51b61a42ac18861696e63732a (patch)
tree3203ff22ca16c92fc7bd7726402cc5b49adf78d2 /modules/openxr/register_types.cpp
parentc3b0a92c3cd9a219c1b1776b48c147f1d0602f07 (diff)
downloadredot-engine-d600e6eb1bc0aad51b61a42ac18861696e63732a.tar.gz
Add GDExtension support for OpenXR extension wrappers
This commit adds the classes OpenXRExtensionWrapperExtension and OpenXRAPIExtension that can be used in GDExtensions to define OpenXR extension wrappers. It modifies extension wrapper registration so that they can be registered before OpenXRAPI instantiation (e.g. in core level initialization of GDExtensions). Developed by Migeran (https://migeran.com)
Diffstat (limited to 'modules/openxr/register_types.cpp')
-rw-r--r--modules/openxr/register_types.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/modules/openxr/register_types.cpp b/modules/openxr/register_types.cpp
index 27b179a788..5d636c2b70 100644
--- a/modules/openxr/register_types.cpp
+++ b/modules/openxr/register_types.cpp
@@ -36,6 +36,9 @@
#include "action_map/openxr_interaction_profile.h"
#include "action_map/openxr_interaction_profile_meta_data.h"
#include "openxr_interface.h"
+
+#include "extensions/openxr_extension_wrapper_extension.h"
+
#include "scene/openxr_hand.h"
#include "extensions/openxr_composition_layer_depth_extension.h"
@@ -87,6 +90,11 @@ static void _editor_init() {
#endif
void initialize_openxr_module(ModuleInitializationLevel p_level) {
+ if (p_level == MODULE_INITIALIZATION_LEVEL_CORE) {
+ GDREGISTER_CLASS(OpenXRExtensionWrapperExtension);
+ GDREGISTER_CLASS(OpenXRAPIExtension);
+ }
+
if (p_level == MODULE_INITIALIZATION_LEVEL_SERVERS) {
if (OpenXRAPI::openxr_is_enabled(false)) {
// Always register our extension wrappers even if we don't initialize OpenXR.