I have a strange error with wglMakeCurrent.
In my application there are multiple threads which are rendering to one single context. The draw Operations are secured by a Semaphore, so the threads should not interfere with each other.
Each thread basically looks like this
GetSemaphore() wglMakeCurrent(context,0); Draw(); // this is where all drawing is done wglMakeCurrent(NULL,NULL); ReleaseSemaphore()
Now, whenever i call wglMakeCurrent(NULL,NULL); i get an OpenGL error GL_INVALID_OPERATION.
The strange thing is that everything is rendered exactly as it should be and wglMakeCurrents always returns TRUE … so i would expect that there was no error. OpenGL seems to think different.
Does anyone have an idea what the problem could be?