Trouble with going fullscreen

SicherLem
Unregistered
 
Post: #16
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.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #17
Does my GameShell code (link in Fëanor's thread on similar subject) work for you?
Quote this message in a reply
SicherLem
Unregistered
 
Post: #18
Yes it does work. The fading is a nice change from the normal choppy resolution transitionsSmile Now I just have to figure out why this works and the Nehe tutorials don't. Thank you.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #19
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).
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #20
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:
Code:
NSOpenGLPFANoRecovery,
            NSOpenGLPFAScreenMask,
            CGDisplayIDToOpenGLDisplayMask(display),
... where display is figured out on the fly:
Code:
// figure out the CGDisplayID (of the Screen containing the most of the window)
    err = CGGetDisplaysWithRect(*(CGRect *)&thewindow, 1, &display, &count);
Quote this message in a reply
SicherLem
Unregistered
 
Post: #21
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 this message in a reply
Member
Posts: 196
Joined: 2002.04
Post: #22
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 this message in a reply
Moderator
Posts: 916
Joined: 2002.10
Post: #23
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?
Quote this message in a reply
Member
Posts: 196
Joined: 2002.04
Post: #24
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
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Trouble with fullscreen switching codeman9 14 5,599 Aug 11, 2004 01:37 PM
Last Post: arekkusu