Skip to content

Commit

Permalink
Use a slider to allow specifying max FPS with more precision
Browse files Browse the repository at this point in the history
The minimum value was increased from 30 to 35 to reflect the lowest
value you can actually use in `vid_maxfps`. Values lower than 35
are silently clamped to 35.

The maximum value is chosen to cater to the fastest commercially
available display as of writing (500 Hz).

Being able to specify maximum FPS with a more precise slider has
several benefits:

- This adds support for monitors with less common refresh rates
  (138 Hz, 165 Hz, ...).
- This adds support for monitors with very high refresh rates
  (240 Hz or more).
- This allows catering to variable refresh rate setups with a FPS cap
  chosen to avoid V-Sync input lag, while also avoiding tearing.
  For example, choosing a FPS cap of 117 on a 120 Hz display will prevent
  the display from reaching its maximum refresh rate.
  More information: https://blurbusters.com/howto-low-lag-vsync-on/
- The value no longer displays a "Unknown" if customized in the console
  using the `vid_maxfps` cvar.
  • Loading branch information
Calinou authored and coelckers committed Jan 16, 2023
1 parent 258f4b6 commit 1c45890
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion wadsrc/static/menudef.txt
Expand Up @@ -2295,7 +2295,7 @@ OptionMenu VideoModeMenu protected

StaticText " "
Option "$DSPLYMNU_VSYNC", "vid_vsync", "OnOff"
Option "$VIDMNU_MAXFPS", "vid_maxfps", "MaxFps"
Slider "$VIDMNU_MAXFPS", "vid_maxfps", 35, 500, 1
Option "$DSPLYMNU_CAPFPS", "cl_capfps", "OffOn"

StaticText ""
Expand Down
2 changes: 1 addition & 1 deletion wadsrc/static/menudef.zsimple
Expand Up @@ -66,7 +66,7 @@ OptionMenu VideoOptionsSimple protected
Option "$GLPREFMNU_SECLIGHTMODE", gl_lightmode, "LightingModes"
StaticText " "
Option "$DSPLYMNU_VSYNC", "vid_vsync", "OnOff"
Option "$VIDMNU_MAXFPS", "vid_maxfps", "MaxFps"
Slider "$VIDMNU_MAXFPS", "vid_maxfps", 35, 500, 1
StaticText " "
Slider "$DSPLYMNU_GAMMA", "vid_gamma", 0.75, 3.0, 0.05, 2
Slider "$DSPLYMNU_BRIGHTNESS", "vid_brightness", -0.8,0.8, 0.05,2
Expand Down

1 comment on commit 1c45890

@mjr4077au
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How's the player supposed to set an unlimited framerate with a slider?

Please sign in to comment.