Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Consider the case where an attribute is set to EGL_DONT_CARE in eglCh…
Browse files Browse the repository at this point in the history
…ooseConfig

SDL doesn't currently use EGL_DONT_CARE, but it doesn' hurt to future proof.
  • Loading branch information
gabomdq committed Jul 26, 2013
1 parent 44db9b3 commit 96cc254
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions android-project/src/org/libsdl/app/SDLActivity.java
Expand Up @@ -343,12 +343,12 @@ public static boolean initEGL(int majorVersion, int minorVersion, int[] attribs)
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
}
Expand Down

0 comments on commit 96cc254

Please sign in to comment.