View Full Version : nehe tutorials - fullscreen
Michael
2004.10.27, 11:44 AM
when trying any of the nehe cocoa tutorials, I can build and run, however when trying fullscreen mode I get the message "Failed to initialize OpenGL" and crash.
Any ideas or suggestions?
I'm using Xcode 1.5, Panther, on G4 AlBook 1Ghz (64mb vram)
Michael
AnotherJake
2004.10.27, 01:20 PM
All the Cocoa NeHe code I've run across is broken for switching into fullscreen.
AnotherJake
2004.10.27, 01:39 PM
Here's the fix:
if( runningFullScreen ) // Do this before getting the pixel format
{
// ****add these two lines to fix fullscreen bug
pixelAttribs[pixNum++] = NSOpenGLPFAScreenMask;
pixelAttribs[pixNum++] = CGDisplayIDToOpenGLDisplayMask( kCGDirectMainDisplay );
pixelAttribs[ pixNum++ ] = NSOpenGLPFAFullScreen;
fullScreenMode = (NSDictionary *) CGDisplayBestModeForParameters(
kCGDirectMainDisplay,
colorBits, frame.size.width,
frame.size.height, NULL );
CGDisplayCapture( kCGDirectMainDisplay );
CGDisplayHideCursor( kCGDirectMainDisplay );
CGDisplaySwitchToMode( kCGDirectMainDisplay,
(CFDictionaryRef) fullScreenMode );
}
Oh, I should note this is under
- (NSOpenGLPixelFormat *) createPixelFormat: (NSRect)frame
in the Lesson**View.m file.
arekkusu
2004.10.27, 05:09 PM
*cough (http://www.opengl.org/discussion_boards/cgi_directory/ultimatebb.cgi?ubb=get_topic;f=5;t=000499)*
AnotherJake
2004.10.27, 05:56 PM
How funny! That sure looks an aweful lot like *my* fix. Well at least I beat you to it this time. :lol:
Michael
2004.10.28, 12:08 PM
Thanks!
Michael
vBulletin® v3.6.8, Copyright ©2000-2008, Jelsoft Enterprises Ltd.