From 4d92467e7cfc4e561d6f29d4635c524c5fff3844 Mon Sep 17 00:00:00 2001 From: Adam Olsen Date: Thu, 16 Aug 2001 03:36:40 +0000 Subject: [PATCH] Make SDL support vid_fullscreen toggling too --- libs/video/targets/vid_sdl.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/libs/video/targets/vid_sdl.c b/libs/video/targets/vid_sdl.c index 0305e03de..57246d700 100644 --- a/libs/video/targets/vid_sdl.c +++ b/libs/video/targets/vid_sdl.c @@ -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");