Mesa (master): progs/egl: Fix the blank window in pbuffer demo.

Chia-I Wu olv at kemper.freedesktop.org
Tue Apr 6 05:49:35 UTC 2010


Module: Mesa
Branch: master
Commit: 0942ed45b370addf4edb310d4d0f9cd0c7b18fd0
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=0942ed45b370addf4edb310d4d0f9cd0c7b18fd0

Author: Chia-I Wu <olv at lunarg.com>
Date:   Tue Apr  6 13:24:24 2010 +0800

progs/egl: Fix the blank window in pbuffer demo.

EGL requires eglSwapBuffers to be called on the current surface.

---

 progs/egl/opengles1/pbuffer.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/progs/egl/opengles1/pbuffer.c b/progs/egl/opengles1/pbuffer.c
index 011c2af..60f8644 100644
--- a/progs/egl/opengles1/pbuffer.c
+++ b/progs/egl/opengles1/pbuffer.c
@@ -168,6 +168,8 @@ draw_both(EGLDisplay egl_dpy, EGLSurface egl_surf, EGLSurface egl_pbuf,
    glReadPixels(0, 0, WinWidth, WinHeight, GL_RGBA, GL_UNSIGNED_BYTE, wbuf);
    printf("Window[%d,%d] = 0x%08x\n", x, y, wbuf[y*WinWidth+x]);
 
+   eglSwapBuffers(egl_dpy, egl_surf);
+
    /* then draw to pbuffer */
    if (!eglMakeCurrent(egl_dpy, egl_pbuf, egl_pbuf, egl_ctx)) {
       printf("Error: eglMakeCurrent(pbuffer) failed\n");
@@ -177,7 +179,6 @@ draw_both(EGLDisplay egl_dpy, EGLSurface egl_surf, EGLSurface egl_pbuf,
    glReadPixels(0, 0, WinWidth, WinHeight, GL_RGBA, GL_UNSIGNED_BYTE, pbuf);
    printf("Pbuffer[%d,%d] = 0x%08x\n", x, y, pbuf[y*WinWidth+x]);
 
-   eglSwapBuffers(egl_dpy, egl_surf);
 
    /* compare renderings */
    for (dif = i = 0; i < WinWidth * WinHeight; i++) {




More information about the mesa-commit mailing list