Hi All,
I'm trying to modify the QuartzComposerPlayer example to run both
windowed and full screen within a multi monitor setup. I've been
though all the stuff I can find on the list but am still having some
trouble if anyone can help? I'm using the below code to work out if
there are multiple displays which seems to work as does the capturing of
the second display but how do i make my openGL context display on only
the second monitor? currently whilst i capture the second display it
still draws across both
James
CGDisplayErr err;
CGDirectDisplayID dspys [[[NSScreen screens] count]];
CGDisplayCount dspyCnt;
err = CGGetOnlineDisplayList ([[NSScreen screens] count], dspys,
&dspyCnt); if (err != CGDisplayNoErr) {
NSLog(@"Cannot get display list");
[NSApp terminate:nil];
}
if (dspyCnt > 1) {
CGDisplayCapture(dspys[1]);
_screenSize.width = CGDisplayPixelsWide(dspys[1]);
_screenSize.height = CGDisplayPixelsHigh(dspys[1]);
} else {
CGDisplayCapture(dspys[0]);
_screenSize.width = CGDisplayPixelsWide(dspys[0]);
_screenSize.height = CGDisplayPixelsHigh(dspys[0]);
}
//Create the fullscreen OpenGL context on the main screen
(double-buffered with color and depth buffers)
_openGLContext = [[NSOpenGLContext alloc] initWithFormat:format
shareContext:nil];
if(_openGLContext == nil) {
NSLog(@"Cannot create OpenGL context");
[NSApp terminate:nil];
}
[_openGLContext setFullScreen];
[_openGLContext setValues:&value forParameter:kCGLCPSwapInterval];
//Create the QuartzComposer Renderer with that OpenGL context and
the specified composition file
_renderer = [[QCRenderer alloc] initWithOpenGLContext:_openGLContext
pixelFormat:format file:_filePath];
if(_renderer == nil) {
NSLog(@"Cannot create QCRenderer");
[NSApp terminate:nil];
}
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com
This email sent to [EMAIL PROTECTED]