summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorbruvzg <7645683+bruvzg@users.noreply.github.com>2022-03-25 09:27:46 +0200
committerbruvzg <7645683+bruvzg@users.noreply.github.com>2022-03-29 23:25:33 +0300
commitd2add64f919485fb6364903f817b603b2602e2b0 (patch)
tree026318317c75da2d885ef1ad16347b14dead2400 /main
parent04c17eb00389dff7add0459a5a4dd6e2886d3f05 (diff)
Move OpenXR project settings to the main, to make them visible on unsupported platforms.
Diffstat (limited to 'main')
-rw-r--r--main/main.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/main/main.cpp b/main/main.cpp
index c7a644d7b3..89b56a814e 100644
--- a/main/main.cpp
+++ b/main/main.cpp
@@ -1488,6 +1488,28 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
GLOBAL_DEF("display/window/ios/hide_home_indicator", true);
GLOBAL_DEF("input_devices/pointing/ios/touch_delay", 0.150);
+ // XR project settings.
+ GLOBAL_DEF_BASIC("xr/openxr/enabled", false);
+ GLOBAL_DEF_BASIC("xr/openxr/default_action_map", "res://default_action_map.tres");
+ ProjectSettings::get_singleton()->set_custom_property_info("xr/openxr/default_action_map", PropertyInfo(Variant::STRING, "xr/openxr/default_action_map", PROPERTY_HINT_FILE, "*.tres"));
+
+ GLOBAL_DEF_BASIC("xr/openxr/form_factor", "0");
+ ProjectSettings::get_singleton()->set_custom_property_info("xr/openxr/form_factor", PropertyInfo(Variant::INT, "xr/openxr/form_factor", PROPERTY_HINT_ENUM, "Head mounted,Handheld"));
+
+ GLOBAL_DEF_BASIC("xr/openxr/view_configuration", "1");
+ ProjectSettings::get_singleton()->set_custom_property_info("xr/openxr/view_configuration", PropertyInfo(Variant::INT, "xr/openxr/view_configuration", PROPERTY_HINT_ENUM, "Mono,Stereo")); // "Mono,Stereo,Quad,Observer"
+
+ GLOBAL_DEF_BASIC("xr/openxr/reference_space", "1");
+ ProjectSettings::get_singleton()->set_custom_property_info("xr/openxr/reference_space", PropertyInfo(Variant::INT, "xr/openxr/reference_space", PROPERTY_HINT_ENUM, "Local,Stage"));
+
+#ifdef TOOLS_ENABLED
+ // Disabled for now, using XR inside of the editor we'll be working on during the coming months.
+
+ // editor settings (it seems we're too early in the process when setting up rendering, to access editor settings...)
+ // EDITOR_DEF_RST("xr/openxr/in_editor", false);
+ // GLOBAL_DEF("xr/openxr/in_editor", false);
+#endif
+
Engine::get_singleton()->set_frame_delay(frame_delay);
message_queue = memnew(MessageQueue);