diff --git a/demo/main.gd b/demo/main.gd index 13477103..d45ca505 100644 --- a/demo/main.gd +++ b/demo/main.gd @@ -10,7 +10,7 @@ func _ready(): var vp: Viewport = get_viewport() vp.use_xr = true - scene_capture = OpenXRFbSceneCaptureExtensionWrapper.get_singleton() + scene_capture = Engine.get_singleton("OpenXRFbSceneCaptureExtensionWrapper") scene_capture.connect("scene_capture_completed", _on_scene_capture_completed) diff --git a/godotopenxrmeta/src/main/cpp/openxr_fb_scene_capture_extension_wrapper.cpp b/godotopenxrmeta/src/main/cpp/openxr_fb_scene_capture_extension_wrapper.cpp index 2c0a730b..803afe03 100644 --- a/godotopenxrmeta/src/main/cpp/openxr_fb_scene_capture_extension_wrapper.cpp +++ b/godotopenxrmeta/src/main/cpp/openxr_fb_scene_capture_extension_wrapper.cpp @@ -62,7 +62,6 @@ OpenXRFbSceneCaptureExtensionWrapper::~OpenXRFbSceneCaptureExtensionWrapper() { void OpenXRFbSceneCaptureExtensionWrapper::_bind_methods() { - ClassDB::bind_static_method("OpenXRFbSceneCaptureExtensionWrapper", D_METHOD("get_singleton"), &OpenXRFbSceneCaptureExtensionWrapper::get_singleton); ClassDB::bind_method(D_METHOD("is_scene_capture_supported"), &OpenXRFbSceneCaptureExtensionWrapper::is_scene_capture_supported); ClassDB::bind_method(D_METHOD("is_scene_capture_enabled"), &OpenXRFbSceneCaptureExtensionWrapper::is_scene_capture_enabled); ClassDB::bind_method(D_METHOD("request_scene_capture"), &OpenXRFbSceneCaptureExtensionWrapper::request_scene_capture); diff --git a/godotopenxrmeta/src/main/cpp/register_types.cpp b/godotopenxrmeta/src/main/cpp/register_types.cpp index 98544747..8442d6e3 100644 --- a/godotopenxrmeta/src/main/cpp/register_types.cpp +++ b/godotopenxrmeta/src/main/cpp/register_types.cpp @@ -31,6 +31,7 @@ #include +#include #include #include #include @@ -49,6 +50,7 @@ void initialize_plugin_module(ModuleInitializationLevel p_level) case MODULE_INITIALIZATION_LEVEL_CORE: { ClassDB::register_class(); OpenXRFbSceneCaptureExtensionWrapper::get_singleton()->register_extension_wrapper(); + Engine::get_singleton()->register_singleton("OpenXRFbSceneCaptureExtensionWrapper", OpenXRFbSceneCaptureExtensionWrapper::get_singleton()); } break; case MODULE_INITIALIZATION_LEVEL_EDITOR: {