summaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorHugo Locurcio <hugo.locurcio@hugo.pro>2019-08-19 16:14:58 +0200
committerHugo Locurcio <hugo.locurcio@hugo.pro>2019-08-24 00:09:52 +0200
commit3d61ca5696e7497df9344b828337104dd7ac3731 (patch)
tree7e487fd435bcfd02fccc0c9b832976438d08040f /main
parentcce148b0242836b5c32a7fa6c39013a2fc1c9eff (diff)
downloadredot-engine-3d61ca5696e7497df9344b828337104dd7ac3731.tar.gz
Register as an editor instance when generating the GDNative API JSON
This enables the automatic GLES2 fallback if the hardware doesn't support the GLES3 backend. This closes #27768.
Diffstat (limited to 'main')
-rw-r--r--main/main.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/main/main.cpp b/main/main.cpp
index 027273c4f4..c422cc0882 100644
--- a/main/main.cpp
+++ b/main/main.cpp
@@ -599,6 +599,14 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
auto_build_solutions = true;
editor = true;
+#ifdef DEBUG_METHODS_ENABLED
+ } else if (I->get() == "--gdnative-generate-json-api") {
+ // Register as an editor instance to use the GLES2 fallback automatically on hardware that doesn't support the GLES3 backend
+ editor = true;
+
+ // We still pass it to the main arguments since the argument handling itself is not done in this function
+ main_args.push_back(I->get());
+#endif
} else if (I->get() == "--export" || I->get() == "--export-debug") { // Export project
editor = true;