Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: Multiple context for one window in single thread

  1. #1
    Junior Member Newbie
    Join Date
    May 2009
    Location
    Budapest, Hungary
    Posts
    29

    Multiple context for one window in single thread

    Hi!

    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: Click image for larger version. 

Name:	MacProblem.jpg 
Views:	16 
Size:	97.8 KB 
ID:	714

    I created a small test app that I attached.

    Any help is appreciated.
    Thanks
    Attached Files Attached Files

  2. #2
    Member Regular Contributor
    Join Date
    Jan 2012
    Location
    Germany
    Posts
    302
    Apple has some problems with OpenGL, in addition, the X11 layer is deprecated and will get removed in the next MacOS X release. So if that's a problem on Apples side, it wont get fixed anymore.
    You might want to test if rendering with multiple contexts works better in a cocoa based window (GLFW is simlar 'basic' as GLUT and uses cocoa internally for its Mac support, you might look up how they are doing the context creation). If you can reproduce problems in a cocoa based configuration, you can file a bug report at Apple and hope for a fix (that maybe even solves the problem in a X11 environment - I don't know if that mappes internally to cocoa). A X11 based bugreport will most likely get ignored.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •