From: José Fonseca Date: Tue, 16 Jun 2009 11:28:26 +0000 (+0100) Subject: progs/wgl: Fix assertion failure in wglthreads' texture creation. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=566bdbe67db04a9f94c1303bf41d1f453f7e72b2;p=mesa.git progs/wgl: Fix assertion failure in wglthreads' texture creation. --- diff --git a/progs/wgl/wglthreads/wglthreads.c b/progs/wgl/wglthreads/wglthreads.c index 9ca7f025dc3..079fb47c824 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); - } }