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.
In most situations, you want vsync to have fluid and responsive animations and to avoid screen tearing.
It's a must-gave for a game and that's why it feels wrong not to have it in the common set of application function (imo).
I've added vsync support to nanogui to make it as easy to use as possible while keeping the code as similar as possible and avoiding branching out two mainloop() functions.
Intended usage:
Also contains a small addition to nanogui Screen which updates the currently displayed cursor. This is in place to solve a bug where a widget dynamically changes its cursor , but nanogui does not update it, because it only changes the cursor on mouse move.
Same thing happens when a widget position or size changes such that the widget under the cursor is not the same anymore.
Code is probably not formatted correctly as there is no clang_format or similar that I could use