From 08f452d1a95d7f171472c33a60983d95adf1665d Mon Sep 17 00:00:00 2001 From: Hein-Pieter van Braam Date: Sat, 25 Aug 2018 00:04:25 +0200 Subject: Fall back to GLES2 if GLES3 is not working This adds a static is_viable() method to all rasterizers which has to be called before initializing the rasterizer. This allows us to check what rasterizer to use in OS::initialize together with the GL context initialization. This commit also adds a new project setting "rendering/quality/driver/driver_fallback" which allows the creator of a project to specify whether or not fallback to GLES2 is allowed. This setting is ignored for the editor so the editor will always open even if the project itself cannot run. This will hopefully reduce confusion for users downloading projects from the internet. We also no longer crash when GLES3 is not functioning on a platform. This fixes #15324 --- main/main.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'main/main.cpp') diff --git a/main/main.cpp b/main/main.cpp index 21851337b7..a336496d39 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -830,6 +830,9 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph video_driver = GLOBAL_GET("rendering/quality/driver/driver_name"); } + GLOBAL_DEF("rendering/quality/driver/driver_fallback", "Best"); + ProjectSettings::get_singleton()->set_custom_property_info("rendering/quality/driver/driver_fallback", PropertyInfo(Variant::STRING, "rendering/quality/driver/driver_fallback", PROPERTY_HINT_ENUM, "Best,Never")); + GLOBAL_DEF("display/window/size/width", 1024); GLOBAL_DEF("display/window/size/height", 600); GLOBAL_DEF("display/window/size/resizable", true); @@ -1040,6 +1043,7 @@ Error Main::setup2(Thread::ID p_main_tid_override) { if (err != OK) { return err; } + if (init_use_custom_pos) { OS::get_singleton()->set_window_position(init_custom_pos); } -- cgit v1.2.3