I want to render to one window in a single thread with two different contexts, because state management in this case is much simpler for me. It works on Windows and Linux, but there's some problem with Mac. I use X11 for context management.
Here is a simple pseudo code snippet that demonstrates the problem:
Code :makeCurrent(display, drawable, rc1); float currTime = glutGet(GLUT_ELAPSED_TIME) / 1000.0f; float red = 0.5f + 0.5f * sinf(currTime); glClearColor(red, 0.0f, 0.0f, 1.0f); glClear(GL_COLOR_BUFFER_BIT); //makeCurrent(display, drawable, rc2); // doesn't work on mac glutSwapBuffers();
If we uncomment the second makeCurrent call, it seems that the system doesn't refresh the window's contents properly:
I created a small test app that I attached.
Any help is appreciated.