/* ============ VID_CheckChanges This function gets called once just before drawing each frame, and it's sole purpose in life is to check to see if any of the video mode parameters have changed, and if they have to update the rendering DLL and/or video mode to match. ============ */ void VID_CheckChanges (void) { if ( win_noalttab->modified ) { if ( win_noalttab->value ) { WIN_DisableAltTab(); } else { WIN_EnableAltTab(); } win_noalttab->modified = false; } if ( vid_ref_modified /*vid_ref->modified*/ ) { cl.force_refdef = true; // can't use a paused refdef S_StopAllSounds(); } while ( vid_ref_modified /*vid_ref->modified*/ ) { /* ** refresh has changed */ vid_ref_modified = false; /*vid_ref->modified = false;*/ vid_fullscreen->modified = true; cl.refresh_prepped = false; cls.disable_screen = true; if ( !VID_LoadRefresh() ) { /* ** drop the console if we fail to load a refresh */ if ( cls.key_dest != key_console ) { Con_ToggleConsole_f(); } } cls.disable_screen = false; } /* ** update our window position */ if ( vid_xpos->modified || vid_ypos->modified ) { if (!vid_fullscreen->value) VID_UpdateWindowPosAndSize( vid_xpos->value, vid_ypos->value ); vid_xpos->modified = false; vid_ypos->modified = false; } }
/* ============ VID_CheckChanges This function gets called once just before drawing each frame, and it's sole purpose in life is to check to see if any of the video mode parameters have changed, and if they have to update the rendering DLL and/or video mode to match. ============ */ void VID_CheckChanges (void) { char name[100]; if ( win_noalttab->modified ) { if ( win_noalttab->value ) { WIN_DisableAltTab(); } else { WIN_EnableAltTab(); } win_noalttab->modified = 0; } if ( vid_ref->modified ) { cl.force_refdef = 1; // can't use a paused refdef S_StopAllSounds(); Cam_Reset_f (); // NeVo - reset the camera } while (vid_ref->modified) { /* ** refresh has changed */ vid_ref->modified = 0; vid_fullscreen->modified = 1; cl.refresh_prepped = 0; cls.disable_screen = 1; Com_sprintf( name, sizeof(name), "ref_%s.dll", vid_ref->string ); if ( !VID_LoadRefresh( name ) ) { if ( strcmp (vid_ref->string, "soft") == 0 ) Com_Error (ERR_FATAL, "Couldn't fall back to software refresh!"); Cvar_Set( "vid_ref", "soft" ); /* ** drop the console if we fail to load a refresh */ if ( cls.key_dest != key_console ) { Con_ToggleConsole_f(); } } cls.disable_screen = 0; } /* ** update our window position */ if ( vid_xpos->modified || vid_ypos->modified ) { if (!vid_fullscreen->value) VID_UpdateWindowPosAndSize( vid_xpos->value, vid_ypos->value ); vid_xpos->modified = 0; vid_ypos->modified = 0; } }
void VID_CheckChanges (void) { char name[100]; if (win_noalttab->modified) { if (win_noalttab->value) WIN_DisableAltTab(); else WIN_EnableAltTab(); win_noalttab->modified = false; } if (vid_ref->modified) { cl.force_refdef = true; // can't use a paused refdef S_StopAllSounds(); } while (vid_ref->modified) { char driverstring[32]; // jit cvar_t *gl_driver; // jit gl_driver = Cvar_Get("gl_driver", "opengl32", CVAR_ARCHIVE); // jit Com_sprintf(driverstring, sizeof(driverstring), "%s", gl_driver->string); Cvar_Get("gl_swapinterval", "0", CVAR_ARCHIVE)->modified = true; // jit /* ** refresh has changed, jitodo, cheatcheck! */ vid_ref->modified = false; vid_fullscreen->modified = true; cl.refresh_prepped = false; cls.disable_screen = true; // jit -- only allow opengl32 or 3dfxgl: if (!Q_streq(gl_driver->string, "opengl32") && !Q_streq(gl_driver->string, "3dfxgl")) Cvar_Set("gl_driver", "opengl32"); // Com_sprintf(name, sizeof(name), "ref_%s.dll", vid_ref->string ); Com_sprintf(name, sizeof(name), "ref_pbgl.dll"); // jit if (!VID_LoadRefresh(name)) { // jit3dfx - check if driver string changed: if (!Q_streq(gl_driver->string, driverstring)) { vid_ref->modified = true; Q_strncpyz(driverstring, gl_driver->string, sizeof(driverstring)); } if (!vid_ref->modified) // jit Com_Error(ERR_FATAL, "Unable to load OpenGL refresh!"); // jit // drop the console if we fail to load a refresh if (cls.key_dest != key_console) Con_ToggleConsole_f(); } if (!vid_ref->modified) // jit3dfx { cls.disable_screen = false; CL_InitImages(); M_ReloadMenu(); // jitmenu (need to do a full reload beacuse pic indexes can change) } } /* ** update our window position */ if ( vid_xpos->modified || vid_ypos->modified ) { if (!vid_fullscreen->value) VID_UpdateWindowPosAndSize( vid_xpos->value, vid_ypos->value ); vid_xpos->modified = false; vid_ypos->modified = false; } }