I have between 1- 5 NSOpenGLViews layed out in an NSWindow using:
[ [window contentView]addSubview:glview].
Each NSOpenGLViews is created with a NSOpenGLPixelFormat matching an
external display via CGDisplayIDToGLDisplayMask().
This way I can simultaneously display each of my 1-5 scenes in the
NSWindow and on an external display using a separate fullscreen
NSOpenGLContext per scene / display.
This works perfectly when only 1 external display is attached, but
becomes *extremely* slow when additional displays are used,
regardless of wether I actually create the contexts for the external
displays - simply creating the windowed contexts with pixel formats
matching the external displays is enough to cause the problem.
If I change my code so that each context is mapped to the Main
display then the windowed contexts perform just fine. Likewise if I
disable my windowed contexts then the external contexts perform
So , the problem appears to be NSOpenGL's handelling of multiple
pixel formats? Actually the problem seems similar to the performance
hit seen when a window associated with an NSOpenGLContext is dragged
across two displays. Incidentally calling currentVirtualScreen
reports '0' for each context.
Any ideas of feasability / how to fix this are most welcome.