summaryrefslogtreecommitdiff
path: root/platform/android/java/src/com
diff options
context:
space:
mode:
authormikica1986vee <mikica1986vee@gmail.com>2015-11-21 23:21:36 +0100
committermikica1986vee <mikica1986vee@gmail.com>2015-11-21 23:21:36 +0100
commitd6b317a2c1d6560323d37831ab1d40f3b2674adc (patch)
tree85672853c336410cc21b89a646f40eb86a1c6f8a /platform/android/java/src/com
parent0b07d16fef8f537624949be4f114e8be92c8abb0 (diff)
tegra 3 fix
Diffstat (limited to 'platform/android/java/src/com')
-rw-r--r--platform/android/java/src/com/android/godot/GodotView.java23
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 {