diff options
author | Chad Versace <chad.versace@linux.intel.com> | 2013-09-17 13:09:42 -0700 |
---|---|---|
committer | Chad Versace <chad.versace@linux.intel.com> | 2013-09-17 16:27:35 -0700 |
commit | 5308ab30a79870b5115e798fd521cebb20bb3116 (patch) | |
tree | 59cfe29caf3c7ba75d279b8dc0e6ddbe9d237074 | |
parent | 58efa4fbd4eee7c03cc7a280c72f58c302a70ceb (diff) | |
download | waffle-debug/list-eglconfigs.tar.gz |
-rw-r--r-- | src/waffle/egl/wegl_display.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/waffle/egl/wegl_display.c b/src/waffle/egl/wegl_display.c index 0716a32..71dcdf8 100644 --- a/src/waffle/egl/wegl_display.c +++ b/src/waffle/egl/wegl_display.c @@ -24,6 +24,7 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include <assert.h> +#include <stdio.h> #include "wcore_error.h" #include "wcore_platform.h" @@ -82,6 +83,38 @@ wegl_display_init(struct wegl_display *dpy, if (!ok) goto fail; + EGLConfig configs[512]; + EGLint num_configs; + + printf("eglGetConfigs\n"); + printf("-----------------------------\n"); + eglGetConfigs(dpy->egl, configs, 512, &num_configs); + for (int i = 0; i < num_configs; ++i) { + EGLint id, r, g, b, a; + eglGetConfigAttrib(dpy->egl, configs[i], EGL_CONFIG_ID, &id); + eglGetConfigAttrib(dpy->egl, configs[i], EGL_RED_SIZE, &r); + eglGetConfigAttrib(dpy->egl, configs[i], EGL_GREEN_SIZE, &g); + eglGetConfigAttrib(dpy->egl, configs[i], EGL_BLUE_SIZE, &b); + eglGetConfigAttrib(dpy->egl, configs[i], EGL_ALPHA_SIZE, &a); + printf("%3d: %3d %3d %3d %3d %3d\n", i, id, r, g, b, a); + } + + printf("eglChooseConfig(r=8, g=8, b=8)\n"); + printf("-----------------------------\n"); + eglChooseConfig(dpy->egl, (EGLint[]){EGL_RED_SIZE, 8, EGL_GREEN_SIZE, 8, EGL_BLUE_SIZE, 8, EGL_NONE}, + configs, 512, &num_configs); + for (int i = 0; i < num_configs; ++i) { + EGLint id, r, g, b, a; + eglGetConfigAttrib(dpy->egl, configs[i], EGL_CONFIG_ID, &id); + eglGetConfigAttrib(dpy->egl, configs[i], EGL_RED_SIZE, &r); + eglGetConfigAttrib(dpy->egl, configs[i], EGL_GREEN_SIZE, &g); + eglGetConfigAttrib(dpy->egl, configs[i], EGL_BLUE_SIZE, &b); + eglGetConfigAttrib(dpy->egl, configs[i], EGL_ALPHA_SIZE, &a); + printf("%3d: %3d %3d %3d %3d %3d\n", i, id, r, g, b, a); + } + + abort(); + return true; fail: |