diff options
author | Juan Linietsky <reduzio@gmail.com> | 2015-11-24 10:52:41 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2015-11-24 10:52:41 -0300 |
commit | 082e3fbb2920340cec7e7b1a3f39083325b4b341 (patch) | |
tree | 753668f4057e41724d905bbfc8c74665b6422f7f /platform | |
parent | ccd40f76e8975b679619eb3591eb56376e82a6b3 (diff) | |
parent | 2ea992b7881a350ebae7df45c8069830e2ef6cc2 (diff) |
Merge branch 'master' of https://github.com/okamstudio/godot
Conflicts:
main/main.cpp
Diffstat (limited to 'platform')
-rw-r--r-- | platform/android/java/src/com/android/godot/GodotView.java | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/platform/android/java/src/com/android/godot/GodotView.java b/platform/android/java/src/com/android/godot/GodotView.java index ad0354e624..1a84923065 100644 --- a/platform/android/java/src/com/android/godot/GodotView.java +++ b/platform/android/java/src/com/android/godot/GodotView.java @@ -371,8 +371,8 @@ public class GodotView extends GLSurfaceView { if (use_32) { setEGLConfigChooser( translucent ? - new ConfigChooser(8, 8, 8, 8, 24, stencil) : - new ConfigChooser(8, 8, 8, 8, 24, stencil) ); + new FallbackConfigChooser(8, 8, 8, 8, 24, stencil, new ConfigChooser(8, 8, 8, 8, 16, stencil)) : + new FallbackConfigChooser(8, 8, 8, 8, 24, stencil, new ConfigChooser(5, 6, 5, 0, 16, stencil)) ); } else { setEGLConfigChooser( translucent ? @@ -410,6 +410,25 @@ public class GodotView extends GLSurfaceView { Log.e(TAG, String.format("%s: EGL error: 0x%x", prompt, error)); } } + /* Fallback if 32bit View is not supported*/ + private static class FallbackConfigChooser extends ConfigChooser { + private ConfigChooser fallback; + + public FallbackConfigChooser(int r, int g, int b, int a, int depth, int stencil, ConfigChooser fallback) { + super(r, g, b, a, depth, stencil); + this.fallback = fallback; + } + + @Override + public EGLConfig chooseConfig(EGL10 egl, EGLDisplay display, EGLConfig[] configs) { + EGLConfig ec = super.chooseConfig(egl, display, configs); + if (ec == null) { + Log.w(TAG, "Trying ConfigChooser fallback"); + ec = fallback.chooseConfig(egl, display, configs); + } + return ec; + } + } private static class ConfigChooser implements GLSurfaceView.EGLConfigChooser { |