summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorBastiaan Olij <mux213@gmail.com>2022-07-24 20:43:30 +1000
committerBastiaan Olij <mux213@gmail.com>2022-07-28 11:50:34 +1000
commit1dd671014bdfc714687f91914755ad925aabda5f (patch)
tree4c03669e8695c9900dfe1b6fe8b26c8757bbeb29 /main
parenteac22e3eb489b4a50bb274f10e8a8d4eb795fa99 (diff)
Add startup flag to override XR mode settings
Diffstat (limited to 'main')
-rw-r--r--main/main.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/main/main.cpp b/main/main.cpp
index 3f9fe34545..3e29323337 100644
--- a/main/main.cpp
+++ b/main/main.cpp
@@ -343,6 +343,7 @@ void Main::print_help(const char *p_binary) {
OS::get_singleton()->print(" --resolution <W>x<H> Request window resolution.\n");
OS::get_singleton()->print(" --position <X>,<Y> Request window position.\n");
OS::get_singleton()->print(" --single-window Use a single window (no separate subwindows).\n");
+ OS::get_singleton()->print(" --xr-mode <mode> Select XR mode (default/off/on).\n");
OS::get_singleton()->print("\n");
OS::get_singleton()->print("Debug options:\n");
@@ -1181,6 +1182,25 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
OS::get_singleton()->disable_crash_handler();
} else if (I->get() == "--skip-breakpoints") {
skip_breakpoints = true;
+ } else if (I->get() == "--xr-mode") {
+ if (I->next()) {
+ String xr_mode = I->next()->get().to_lower();
+ N = I->next()->next();
+ if (xr_mode == "default") {
+ XRServer::set_xr_mode(XRServer::XRMODE_DEFAULT);
+ } else if (xr_mode == "off") {
+ XRServer::set_xr_mode(XRServer::XRMODE_OFF);
+ } else if (xr_mode == "on") {
+ XRServer::set_xr_mode(XRServer::XRMODE_ON);
+ } else {
+ OS::get_singleton()->print("Unknown --xr-mode argument \"%s\", aborting.\n", xr_mode.ascii().get_data());
+ goto error;
+ }
+ } else {
+ OS::get_singleton()->print("Missing --xr-mode argument, aborting.\n");
+ goto error;
+ }
+
} else {
main_args.push_back(I->get());
}