diff options
author | Michal Krol <michal@vmware.com> | 2009-12-12 16:48:32 +0100 |
---|---|---|
committer | Michal Krol <michal@vmware.com> | 2009-12-12 16:48:32 +0100 |
commit | a3eb0f718e19653a2ad8e49396c904183be456f3 (patch) | |
tree | 0092574c469ea586a6cab8b8ebb7ac62b8221a2a /progs/egl/demo1.c | |
parent | 491f384c3958067e6c4c994041f5d8d413b806bc (diff) | |
parent | 784cca9fa527de771754d76545970f78094b9adf (diff) |
Merge branch 'master' into glsl-pp-rework-2
Conflicts:
progs/perf/drawoverhead.c
progs/perf/teximage.c
progs/perf/vbo.c
progs/perf/vertexrate.c
src/mesa/shader/slang/library/slang_common_builtin_gc.h
Diffstat (limited to 'progs/egl/demo1.c')
-rw-r--r-- | progs/egl/demo1.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/progs/egl/demo1.c b/progs/egl/demo1.c index 49b6624538..34a516e72f 100644 --- a/progs/egl/demo1.c +++ b/progs/egl/demo1.c @@ -34,14 +34,9 @@ TestScreens(EGLDisplay dpy) * Print table of all available configurations. */ static void -PrintConfigs(EGLDisplay d) +PrintConfigs(EGLDisplay d, EGLConfig *configs, EGLint numConfigs) { - EGLConfig *configs; - EGLint numConfigs, i; - - eglGetConfigs(d, NULL, 0, &numConfigs); - configs = malloc(sizeof(*configs) *numConfigs); - eglGetConfigs(d, configs, numConfigs, &numConfigs); + EGLint i; printf("Configurations:\n"); printf(" bf lv d st colorbuffer dp st supported \n"); @@ -83,7 +78,6 @@ PrintConfigs(EGLDisplay d) red, green, blue, alpha, depth, stencil, surfString); } - free(configs); } @@ -94,7 +88,8 @@ main(int argc, char *argv[]) int maj, min; EGLContext ctx; EGLSurface pbuffer; - EGLConfig configs[10]; + EGLConfig *configs; + EGLint numConfigs; EGLBoolean b; const EGLint pbufAttribs[] = { EGL_WIDTH, 500, @@ -102,10 +97,7 @@ main(int argc, char *argv[]) EGL_NONE }; - /* EGLDisplay d = eglGetDisplay(EGL_DEFAULT_DISPLAY); - */ - EGLDisplay d = eglGetDisplay((EGLNativeDisplayType) "!EGL_i915"); assert(d); if (!eglInitialize(d, &maj, &min)) { @@ -116,7 +108,11 @@ main(int argc, char *argv[]) printf("EGL version = %d.%d\n", maj, min); printf("EGL_VENDOR = %s\n", eglQueryString(d, EGL_VENDOR)); - PrintConfigs(d); + eglGetConfigs(d, NULL, 0, &numConfigs); + configs = malloc(sizeof(*configs) *numConfigs); + eglGetConfigs(d, configs, numConfigs, &numConfigs); + + PrintConfigs(d, configs, numConfigs); ctx = eglCreateContext(d, configs[0], EGL_NO_CONTEXT, NULL); if (ctx == EGL_NO_CONTEXT) { @@ -130,6 +126,8 @@ main(int argc, char *argv[]) return 0; } + free(configs); + b = eglMakeCurrent(d, pbuffer, pbuffer, ctx); if (!b) { printf("make current failed\n"); |