Mesa (mesa_7_5_branch): progs/wgl: Fix assertion failure in wglthreads' texture creation.

Jose Fonseca jrfonseca at kemper.freedesktop.org
Tue Jun 16 11:30:02 UTC 2009


Module: Mesa
Branch: mesa_7_5_branch
Commit: 566bdbe67db04a9f94c1303bf41d1f453f7e72b2
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=566bdbe67db04a9f94c1303bf41d1f453f7e72b2

Author: José Fonseca <jfonseca at vmware.com>
Date:   Tue Jun 16 12:28:26 2009 +0100

progs/wgl: Fix assertion failure in wglthreads' texture creation.

---

 progs/wgl/wglthreads/wglthreads.c |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/progs/wgl/wglthreads/wglthreads.c b/progs/wgl/wglthreads/wglthreads.c
index 9ca7f02..079fb47 100644
--- a/progs/wgl/wglthreads/wglthreads.c
+++ b/progs/wgl/wglthreads/wglthreads.c
@@ -72,6 +72,7 @@ struct winthread {
    int WinWidth, WinHeight;
    GLboolean NewSize;
    HANDLE hEventInitialised;
+   GLboolean Initialized;
    GLboolean MakeNewTexture;
    HANDLE hEventRedraw;
 };
@@ -288,6 +289,15 @@ draw_loop(struct winthread *wt)
 
       wglMakeCurrent(wt->hDC, wt->Context);
 
+      if (!wt->Initialized) {
+         printf("wglthreads: %d: GL_RENDERER = %s\n", wt->Index,
+                (char *) glGetString(GL_RENDERER));
+         if (Texture /*&& wt->Index == 0*/) {
+            MakeNewTexture(wt);
+         }
+         wt->Initialized = GL_TRUE;
+      }
+
       if (Locking)
          LeaveCriticalSection(&Mutex);
 
@@ -482,14 +492,6 @@ create_window(struct winthread *wt, HGLRC shareCtx)
    wt->WinWidth = width;
    wt->WinHeight = height;
    wt->NewSize = GL_TRUE;
-
-   wglMakeCurrent(hdc, ctx);
-   printf("wglthreads: %d: GL_RENDERER = %s\n", wt->Index, (char *) glGetString(GL_RENDERER));
-   wglMakeCurrent(NULL, NULL);
-
-   if (Texture/* && wt->Index == 0*/) {
-      MakeNewTexture(wt);
-   }
 }
 
 




More information about the mesa-commit mailing list