Make SDL support vid_fullscreen toggling too

This commit is contained in:
Adam Olsen 2001-08-16 03:36:40 +00:00
parent 9ee3450265
commit 4d92467e7c

View file

@ -145,11 +145,22 @@ VID_Init (unsigned char *palette)
}
void
VID_UpdateFullscreen (cvar_t *vid_fullscreen)
{
if (!vid.initialized)
return;
if ((vid_fullscreen->int_val && !(screen->flags & SDL_FULLSCREEN))
|| (!vid_fullscreen->int_val && screen->flags & SDL_FULLSCREEN))
if (!SDL_WM_ToggleFullScreen (screen))
Con_Printf ("VID_UpdateFullscreen: error setting fullscreen\n");
}
void
VID_Init_Cvars ()
{
vid_fullscreen =
Cvar_Get ("vid_fullscreen", "0", CVAR_ROM, NULL,
Cvar_Get ("vid_fullscreen", "0", CVAR_NONE, VID_UpdateFullscreen,
"Toggles fullscreen game mode");
vid_system_gamma = Cvar_Get ("vid_system_gamma", "1", CVAR_ARCHIVE, NULL,
"Use system gamma control if available");