============= R_CheckCvars See if some cvars that we watch have changed ============= */
| 238 | ============= |
| 239 | */ |
| 240 | static void R_CheckCvars( void ) { |
| 241 | globalImages->CheckCvars(); |
| 242 | |
| 243 | // gamma stuff |
| 244 | if ( r_gamma.IsModified() || r_brightness.IsModified() ) { |
| 245 | r_gamma.ClearModified(); |
| 246 | r_brightness.ClearModified(); |
| 247 | R_SetColorMappings(); |
| 248 | } |
| 249 | |
| 250 | if ( r_gammaInShader.IsModified() ) { |
| 251 | r_gammaInShader.ClearModified(); |
| 252 | // reload shaders so they either add or remove the code for setting gamma/brightness in shader |
| 253 | R_ReloadARBPrograms_f( idCmdArgs() ); |
| 254 | |
| 255 | if ( r_gammaInShader.GetBool() ) { |
| 256 | common->Printf( "Will apply r_gamma and r_brightness in shaders\n" ); |
| 257 | GLimp_ResetGamma(); // reset hardware gamma |
| 258 | } else { |
| 259 | common->Printf( "Will apply r_gamma and r_brightness in hardware (possibly on all screens)\n" ); |
| 260 | R_SetColorMappings(); |
| 261 | } |
| 262 | } |
| 263 | |
| 264 | if ( r_swapInterval.IsModified() ) { |
| 265 | GLimp_SetSwapInterval( r_swapInterval.GetInteger() ); |
| 266 | r_swapInterval.ClearModified(); |
| 267 | } |
| 268 | |
| 269 | if ( r_windowResizable.IsModified() ) { |
| 270 | GLimp_SetWindowResizable( r_windowResizable.GetBool() ); |
| 271 | r_windowResizable.ClearModified(); |
| 272 | } |
| 273 | } |
| 274 | |
| 275 | /* |
| 276 | ============= |
no test coverage detected