fix android problem with 24 bit depth buffer on some devices (#18148)

This commit is contained in:
newnon 2017-08-22 04:43:07 +03:00 committed by minggo
parent 04b2dbbcdb
commit a8026b0136
1 changed files with 11 additions and 0 deletions

View File

@ -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,