diff options
author | José Fonseca <jfonseca@vmware.com> | 2009-06-16 12:28:26 +0100 |
---|---|---|
committer | José Fonseca <jfonseca@vmware.com> | 2009-06-16 12:29:58 +0100 |
commit | 566bdbe67db04a9f94c1303bf41d1f453f7e72b2 (patch) | |
tree | d83d4e3a09d202f9a5b03c38fc5ad6ae1afbc0ee /progs/wgl | |
parent | d027e8feff7d38cccadc6aaccc0454b21ce4dca0 (diff) |
progs/wgl: Fix assertion failure in wglthreads' texture creation.
Diffstat (limited to 'progs/wgl')
-rw-r--r-- | 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 9ca7f025dc..079fb47c82 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); - } } |