Fullscreen code rocks!

The fullscreen code is awesome! :slight_smile:
http://www.devolution.com/~slouken/SDL/cvs.html

I added two new functions: SDL_WM_GrabInput() and SDL_WM_IconifyWindow(),

testwm now has three new keybindings:
Ctrl-G : Grab the mouse and keyboard to the SDL window
Ctrl-Z : Iconify the window
Escape : Post a quit message

SDL has a new internal keybinding, ALT-Enter, which toggles fullscreen mode.

Stephane and Ryan helped me bang on it and make it phule proof! :slight_smile:

This is currently implemented only on Linux, with other platforms easily
done:

/*

  • This function iconifies the window, and returns 1 if it succeeded.
  • If the function succeeds, it generates an SDL_APPACTIVE loss event.
  • This function is a noop and returns 0 in non-windowed environments.
    */
    extern DECLSPEC int SDL_WM_IconifyWindow(void);

/*

  • This function allows you to set and query the input grab state of
  • the application. It returns the new input grab state.
    /
    typedef enum {
    SDL_GRAB_QUERY = -1,
    SDL_GRAB_OFF = 0,
    SDL_GRAB_ON = 1
    } SDL_GrabMode;
    /
  • Grabbing means that the mouse is confined to the application window,
  • and nearly all keyboard input is passed directly to the application,
  • and not interpreted by a window manager, if any.
    */
    SDL_GrabMode SDL_WM_GrabInput(SDL_GrabMode mode);

Enjoy!
-Sam Lantinga (slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec

The fullscreen code is awesome! :slight_smile:
http://www.devolution.com/~slouken/SDL/cvs.html

Do you ever sleep? OK, you’re feeling inspired, let me run past you the
errors I found on my machine (P/200, running GNU WindowMaker, Slackware 7):

  • the new testgl doesn’t seem to be handling perspective quite right.
  • testalpha has wierd problems under fullscreen mode. The mouse doesn’t drag
    properly, and you see wierd rectangular holes in the blitting areas.

Are these dealt with in this new CVS tree, or did I just install the wrong
one?

-Sam Lantinga (slouken at devolution.com)

Nicholas

----- Original Message -----
From: slouken@devolution.com (Sam Lantinga)
To: sdl at lokigames.com
Date: Thursday, January 13, 2000 11:02 PM
Subject: [SDL] Fullscreen code rocks!

I know! IT ROCKS!! Before with DGA mode it never looked right for me, but
now it is perfect!!!On Thu, 13 Jan 2000, Sam Lantinga wrote:

The fullscreen code is awesome! :slight_smile:
http://www.devolution.com/~slouken/SDL/cvs.html

I added two new functions: SDL_WM_GrabInput() and SDL_WM_IconifyWindow(),

testwm now has three new keybindings:
Ctrl-G : Grab the mouse and keyboard to the SDL window
Ctrl-Z : Iconify the window
Escape : Post a quit message

SDL has a new internal keybinding, ALT-Enter, which toggles fullscreen mode.

Stephane and Ryan helped me bang on it and make it phule proof! :slight_smile:

This is currently implemented only on Linux, with other platforms easily
done:

/*

  • This function iconifies the window, and returns 1 if it succeeded.
  • If the function succeeds, it generates an SDL_APPACTIVE loss event.
  • This function is a noop and returns 0 in non-windowed environments.
    */
    extern DECLSPEC int SDL_WM_IconifyWindow(void);

/*

  • This function allows you to set and query the input grab state of
  • the application. It returns the new input grab state.
    /
    typedef enum {
    SDL_GRAB_QUERY = -1,
    SDL_GRAB_OFF = 0,
    SDL_GRAB_ON = 1
    } SDL_GrabMode;
    /
  • Grabbing means that the mouse is confined to the application window,
  • and nearly all keyboard input is passed directly to the application,
  • and not interpreted by a window manager, if any.
    */
    SDL_GrabMode SDL_WM_GrabInput(SDL_GrabMode mode);

Enjoy!
-Sam Lantinga (slouken at devolution.com)

Lead Programmer, Loki Entertainment Software

“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec

Do you ever sleep? OK, you’re feeling inspired, let me run past you the
errors I found on my machine (P/200, running GNU WindowMaker, Slackware 7):

  • the new testgl doesn’t seem to be handling perspective quite right.
  • testalpha has wierd problems under fullscreen mode. The mouse doesn’t drag
    properly, and you see wierd rectangular holes in the blitting areas.

Are these dealt with in this new CVS tree, or did I just install the wrong
one?

Did you grab the version I posted last night?
The code on the CVS web page should be completely current, and it sounds
like you are using code from several days ago.

-Sam Lantinga				(slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec