summaryrefslogtreecommitdiff
path: root/platform/iphone
diff options
context:
space:
mode:
authorHein-Pieter van Braam <hp@tmm.cx>2018-08-25 00:04:25 +0200
committerHein-Pieter van Braam <hp@tmm.cx>2018-08-26 16:40:46 +0200
commit08f452d1a95d7f171472c33a60983d95adf1665d (patch)
treeaffda153790d6851509d6a316221dc1ab97d5f0d /platform/iphone
parent8c435a343e9739f30cb2e347df95835c91c1ff1a (diff)
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
Diffstat (limited to 'platform/iphone')
-rw-r--r--platform/iphone/os_iphone.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/platform/iphone/os_iphone.cpp b/platform/iphone/os_iphone.cpp
index a4538a6673..addef61ec7 100644
--- a/platform/iphone/os_iphone.cpp
+++ b/platform/iphone/os_iphone.cpp
@@ -99,8 +99,11 @@ int OSIPhone::get_current_video_driver() const {
Error OSIPhone::initialize(const VideoMode &p_desired, int p_video_driver, int p_audio_driver) {
- video_driver_index = p_video_driver; //this may be misleading
+ video_driver_index = VIDEO_DRIVER_GLES3;
+ if (RasterizerGLES3::is_viable() != OK) {
+ return ERR_UNAVAILABLE;
+ }
RasterizerGLES3::register_config();
RasterizerGLES3::make_current();