kCGLCPSurfaceBackingSize and enterFullScreenMode:withOptions:
kCGLCPSurfaceBackingSize and enterFullScreenMode:withOptions:
- Subject: kCGLCPSurfaceBackingSize and enterFullScreenMode:withOptions:
- From: Martin Plicht <email@hidden>
- Date: Sat, 29 May 2010 12:38:48 +0200
Hi,
I have a custom NSView that manages an NSOpenGLContext. From the window controller I use the following code to switch to fullscreen mode:
// let opengl view enter fullscreen mode
CGDisplayFadeReservationToken token;
[self fadeOut:&token];
[openGLView enterFullScreenMode:[self.window screen] withOptions:[NSDictionary dictionary]];
[openGLView.window setDelegate:self];
[openGLView enableEvents];
[openGLView display];
[NSCursor hide]; // hide completely
[self fadeIn:token];
// enable custom backing store size
NSOpenGLContext* fullscreenContext = pGL->GetMainCtx()->GetCocoaContext();
GLint dim[2] = {Config.Graphics.ResX, Config.Graphics.ResY};
CGLSetParameter((CGLContextObj)[fullscreenContext CGLContextObj], kCGLCPSurfaceBackingSize, dim);
CGLEnable((CGLContextObj)[fullscreenContext CGLContextObj], kCGLCESurfaceBackingSize);
This works on an iMac7,1 with an ATI Radeon HD 2600 but fails to work on a Macbook Pro7,1 13inch with an Nvidia Geforce 320M. The Macbook screen just stays grey without OpenGL commands getting to it. So, is there any better way preferably using Cocoa APIs to activate a custom backing store size?_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden