Full Screen Issues

Member
Posts: 269
Joined: 2005.04
Post: #1
So, if you've been following Illuminations, you know that I've been having some full screen problems. Essentially, on some computers the system freezes or locks up when switching to full screen mode. I'm just about at my wit's end here, so consider this a plea for help. Here's my full screen toggle code (removed all the error detection and what not):

Code:
- (void) toggleFullscreen
{
        CGDisplayReservationInterval        seconds = 2.0;
        CGDisplayFadeReservationToken        newToken;
        
        unsigned int                windowStyle;
        NSRect                                contentRect;

        if (isFullscreen)
        {
                CGAcquireDisplayFadeReservation(seconds, &newToken);
                CGDisplayFade(newToken, 0.3, kCGDisplayBlendNormal, kCGDisplayBlendSolidColor, 0.0, 0.0, 0.0, true);
                
                [fullscreenWindow close];
                
                [startingWindow setContentView:self];
                [startingWindow makeKeyAndOrderFront:self];
                [startingWindow makeFirstResponder:self];

                CGReleaseAllDisplays();
                
                isFullscreen = NO;
                
                CGDisplayFade(newToken, 0.5, kCGDisplayBlendSolidColor, kCGDisplayBlendNormal, 0.0, 0.0, 0.0, false);
                CGReleaseDisplayFadeReservation(newToken);
        }
        else
        {
                CGAcquireDisplayFadeReservation(seconds, &newToken);
                CGDisplayFade(newToken, 0.3, kCGDisplayBlendNormal, kCGDisplayBlendSolidColor, 0.0, 0.0, 0.0, true);
        
                CGCaptureAllDisplays();

                startingWindow = [NSApp keyWindow];
                windowStyle = NSBorderlessWindowMask;
                contentRect = [[NSScreen mainScreen] frame];
                fullscreenWindow = [[NSWindow alloc] initWithContentRect:contentRect
                        styleMask:windowStyle backing:NSBackingStoreBuffered defer:NO screen:[NSScreen mainScreen]];
                        
                [fullscreenWindow setTitle:@"Illuminations"];                
                [fullscreenWindow setReleasedWhenClosed:YES];
                [fullscreenWindow setContentView:self];
                [fullscreenWindow makeKeyAndOrderFront:self];
                [fullscreenWindow setLevel:CGShieldingWindowLevel()];
                [fullscreenWindow makeFirstResponder:self];
                        
                isFullscreen = YES;
                
                CGDisplayFade(newToken, 0.5, kCGDisplayBlendSolidColor, kCGDisplayBlendNormal, 0.0, 0.0, 0.0, false);
                CGReleaseDisplayFadeReservation(newToken);
        }
}

Basically, I have an NSOpenGLView and two windows, one regular size and one fullscreen. And I set the OGLView between them. I do it this way because it's easy, it allows me to continue to receive events like normal, and allows me to easily have a windowed mode (which is what I personally prefer).

This code works fine on all my testing machines, and only seems to lock up on ATI cards. However, it doesn't lock up on *all* ATI cards, as two of my testing machines have them and work fine. Does anyone see any problems with that code? Also, if you have an ATI card can you please try Illuminations in full screen mode (hit return) and tell me if it locks up or works fine (be sure to save any important documents first Smile ). Please post your system, video card, and when it locks up (right away, during the fade, after the fade, when returning to window mode, etc).
Quote this message in a reply
Moderator
Posts: 437
Joined: 2002.09
Post: #2
No ATi card, sorry.

For the purposes of the contest, you might consider disabling in-game switching for now, and just let them select which mode they want on an opening dialog (which you may already have, I haven't had a chance to play many of the games yet.) I think such a limitation is less obvious to a player than a hard crash. Buy yourself some time!

But hopefully someone else will know what's wrong.

Measure twice, cut once, curse three or four times.
Quote this message in a reply
Member
Posts: 114
Joined: 2005.03
Post: #3
Tried it on an iMac G5 with ATI Radeon X600XT. Crashed when I pressed enter at the screen with the advertisement for OMG Cup (went all black, had to reboot), but works well with fullscreen otherwise.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #4
9600 Pro PC & Mac Edition -- I hit return twice rather quickly, and got back to windowed mode before it hung the entire machine.
Quote this message in a reply
Member
Posts: 446
Joined: 2002.09
Post: #5
No ATI card to test here but are you sure it's hanging the *system* and not just hanging the app after capturing the screen? If you hit and hold the force-quit keys for a few seconds OS X can usually recover from these sorts of things.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #6
the GUI is completely hung.

even ssh'ing in and killing illuminations doesn't fix the problem.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Full Screen OpenGL Crashes Blacktiger 13 7,953 Feb 19, 2009 02:39 PM
Last Post: backslash
  OpenGL full screen mode leaves garbage on screen when exiting app Malarkey 5 5,358 Nov 19, 2008 12:51 PM
Last Post: Malarkey
  Changing resolution while already in full-screen mode? Malarkey 1 2,702 Jun 10, 2008 07:49 PM
Last Post: AnotherJake
  Full Screen Switching Blacktiger 3 3,662 Feb 9, 2008 03:05 PM
Last Post: Blacktiger
  Dealing with Battery Low Warning During Full Screen AnotherJake 8 5,813 Feb 8, 2008 12:26 PM
Last Post: OneSadCookie