From: Brian Paul Date: Wed, 4 May 2005 03:32:39 +0000 (+0000) Subject: updates for latest EGLScreenMESA changes X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3aeae2068510a369ba5c90ae1355d0b0ed89d5f5;p=mesa.git updates for latest EGLScreenMESA changes --- diff --git a/progs/egl/demo1.c b/progs/egl/demo1.c index 9b9a2ed4aba..f656b547439 100644 --- a/progs/egl/demo1.c +++ b/progs/egl/demo1.c @@ -8,6 +8,25 @@ #include +/** + * Test EGL_MESA_screen_surface functions + */ +static void +TestScreens(EGLDisplay dpy) +{ +#define MAX 8 + EGLScreenMESA screens[MAX]; + EGLint numScreens; + EGLint i; + + eglGetScreensMESA(dpy, screens, MAX, &numScreens); + printf("Found %d screens\n", numScreens); + for (i = 0; i < numScreens; i++) { + printf(" Screen %d handle: %d\n", i, (int) screens[i]); + } +} + + int main(int argc, char *argv[]) @@ -68,6 +87,8 @@ main(int argc, char *argv[]) b = eglMakeCurrent(d, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); + TestScreens(d); + eglDestroySurface(d, pbuffer); eglDestroyContext(d, ctx); eglTerminate(d); diff --git a/progs/egl/eglinfo.c b/progs/egl/eglinfo.c index 7e29ce7cf4c..a80df6cd9f4 100644 --- a/progs/egl/eglinfo.c +++ b/progs/egl/eglinfo.c @@ -98,12 +98,17 @@ PrintModes(EGLDisplay d) #ifdef EGL_MESA_screen_surface const char *extensions = eglQueryString(d, EGL_EXTENSIONS); if (strstr("EGL_MESA_screen_surface", extensions)) { - EGLint scrn, numScreens = 1; + EGLScreenMESA screens[20]; + EGLint numScreens = 1, scrn; EGLModeMESA modes[MAX_MODES]; - EGLint numModes, i; + + eglGetScreensMESA(d, screens, 20, &numScreens); + printf("Number of Screens: %d\n\n", numScreens); for (scrn = 0; scrn < numScreens; scrn++) { - eglGetModesMESA(d, scrn, modes, MAX_MODES, &numModes); + EGLint numModes, i; + + eglGetModesMESA(d, screens[scrn], modes, MAX_MODES, &numModes); printf("Screen %d Modes:\n", scrn); printf(" id width height refresh\n");