* move GL init to main thread

* fix potential bug causing the screen bitmap to be created twice
This commit is contained in:
Arisotura
2019-04-01 04:50:48 +02:00
parent 2d0d501d1f
commit 1f13d9ce80
4 changed files with 27 additions and 15 deletions

View File

@ -120,7 +120,14 @@ void uiGLFreeContext(uiGLContext* ctx)
void uiGLMakeContextCurrent(uiGLContext* ctx)
{
wglMakeCurrent(ctx->dc, ctx->rc);
if (ctx == NULL)
{
wglMakeCurrent(NULL, NULL);
return;
}
if (wglGetCurrentContext() == ctx->rc) return;
int res = wglMakeCurrent(ctx->dc, ctx->rc);
}
void *uiGLGetProcAddress(const char* proc)