|
|
@ -151,7 +151,7 @@ init_egl(struct display *display, struct window *window) |
|
|
|
EGL_NONE |
|
|
|
EGL_NONE |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
EGLint major, minor, n, count, i, size; |
|
|
|
EGLint major, minor, n, count, i; |
|
|
|
EGLConfig *configs; |
|
|
|
EGLConfig *configs; |
|
|
|
EGLBoolean ret; |
|
|
|
EGLBoolean ret; |
|
|
|
|
|
|
|
|
|
|
@ -179,9 +179,13 @@ init_egl(struct display *display, struct window *window) |
|
|
|
assert(ret && n >= 1); |
|
|
|
assert(ret && n >= 1); |
|
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < n; i++) { |
|
|
|
for (i = 0; i < n; i++) { |
|
|
|
|
|
|
|
EGLint buffer_size, red_size; |
|
|
|
eglGetConfigAttrib(display->egl.dpy, |
|
|
|
eglGetConfigAttrib(display->egl.dpy, |
|
|
|
configs[i], EGL_BUFFER_SIZE, &size); |
|
|
|
configs[i], EGL_BUFFER_SIZE, &buffer_size); |
|
|
|
if (window->buffer_size == 0 || window->buffer_size == size) { |
|
|
|
eglGetConfigAttrib(display->egl.dpy, |
|
|
|
|
|
|
|
configs[i], EGL_RED_SIZE, &red_size); |
|
|
|
|
|
|
|
if ((window->buffer_size == 0 || |
|
|
|
|
|
|
|
window->buffer_size == buffer_size) && red_size < 10) { |
|
|
|
display->egl.conf = configs[i]; |
|
|
|
display->egl.conf = configs[i]; |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|