Trouble with going fullscreen
I didn't think this warranted a new topic since my problem exists in the same area.
Basically, OpenGL hates my Powerbook at the moment. Any examples of code going full screen basically doesn't work, for instance the Nehe Cocoa examples all exit with an error dialog stating "Initialization failed. Failed to initialize OpenGL" when I choose the full screen menu option. I can take the same code, run it on my tower, and it works fine. I'm sort of clueless at the moment as to what could be going wrong.
Thank you for your time and any help you can provide.
Basically, OpenGL hates my Powerbook at the moment. Any examples of code going full screen basically doesn't work, for instance the Nehe Cocoa examples all exit with an error dialog stating "Initialization failed. Failed to initialize OpenGL" when I choose the full screen menu option. I can take the same code, run it on my tower, and it works fine. I'm sort of clueless at the moment as to what could be going wrong.
Thank you for your time and any help you can provide.
Does my GameShell code (link in Fëanor's thread on similar subject) work for you?
Yes it does work. The fading is a nice change from the normal choppy resolution transitions
Now I just have to figure out why this works and the Nehe tutorials don't. Thank you.

My suspicion is that it works because it specifies which screen the fullscreen context is to work on.
The Powerbook has two screens (display and mirror) even when no external monitor is plugged in. These two screens are not compatible, so there's no way to get a pixel format which will work on both.
The GameShell code restricts fullscreen to the main display (though picking any one and only one should fix the problem).
The Powerbook has two screens (display and mirror) even when no external monitor is plugged in. These two screens are not compatible, so there's no way to get a pixel format which will work on both.
The GameShell code restricts fullscreen to the main display (though picking any one and only one should fix the problem).
Heh, arekkusu even answered the question just below my post in FĂanor's thread:
Quote:Dunno if this is your problem, but on my Powerbook I had to add this to my context creation:
... where display is figured out on the fly:Code:
NSOpenGLPFANoRecovery,
NSOpenGLPFAScreenMask,
CGDisplayIDToOpenGLDisplayMask(display),
Code:
// figure out the CGDisplayID (of the Screen containing the most of the window)
err = CGGetDisplaysWithRect(*(CGRect *)&thewindow, 1, &display, &count);
Adding those three parameters did make the Nehe stuff work full screen which is good, now I just have to see what I can do with this new knowledge. Thank you for your help.
Quote:Originally posted by skyhawk
After all this... Apple should definitely make an easy to use API for going fullscreen and resolution switching and all.
Why do most programmers not use GLUT in Cocoa for fullscreen? I've personally never tried writting an OpenGL app from the main() function, but wouldn't it be so easy for just using fullscreen and resolution setting?
Iceman
Quote:Originally posted by Iceman
Why do most programmers not use GLUT in Cocoa for fullscreen? I've personally never tried writting an OpenGL app from the main() function, but wouldn't it be so easy for just using fullscreen and resolution setting?
Iceman
we're masochist? seriously... I don't know why... Why don't we use GLUT for making us go full screen?
Too bad Apple didn't make an NSGLUTView. Then you could just drag the NSGLUTView box from the IB palettes. Call something like - (void)main; in your NSGLUTView subclass and you'd be ready for fullscreen and NSWindows.
Iceman
Iceman
Possibly Related Threads...
Thread: | Author | Replies: | Views: | Last Post | |
Trouble with fullscreen switching | codeman9 | 14 | 8,831 |
Aug 11, 2004 01:37 PM Last Post: arekkusu |