From a8026b0136b008c9f8dc2ef01cbde1fa7902502e Mon Sep 17 00:00:00 2001 From: newnon Date: Tue, 22 Aug 2017 04:43:07 +0300 Subject: [PATCH] fix android problem with 24 bit depth buffer on some devices (#18148) --- .../java/src/org/cocos2dx/lib/Cocos2dxActivity.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxActivity.java b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxActivity.java index 109d747854..601d44c015 100644 --- a/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxActivity.java +++ b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxActivity.java @@ -360,6 +360,17 @@ public abstract class Cocos2dxActivity extends Activity implements Cocos2dxHelpe EGL10.EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, EGL10.EGL_NONE }, + { + // GL ES 2 with user set + EGL10.EGL_RED_SIZE, mConfigAttributes[0], + EGL10.EGL_GREEN_SIZE, mConfigAttributes[1], + EGL10.EGL_BLUE_SIZE, mConfigAttributes[2], + EGL10.EGL_ALPHA_SIZE, mConfigAttributes[3], + EGL10.EGL_DEPTH_SIZE, mConfigAttributes[4] >= 24 ? 16 : mConfigAttributes[4], + EGL10.EGL_STENCIL_SIZE, mConfigAttributes[5], + EGL10.EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, + EGL10.EGL_NONE + }, { // GL ES 2 by default EGL10.EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,