diff options
author | Chia-I Wu <[email protected]> | 2010-01-12 11:25:02 +0800 |
---|---|---|
committer | Chia-I Wu <[email protected]> | 2010-01-12 11:25:02 +0800 |
commit | 562c127693200822f04a145db50add1be2425d7b (patch) | |
tree | 9441774fb212b17ddf2a364f06abc43f166cc00b /progs/egl/demo3.c | |
parent | e5d351dcfde58777162552cf5cd2a9cd8299f4cd (diff) | |
parent | 077d6dd7508af88509dd0499c5dfbdaa186b4015 (diff) |
Merge branch 'master' into opengl-es-v2
Conflicts:
src/mesa/main/dd.h
Diffstat (limited to 'progs/egl/demo3.c')
-rw-r--r-- | progs/egl/demo3.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/progs/egl/demo3.c b/progs/egl/demo3.c index 0665fd0516e..64b9ee652cd 100644 --- a/progs/egl/demo3.c +++ b/progs/egl/demo3.c @@ -564,11 +564,8 @@ main(int argc, char *argv[]) EGLint numConfigs, count; EGLBoolean b; const GLubyte *bitmap; - const EGLint screenAttribs[] = { - EGL_WIDTH, 1024, - EGL_HEIGHT, 768, - EGL_NONE - }; + EGLint screenAttribs[32]; + EGLint i; EGLDisplay d = eglGetDisplay(EGL_DEFAULT_DISPLAY); assert(d); @@ -590,12 +587,20 @@ main(int argc, char *argv[]) eglGetScreensMESA(d, &screen, 1, &count); eglGetModesMESA(d, screen, &mode, 1, &count); + eglBindAPI(EGL_OPENGL_API); ctx = eglCreateContext(d, configs[0], EGL_NO_CONTEXT, NULL); if (ctx == EGL_NO_CONTEXT) { printf("failed to create context\n"); return 0; } + i = 0; + screenAttribs[i++] = EGL_WIDTH; + eglGetModeAttribMESA(d, mode, EGL_WIDTH, &screenAttribs[i++]); + screenAttribs[i++] = EGL_HEIGHT; + eglGetModeAttribMESA(d, mode, EGL_HEIGHT, &screenAttribs[i++]); + screenAttribs[i] = EGL_NONE; + screen_surf = eglCreateScreenSurfaceMESA(d, configs[0], screenAttribs); if (screen_surf == EGL_NO_SURFACE) { printf("failed to create screen surface\n"); |