Consider the case where an attribute is set to EGL_DONT_CARE in eglChooseConfig
authorGabriel Jacobo <gabomdq@gmail.com>
Fri, 26 Jul 2013 12:37:36 -0300
changeset 7520 24fd80e8baaf
parent 7519 b9ef4591d6b5
child 7521 03bca9a4180d
Consider the case where an attribute is set to EGL_DONT_CARE in eglChooseConfig SDL doesn't currently use EGL_DONT_CARE, but it doesn' hurt to future proof.
android-project/src/org/libsdl/app/SDLActivity.java
--- a/android-project/src/org/libsdl/app/SDLActivity.java	Fri Jul 26 12:22:40 2013 -0300
+++ b/android-project/src/org/libsdl/app/SDLActivity.java	Fri Jul 26 12:37:36 2013 -0300
@@ -343,12 +343,12 @@
                         if (attribs[j] == EGL10.EGL_NONE)
                             break;
 
-                        if (attribs[j] == EGL10.EGL_RED_SIZE ||
+                        if (attribs[j+1] != EGL10.EGL_DONT_CARE && (attribs[j] == EGL10.EGL_RED_SIZE ||
                             attribs[j] == EGL10.EGL_GREEN_SIZE ||
                             attribs[j] == EGL10.EGL_BLUE_SIZE ||
                             attribs[j] == EGL10.EGL_ALPHA_SIZE ||
                             attribs[j] == EGL10.EGL_DEPTH_SIZE ||
-                            attribs[j] == EGL10.EGL_STENCIL_SIZE) {
+                            attribs[j] == EGL10.EGL_STENCIL_SIZE)) {
                             egl.eglGetConfigAttrib(dpy, configs[i], attribs[j], value);
                             bitdiff += value[0] - attribs[j + 1]; // value is always >= attrib
                         }