diff options
author | Mathias Agopian <mathias@google.com> | 2011-08-15 14:56:38 -0700 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2011-08-15 15:25:40 -0700 |
commit | e98013b8886249ae38650836f6915e0f7d0e7476 (patch) | |
tree | e4b7164bcb8e0130b8d1756c8a7c4d326701bf31 /opengl/tests | |
parent | 47b212935025fd514a414451fff98aaeeaa92934 (diff) | |
download | frameworks_base-e98013b8886249ae38650836f6915e0f7d0e7476.zip frameworks_base-e98013b8886249ae38650836f6915e0f7d0e7476.tar.gz frameworks_base-e98013b8886249ae38650836f6915e0f7d0e7476.tar.bz2 |
fix test-opengl-swapinterval
EGLConfig selection should now work on any device
Change-Id: I4d4580e891d1faf817fa853838406fb49d12e50a
Diffstat (limited to 'opengl/tests')
-rw-r--r-- | opengl/tests/swapinterval/swapinterval.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/opengl/tests/swapinterval/swapinterval.cpp b/opengl/tests/swapinterval/swapinterval.cpp index df53b62..8ca031b 100644 --- a/opengl/tests/swapinterval/swapinterval.cpp +++ b/opengl/tests/swapinterval/swapinterval.cpp @@ -48,31 +48,35 @@ int main(int argc, char** argv) EGLNativeWindowType window = android_createDisplaySurface(); dpy = eglGetDisplay(EGL_DEFAULT_DISPLAY); - eglInitialize(dpy, 0 ,0) ;//&majorVersion, &minorVersion); + eglInitialize(dpy, &majorVersion, &minorVersion); eglGetConfigs(dpy, NULL, 0, &numConfigs); printf("# configs = %d\n", numConfigs); status_t err = EGLUtils::selectConfigForNativeWindow( dpy, configAttribs, window, &config); if (err) { - fprintf(stderr, "couldn't find an EGLConfig matching the screen format\n"); + fprintf(stderr, "error: %s", EGLUtils::strerror(eglGetError())); + eglTerminate(dpy); return 0; } - EGLint r,g,b,a; + EGLint r,g,b,a, vid; eglGetConfigAttrib(dpy, config, EGL_RED_SIZE, &r); eglGetConfigAttrib(dpy, config, EGL_GREEN_SIZE, &g); eglGetConfigAttrib(dpy, config, EGL_BLUE_SIZE, &b); eglGetConfigAttrib(dpy, config, EGL_ALPHA_SIZE, &a); + eglGetConfigAttrib(dpy, config, EGL_NATIVE_VISUAL_ID, &vid); surface = eglCreateWindowSurface(dpy, config, window, NULL); if (surface == EGL_NO_SURFACE) { EGLint err = eglGetError(); - fprintf(stderr, "%s, config=%p, format = %d-%d-%d-%d\n", - EGLUtils::strerror(err), config, r,g,b,a); + fprintf(stderr, "error: %s, config=%p, format = %d-%d-%d-%d, visual-id = %d\n", + EGLUtils::strerror(err), config, r,g,b,a, vid); + eglTerminate(dpy); return 0; } else { - printf("config=%p, format = %d-%d-%d-%d\n", config, r,g,b,a); + printf("config=%p, format = %d-%d-%d-%d, visual-id = %d\n", + config, r,g,b,a, vid); } context = eglCreateContext(dpy, config, NULL, NULL); |