mirror of
https://github.com/Redot-Engine/redot-engine.git
synced 2025-12-06 15:21:56 -05:00
Replaced operating system alert dialog with a warning log message,
toggled by a project setting.
Fixes #73141
(cherry picked from commit cb8e919243)
This commit is contained in:
committed by
Yuri Sizov
parent
1e94881484
commit
4323c8b78b
@@ -2431,6 +2431,9 @@
|
|||||||
<member name="xr/openxr/reference_space" type="int" setter="" getter="" default=""1"">
|
<member name="xr/openxr/reference_space" type="int" setter="" getter="" default=""1"">
|
||||||
Specify the default reference space.
|
Specify the default reference space.
|
||||||
</member>
|
</member>
|
||||||
|
<member name="xr/openxr/startup_alert" type="bool" setter="" getter="" default="true">
|
||||||
|
If [code]true[/code], Godot will display an alert modal when OpenXR initialization fails on startup.
|
||||||
|
</member>
|
||||||
<member name="xr/openxr/submit_depth_buffer" type="bool" setter="" getter="" default="false">
|
<member name="xr/openxr/submit_depth_buffer" type="bool" setter="" getter="" default="false">
|
||||||
If [code]true[/code], OpenXR will manage the depth buffer and use the depth buffer for advanced reprojection provided this is supported by the XR runtime. Note that some rendering features in Godot can't be used with this feature.
|
If [code]true[/code], OpenXR will manage the depth buffer and use the depth buffer for advanced reprojection provided this is supported by the XR runtime. Note that some rendering features in Godot can't be used with this feature.
|
||||||
</member>
|
</member>
|
||||||
|
|||||||
@@ -1859,6 +1859,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
|
|||||||
GLOBAL_DEF_BASIC(PropertyInfo(Variant::INT, "xr/openxr/reference_space", PROPERTY_HINT_ENUM, "Local,Stage"), "1");
|
GLOBAL_DEF_BASIC(PropertyInfo(Variant::INT, "xr/openxr/reference_space", PROPERTY_HINT_ENUM, "Local,Stage"), "1");
|
||||||
|
|
||||||
GLOBAL_DEF_BASIC("xr/openxr/submit_depth_buffer", false);
|
GLOBAL_DEF_BASIC("xr/openxr/submit_depth_buffer", false);
|
||||||
|
GLOBAL_DEF_BASIC("xr/openxr/startup_alert", true);
|
||||||
|
|
||||||
#ifdef TOOLS_ENABLED
|
#ifdef TOOLS_ENABLED
|
||||||
// Disabled for now, using XR inside of the editor we'll be working on during the coming months.
|
// Disabled for now, using XR inside of the editor we'll be working on during the coming months.
|
||||||
|
|||||||
@@ -29,6 +29,7 @@
|
|||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
|
|
||||||
#include "register_types.h"
|
#include "register_types.h"
|
||||||
|
#include "core/config/project_settings.h"
|
||||||
#include "main/main.h"
|
#include "main/main.h"
|
||||||
|
|
||||||
#include "openxr_interface.h"
|
#include "openxr_interface.h"
|
||||||
@@ -113,10 +114,19 @@ void initialize_openxr_module(ModuleInitializationLevel p_level) {
|
|||||||
ERR_FAIL_NULL(openxr_api);
|
ERR_FAIL_NULL(openxr_api);
|
||||||
|
|
||||||
if (!openxr_api->initialize(Main::get_rendering_driver_name())) {
|
if (!openxr_api->initialize(Main::get_rendering_driver_name())) {
|
||||||
OS::get_singleton()->alert("OpenXR was requested but failed to start.\n"
|
const char *init_error_message =
|
||||||
"Please check if your HMD is connected.\n"
|
"OpenXR was requested but failed to start.\n"
|
||||||
"When using Windows MR please note that WMR only has DirectX support, make sure SteamVR is your default OpenXR runtime.\n"
|
"Please check if your HMD is connected.\n"
|
||||||
"Godot will start in normal mode.\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";
|
||||||
|
|
||||||
|
WARN_PRINT(init_error_message);
|
||||||
|
|
||||||
|
bool init_show_startup_alert = GLOBAL_GET("xr/openxr/startup_alert");
|
||||||
|
if (init_show_startup_alert) {
|
||||||
|
OS::get_singleton()->alert(init_error_message);
|
||||||
|
}
|
||||||
|
|
||||||
memdelete(openxr_api);
|
memdelete(openxr_api);
|
||||||
openxr_api = nullptr;
|
openxr_api = nullptr;
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user