Windows key crashes fullscreen app

Hello,

Im creating my program to be able to be ran in windowed or fullscreen mode. Windowed mode works fine, and so does fullscreen. However, if the program is running in fullscreen mode and the user hits the windows key or tries to alt-tab (Etc), my program crashes. Ive tried surfing the net and through the sdl website, but without any advice on how to handle this situation. I couldnt find any SDL event that I can detect and know not to try and draw anything. How should I handle this situation?

Thanks,

  • Jeremiah

Are you respecting the return value of SDL_LockSurface()?

http://sdldoc.csn.ul.ie/sdllocksurface.phpOn Sunday 25 January 2004 17:27, Martell, Jeremiah wrote:

Hello,

Im creating my program to be able to be ran in windowed or fullscreen
mode. Windowed mode works fine, and so does fullscreen. However, if the
program is running in fullscreen mode and the user hits the windows key or
tries to alt-tab (Etc), my program crashes. Ive tried surfing the net and
through the sdl website, but without any advice on how to handle this
situation. I couldnt find any SDL event that I can detect and know not to
try and draw anything. How should I handle this situation?

Thanks,

  • Jeremiah

Martell, Jeremiah wrote:

Hello,

Im creating my program to be able to be ran in windowed or
fullscreen mode. Windowed mode works fine, and so does fullscreen.
However, if the program is running in fullscreen mode and the user
hits the windows key or tries to alt-tab (Etc), my program crashes.
Ive tried surfing the net and through the sdl website, but without any
advice on how to handle this situation. I couldnt find any SDL event
that I can detect and know not to try and draw anything. How should I
handle this situation?

Thanks,

  • Jeremiah

Look at the doc for SDL_BlitSurface :
http://sdldoc.csn.ul.ie/sdlblitsurface.php
and notice the special “-2” return value that happens “under DirectX 5.0
when the system switches away from your fullscreen application” :slight_smile:

Stephane

I use SDL + OpenGL and can say that nothing wrong happens when I switch
from full screen, ATL-TAB it or use Windows Key. It is a perfect
combination and I strongly suggest to others…

cheers,
Bruce

Stephane Marchesin wrote:> Martell, Jeremiah wrote:

Hello,

Im creating my program to be able to be ran in windowed or
fullscreen mode. Windowed mode works fine, and so does fullscreen.
However, if the program is running in fullscreen mode and the user
hits the windows key or tries to alt-tab (Etc), my program crashes.
Ive tried surfing the net and through the sdl website, but without
any advice on how to handle this situation. I couldnt find any SDL
event that I can detect and know not to try and draw anything. How
should I handle this situation?

Thanks,

  • Jeremiah

Look at the doc for SDL_BlitSurface :
http://sdldoc.csn.ul.ie/sdlblitsurface.php
and notice the special “-2” return value that happens “under DirectX
5.0 when the system switches away from your fullscreen application” :slight_smile:

Stephane


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

That solved the problem of the program crashing. I just dont draw unless SDL_LockSurface() returns successful. However, when the computer goes to windows, the computer acts a little screwy. That means the mouse cursor jumps to the upper left hand of the screen sometimes when i try to click an application in the task bar, and i cant minimize/maximize programs all the time. Any idea of why this might be happening?

Thanks,

  • Jeremiah-----Original Message-----
    From: sdl-admin at libsdl.org on behalf of xodnizel
    Sent: Sun 1/25/2004 6:37 PM
    To: sdl at libsdl.org
    Cc:
    Subject: Re: [SDL] windows key crashes fullscreen app

    Are you respecting the return value of SDL_LockSurface()?

    http://sdldoc.csn.ul.ie/sdllocksurface.php

    On Sunday 25 January 2004 17:27, Martell, Jeremiah wrote:

    Hello,

    Im creating my program to be able to be ran in windowed or fullscreen
    mode. Windowed mode works fine, and so does fullscreen. However, if the
    program is running in fullscreen mode and the user hits the windows key or
    tries to alt-tab (Etc), my program crashes. Ive tried surfing the net and
    through the sdl website, but without any advice on how to handle this
    situation. I couldnt find any SDL event that I can detect and know not to
    try and draw anything. How should I handle this situation?

    Thanks,

    • Jeremiah

    SDL mailing list
    SDL at libsdl.org
    http://www.libsdl.org/mailman/listinfo/sdl

-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/ms-tnef
Size: 4970 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20040126/0721f121/attachment.bin