| Home
| Previous
| Next
| Up

GM_setModeSwitchFunc

Sets the mode switch callback function

Declaration

void MGLAPI GM_setModeSwitchFunc(
GM_modeSwitchFunc func)
typedef void (*GM_modeSwitchFunc)(
GM_modeInfo *mode,
ibool windowed)

Prototype In

gm/gm.h

Parameters

func | Mode switch callback function to register

Description

This function sets the mode switch callback function for your Game Framework game and is called by the Game Framework when automatically switching on the fly between windowed and fullscreen modes. By default this handler is set to NULL, and unless you call this function support for switching on the fly between windowed and fullscreen modes is disabled. By default the Game Framework contains code to provide two methods of switching to fullscreen modes when running in windowed modes:

1 | When the user hits the Alt-Enter key combination
2 | When the user clicks the Maximise button on the games title bar

Likewise when the game is running in a fullscreen mode and the user hits the Alt-Enter key, the video mode will automatically be switched to windowed mode. In order to support auto-switching between fullscreen and windowed modes, all the MGL device contexts will be destroyed and re-created during the switch, so you will have to include other code to re-initialize the MGL to the state that the game is currently in (ie: setting the color palette etc.) in your mode switch callback. You will also need to code your game in such as way that it can handle dynamic resolution changes on the fly.

See Also

GM_init, GM_setMode

Copyright © 2002 SciTech Software, Inc. Visit our web site at http://www.scitechsoft.com