summaryrefslogtreecommitdiffstats
path: root/opengl/tests
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2011-08-15 14:56:38 -0700
committerMathias Agopian <mathias@google.com>2011-08-15 15:25:40 -0700
commit7dddeac97122170f71151dfdd7934c4d207c679b (patch)
treec82ea0701795028bfaa7ad7455bdd433c145a2cd /opengl/tests
parentf9606df42b7b43a6eaa4abd989fef4b7c27a6eae (diff)
downloadframeworks_native-7dddeac97122170f71151dfdd7934c4d207c679b.zip
frameworks_native-7dddeac97122170f71151dfdd7934c4d207c679b.tar.gz
frameworks_native-7dddeac97122170f71151dfdd7934c4d207c679b.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.cpp16
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);