switching screen resolution
I'm tried using...
CGDisplayCapture (kCGDirectMainDisplay ) ;
CGDisplaySwitchToMode (kCGDirectMainDisplay,
CGDisplayBestModeForParameters (kCGDirectMainDisplay,
32, 1024, 768, NULL));
...to switch the screen resolution at the beginning of my app, but it just turns the screen black, the the cursor is still visible and appears pixelated as it would for 1024x768 resolution. I tried running this code at various points during my programs setup but nothing works, any idea on what might be causing this?
CGDisplayCapture (kCGDirectMainDisplay ) ;
CGDisplaySwitchToMode (kCGDirectMainDisplay,
CGDisplayBestModeForParameters (kCGDirectMainDisplay,
32, 1024, 768, NULL));
...to switch the screen resolution at the beginning of my app, but it just turns the screen black, the the cursor is still visible and appears pixelated as it would for 1024x768 resolution. I tried running this code at various points during my programs setup but nothing works, any idea on what might be causing this?
When you capture the display, you're preventing anything with a window level below the shielding level from displaying (and other apps from even knowing that there was a resolution change). You need to make your OpenGL context or window appear above it to see anything.
how would I do that?
Look in the docs for CGShieldingWindowLevel and NSWindow's setLevel:. You'd set the level on your borderless window.
You can get the screen's full screen CGContext using CGDisplayGetDrawingContext.
If you're using NSOpenGLContext, you can use setFullscreen.
If you're using CGL, there's CGLSetFullScreen.
There's a little more info here too: http://www.idevgames.com/forum/showthread.php?t=12762
You can get the screen's full screen CGContext using CGDisplayGetDrawingContext.
If you're using NSOpenGLContext, you can use setFullscreen.
If you're using CGL, there's CGLSetFullScreen.
There's a little more info here too: http://www.idevgames.com/forum/showthread.php?t=12762
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| DPI and Resolution for Graphics | mickyg | 9 | 6,664 |
Apr 27, 2012 03:02 PM Last Post: Andres Calil |
|
| OpenGL full screen mode leaves garbage on screen when exiting app | Malarkey | 5 | 4,462 |
Nov 19, 2008 12:51 PM Last Post: Malarkey |
|
| game image sizes and screen resolution | leRiCl | 5 | 3,831 |
Jul 2, 2008 03:31 AM Last Post: leRiCl |
|
| Changing resolution while already in full-screen mode? | Malarkey | 1 | 2,259 |
Jun 10, 2008 07:49 PM Last Post: AnotherJake |
|
| Full Screen Switching | Blacktiger | 3 | 3,012 |
Feb 9, 2008 03:05 PM Last Post: Blacktiger |
|

