Add VSync and Max Framerate options#1077
Open
Kamenkovic wants to merge 4 commits intosmartcmd:mainfrom
Open
Conversation
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
Adds a Max Framerate(Fps Cap) and VSync options.
Changes
Previous Behavior
There wasn't a Max Framerate or VSync option, and VSync was always turned on.
Root Cause
Though the graphics menu was lacking options.
Also encountered an issue where running in fullscreen with VSync on caused FPS to drop from ~1000 to 20-30, making the game unplayable (But i havent seen anyone else have the same issue). So that why i added VSync option.
Showcase.mp4
New Behavior
Now there are Max Framerate and VSync options in graphics menu, VSync option is a tick box and Max Framerate is a slider(options are 30-60-120-Unlimited).
Fix Implementation
Windows64_Minecraft.cpp now tracks frame time with QueryPerformanceCounter. It sleeps until the next frame is due, based on the selected FPS cap. The sync interval given to g_pSwapChain->Present is now controlled by the VSync setting.
AI Use Disclosure
Used for finding problems in the output.
Related Issues