nehe tutorials - fullscreen

Michael
Unregistered
 
Post: #1
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
Quote this message in a reply
Moderator
Posts: 3,577
Joined: 2003.06
Post: #2
All the Cocoa NeHe code I've run across is broken for switching into fullscreen.
Quote this message in a reply
Moderator
Posts: 3,577
Joined: 2003.06
Post: #3
Here's the fix:
Code:
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.
Quote this message in a reply
Sage
Posts: 1,232
Joined: 2002.10
Post: #4
*cough*
Quote this message in a reply
Moderator
Posts: 3,577
Joined: 2003.06
Post: #5
How funny! That sure looks an aweful lot like *my* fix. Well at least I beat you to it this time. LOL
Quote this message in a reply
Michael
Unregistered
 
Post: #6
Thanks!

Michael
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Errors With NeHe OpenGL Guide SamGray 1 2,789 Sep 6, 2009 02:36 PM
Last Post: AnotherJake
  NeHe revival? Duane 20 8,242 Jul 11, 2007 09:57 AM
Last Post: AnotherJake
  NeHe example djohnson 4 3,143 Jan 30, 2004 01:58 PM
Last Post: Sohta
  NeHe and OpenGL Inconsistencies Justin Brimm 4 3,628 Jul 11, 2003 08:18 AM
Last Post: Feanor