diff options
Diffstat (limited to 'modules/openxr')
-rw-r--r-- | modules/openxr/editor/openxr_action_editor.cpp | 3 | ||||
-rw-r--r-- | modules/openxr/editor/openxr_action_editor.h | 2 | ||||
-rw-r--r-- | modules/openxr/editor/openxr_action_map_editor.cpp | 2 | ||||
-rw-r--r-- | modules/openxr/editor/openxr_action_map_editor.h | 2 | ||||
-rw-r--r-- | modules/openxr/editor/openxr_action_set_editor.cpp | 3 | ||||
-rw-r--r-- | modules/openxr/editor/openxr_action_set_editor.h | 2 | ||||
-rw-r--r-- | modules/openxr/editor/openxr_interaction_profile_editor.cpp | 3 | ||||
-rw-r--r-- | modules/openxr/editor/openxr_interaction_profile_editor.h | 2 | ||||
-rw-r--r-- | modules/openxr/openxr_api.cpp | 10 | ||||
-rw-r--r-- | modules/openxr/openxr_api.h | 1 | ||||
-rw-r--r-- | modules/openxr/register_types.cpp | 4 |
11 files changed, 23 insertions, 11 deletions
diff --git a/modules/openxr/editor/openxr_action_editor.cpp b/modules/openxr/editor/openxr_action_editor.cpp index e3fe06c6f7..586b0b0697 100644 --- a/modules/openxr/editor/openxr_action_editor.cpp +++ b/modules/openxr/editor/openxr_action_editor.cpp @@ -29,7 +29,6 @@ /**************************************************************************/ #include "openxr_action_editor.h" -#include "editor/editor_node.h" void OpenXRActionEditor::_bind_methods() { ClassDB::bind_method(D_METHOD("_do_set_name", "name"), &OpenXRActionEditor::_do_set_name); @@ -125,7 +124,7 @@ void OpenXRActionEditor::_on_remove_action() { } OpenXRActionEditor::OpenXRActionEditor(Ref<OpenXRAction> p_action) { - undo_redo = EditorNode::get_undo_redo(); + undo_redo = EditorUndoRedoManager::get_singleton(); action = p_action; set_h_size_flags(Control::SIZE_EXPAND_FILL); diff --git a/modules/openxr/editor/openxr_action_editor.h b/modules/openxr/editor/openxr_action_editor.h index 8af5448aed..765b3ef378 100644 --- a/modules/openxr/editor/openxr_action_editor.h +++ b/modules/openxr/editor/openxr_action_editor.h @@ -43,7 +43,7 @@ class OpenXRActionEditor : public HBoxContainer { GDCLASS(OpenXRActionEditor, HBoxContainer); private: - Ref<EditorUndoRedoManager> undo_redo; + EditorUndoRedoManager *undo_redo; Ref<OpenXRAction> action; LineEdit *action_name = nullptr; diff --git a/modules/openxr/editor/openxr_action_map_editor.cpp b/modules/openxr/editor/openxr_action_map_editor.cpp index 12c95f8978..ad5a515a01 100644 --- a/modules/openxr/editor/openxr_action_map_editor.cpp +++ b/modules/openxr/editor/openxr_action_map_editor.cpp @@ -387,7 +387,7 @@ void OpenXRActionMapEditor::_clear_action_map() { } OpenXRActionMapEditor::OpenXRActionMapEditor() { - undo_redo = EditorNode::get_undo_redo(); + undo_redo = EditorUndoRedoManager::get_singleton(); set_custom_minimum_size(Size2(0.0, 300.0)); top_hb = memnew(HBoxContainer); diff --git a/modules/openxr/editor/openxr_action_map_editor.h b/modules/openxr/editor/openxr_action_map_editor.h index 47bfda3425..a04bae4a6e 100644 --- a/modules/openxr/editor/openxr_action_map_editor.h +++ b/modules/openxr/editor/openxr_action_map_editor.h @@ -48,7 +48,7 @@ class OpenXRActionMapEditor : public VBoxContainer { GDCLASS(OpenXRActionMapEditor, VBoxContainer); private: - Ref<EditorUndoRedoManager> undo_redo; + EditorUndoRedoManager *undo_redo; String edited_path; Ref<OpenXRActionMap> action_map; diff --git a/modules/openxr/editor/openxr_action_set_editor.cpp b/modules/openxr/editor/openxr_action_set_editor.cpp index 078d83f5f2..bcb0f5f8b1 100644 --- a/modules/openxr/editor/openxr_action_set_editor.cpp +++ b/modules/openxr/editor/openxr_action_set_editor.cpp @@ -29,7 +29,6 @@ /**************************************************************************/ #include "openxr_action_set_editor.h" -#include "editor/editor_node.h" #include "openxr_action_editor.h" void OpenXRActionSetEditor::_bind_methods() { @@ -212,7 +211,7 @@ void OpenXRActionSetEditor::set_focus_on_entry() { } OpenXRActionSetEditor::OpenXRActionSetEditor(Ref<OpenXRActionMap> p_action_map, Ref<OpenXRActionSet> p_action_set) { - undo_redo = EditorNode::get_undo_redo(); + undo_redo = EditorUndoRedoManager::get_singleton(); action_map = p_action_map; action_set = p_action_set; diff --git a/modules/openxr/editor/openxr_action_set_editor.h b/modules/openxr/editor/openxr_action_set_editor.h index 6040f7fb4e..129f800abe 100644 --- a/modules/openxr/editor/openxr_action_set_editor.h +++ b/modules/openxr/editor/openxr_action_set_editor.h @@ -44,7 +44,7 @@ class OpenXRActionSetEditor : public HBoxContainer { GDCLASS(OpenXRActionSetEditor, HBoxContainer); private: - Ref<EditorUndoRedoManager> undo_redo; + EditorUndoRedoManager *undo_redo; Ref<OpenXRActionMap> action_map; Ref<OpenXRActionSet> action_set; diff --git a/modules/openxr/editor/openxr_interaction_profile_editor.cpp b/modules/openxr/editor/openxr_interaction_profile_editor.cpp index 76b0ae5a3c..6a848dd430 100644 --- a/modules/openxr/editor/openxr_interaction_profile_editor.cpp +++ b/modules/openxr/editor/openxr_interaction_profile_editor.cpp @@ -29,7 +29,6 @@ /**************************************************************************/ #include "openxr_interaction_profile_editor.h" -#include "editor/editor_node.h" #include "scene/gui/box_container.h" #include "scene/gui/button.h" #include "scene/gui/label.h" @@ -141,7 +140,7 @@ void OpenXRInteractionProfileEditorBase::remove_all_bindings_for_action(Ref<Open } OpenXRInteractionProfileEditorBase::OpenXRInteractionProfileEditorBase(Ref<OpenXRActionMap> p_action_map, Ref<OpenXRInteractionProfile> p_interaction_profile) { - undo_redo = EditorNode::get_undo_redo(); + undo_redo = EditorUndoRedoManager::get_singleton(); action_map = p_action_map; interaction_profile = p_interaction_profile; diff --git a/modules/openxr/editor/openxr_interaction_profile_editor.h b/modules/openxr/editor/openxr_interaction_profile_editor.h index 73dba71cbd..fa25a000a9 100644 --- a/modules/openxr/editor/openxr_interaction_profile_editor.h +++ b/modules/openxr/editor/openxr_interaction_profile_editor.h @@ -43,7 +43,7 @@ class OpenXRInteractionProfileEditorBase : public ScrollContainer { GDCLASS(OpenXRInteractionProfileEditorBase, ScrollContainer); protected: - Ref<EditorUndoRedoManager> undo_redo; + EditorUndoRedoManager *undo_redo; Ref<OpenXRInteractionProfile> interaction_profile; Ref<OpenXRActionMap> action_map; diff --git a/modules/openxr/openxr_api.cpp b/modules/openxr/openxr_api.cpp index d556f475d2..6b8f140923 100644 --- a/modules/openxr/openxr_api.cpp +++ b/modules/openxr/openxr_api.cpp @@ -560,6 +560,12 @@ void OpenXRAPI::destroy_instance() { instance = XR_NULL_HANDLE; } enabled_extensions.clear(); + + if (graphics_extension != nullptr) { + unregister_extension_wrapper(graphics_extension); + memdelete(graphics_extension); + graphics_extension = nullptr; + } } bool OpenXRAPI::create_session() { @@ -1347,6 +1353,10 @@ void OpenXRAPI::register_extension_wrapper(OpenXRExtensionWrapper *p_extension_w registered_extension_wrappers.push_back(p_extension_wrapper); } +void OpenXRAPI::unregister_extension_wrapper(OpenXRExtensionWrapper *p_extension_wrapper) { + registered_extension_wrappers.erase(p_extension_wrapper); +} + void OpenXRAPI::register_extension_metadata() { for (OpenXRExtensionWrapper *extension_wrapper : registered_extension_wrappers) { extension_wrapper->on_register_metadata(); diff --git a/modules/openxr/openxr_api.h b/modules/openxr/openxr_api.h index 5fb8de660e..52a1af5a09 100644 --- a/modules/openxr/openxr_api.h +++ b/modules/openxr/openxr_api.h @@ -312,6 +312,7 @@ public: void set_xr_interface(OpenXRInterface *p_xr_interface); static void register_extension_wrapper(OpenXRExtensionWrapper *p_extension_wrapper); + static void unregister_extension_wrapper(OpenXRExtensionWrapper *p_extension_wrapper); static void register_extension_metadata(); static void cleanup_extension_wrappers(); diff --git a/modules/openxr/register_types.cpp b/modules/openxr/register_types.cpp index 4e2fe3dab5..1c4d53c43a 100644 --- a/modules/openxr/register_types.cpp +++ b/modules/openxr/register_types.cpp @@ -111,6 +111,10 @@ void initialize_openxr_module(ModuleInitializationLevel p_level) { ERR_FAIL_NULL(openxr_api); if (!openxr_api->initialize(Main::get_rendering_driver_name())) { + OS::get_singleton()->alert("OpenXR was requested but failed to start.\n" + "Please check if your HMD is connected.\n" + "When using Windows MR please note that WMR only has DirectX support, make sure SteamVR is your default OpenXR runtime.\n" + "Godot will start in normal mode.\n"); memdelete(openxr_api); openxr_api = nullptr; return; |