diff options
author | Sven Gothel <[email protected]> | 2012-03-04 19:20:52 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2012-03-04 19:20:52 +0100 |
commit | aeca49c50789b42d991386ace3edd0c10d23acc2 (patch) | |
tree | 68fc72db9620b09efc472feff23168c9a19c4e64 /src/test/native/mesa-demos-patched/eglut | |
parent | df6b48aef57db18c671ecda4bb962de84bb8e565 (diff) |
Add es2readsquare, reassembling JOGL's RedSquareES2 demo
Diffstat (limited to 'src/test/native/mesa-demos-patched/eglut')
-rw-r--r-- | src/test/native/mesa-demos-patched/eglut/eglut.c | 14 | ||||
-rw-r--r-- | src/test/native/mesa-demos-patched/eglut/eglut.h | 1 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/test/native/mesa-demos-patched/eglut/eglut.c b/src/test/native/mesa-demos-patched/eglut/eglut.c index a974e1dc7..eb72f6417 100644 --- a/src/test/native/mesa-demos-patched/eglut/eglut.c +++ b/src/test/native/mesa-demos-patched/eglut/eglut.c @@ -91,6 +91,7 @@ _eglutChooseConfig(void) EGLConfig config; EGLint config_attribs[32]; EGLint renderable_type, num_configs, i; + EGLint cfgid, vid; i = 0; config_attribs[i++] = EGL_RED_SIZE; @@ -123,6 +124,15 @@ _eglutChooseConfig(void) config_attribs, &config, 1, &num_configs) || !num_configs) _eglutFatal("failed to choose a config"); + if (!eglGetConfigAttrib(_eglut->dpy, + config, EGL_CONFIG_ID, &cfgid)) + _eglutFatal("failed to get visual id"); + if (!eglGetConfigAttrib(_eglut->dpy, + config, EGL_NATIVE_VISUAL_ID, &vid)) + _eglutFatal("failed to get visual id"); + + fprintf(stderr, "eglChooseConfig egl-cfg-id 0x%X, vid 0x%X\n", cfgid, vid); + return config; } @@ -342,6 +352,10 @@ eglutCreateWindow(const char *title) return win->index; } +void eglutSwapInterval(EGLint interval) { + eglSwapInterval(_eglut->dpy, interval); +} + int eglutGetWindowWidth(void) { diff --git a/src/test/native/mesa-demos-patched/eglut/eglut.h b/src/test/native/mesa-demos-patched/eglut/eglut.h index 6ad95cc0f..b1758ff67 100644 --- a/src/test/native/mesa-demos-patched/eglut/eglut.h +++ b/src/test/native/mesa-demos-patched/eglut/eglut.h @@ -76,6 +76,7 @@ int eglutGet(int state); void eglutIdleFunc(EGLUTidleCB func); void eglutPostRedisplay(void); +void eglutSwapInterval(EGLint interval); void eglutMainLoop(void); void eglutStopMainLoop(void); |