mirror of
https://github.com/dhewm/dhewm3.git
synced 2025-03-22 02:31:03 +00:00
Dhewm3SettingsMenu: Added VSync option
This commit is contained in:
parent
e3d67f0ac9
commit
2aaaeb1456
1 changed files with 22 additions and 0 deletions
|
@ -1599,6 +1599,28 @@ static CVarOption videoOptionsApply[] = {
|
|||
|
||||
static CVarOption videoOptionsImmediately[] = {
|
||||
CVarOption( "Options that take effect in realtime" ),
|
||||
|
||||
CVarOption( "r_swapInterval", []( idCVar& cvar ) {
|
||||
int curVsync = idMath::ClampInt( -1, 1, r_swapInterval.GetInteger() );
|
||||
if ( curVsync == -1 ) {
|
||||
curVsync = 2;
|
||||
}
|
||||
if ( ImGui::Combo( "Vertical Sync", &curVsync, "Disable VSync\0Enable VSync\0Adaptive VSync\0" ) ) {
|
||||
if ( curVsync == 2 ) {
|
||||
curVsync = -1;
|
||||
}
|
||||
if ( GLimp_SetSwapInterval( curVsync ) ) {
|
||||
r_swapInterval.SetInteger( curVsync );
|
||||
// this was just set with GLimp_SetSwapInterval(), no reason to set it again in R_CheckCvars()
|
||||
r_swapInterval.ClearModified();
|
||||
} else {
|
||||
D3::ImGuiHooks::ShowWarningOverlay( "Setting VSync (GL SwapInterval) failed, maybe try another mode" );
|
||||
}
|
||||
} else {
|
||||
AddTooltip( "r_swapInterval" );
|
||||
}
|
||||
AddDescrTooltip( "Note: Not all GPUs/drivers support Adaptive VSync" );
|
||||
} ),
|
||||
CVarOption( "image_anisotropy", []( idCVar& cvar ) {
|
||||
const char* descr = nullptr;
|
||||
if ( glConfig.maxTextureAnisotropy > 1 )
|
||||
|
|
Loading…
Reference in a new issue