Repository: libgdx/libgdx

Issue #5826: Lwjgl3 FPS oddities
Created: 2019-10-31T02:30:06Z
Issue Details
I'm using the LWJGL3 backend.
Previously, when using the LWJGL2 backend, I experienced similar experiences to #1386  and #3405. However, when in fullscreen, these issues would go away and I'd have a beautiful, smooth game. This was a constant bug over the course of time.
One of the above issues suggests moving to the LWJGL 3 backend. So I did, and have been testing it over the past week.
Instead of the odd stuttering, this time around I have FPS / delta time that goes wild, and stays below 60fps, even though my computer (a recent, expensive gaming laptop) is more than capable of hitting 60 fps. It's not only my game doing this, though, it seems all the LWJGL3 games running on my machine experience the same issue. HOWEVER, once again, in fullscreen, the issue doesn't exist at all, for all the games I've tried.
Here's an interesting gif showing some stats
https://i.imgur.com/9y9e1ZT.gifv
And another of someone else's game in LWJGL3 (same game in lwjgl2 gets smooth 60fps)
https://i.imgur.com/ftbOJ1R.gifv
Here is another of a LWJGL2 game, which shows the normal, expected behaviour
https://i.imgur.com/U0QzL5t.gifv
Here's a paste of a bit of deltaTime printout to show the variation
https://pastebin.com/tcxvSt5k
And heres the same printing out of deltaTime in fullscreen:
https://pastebin.com/eFiF3J51
When in fullscreen with vsync disabled and fps unlimited, I get over 2400 FPS, which is just something to show that my machine is more than capable of 60fps windowed.
We have tried vsync on, vsync off, Display.sync stuff from lwjgl2, manually setting vsync, profiling, and other countless efforts.
Is there any information you could possibly supply me on this topic?
Expected results
A smooth, consistent FPS in the range of 58-62
Version of LibGDX
1.9.11-SNAPSHOT, LWJGL3 backend
Platforms tested on
Windows
Yes i have the latest drivers.

Duplicate issue #4274: LWJGL 3 backend V-Sync problem on desktop
Created: 2016-08-27T02:20:08Z
All my monitors work on 60 hz:
Issue details

If I use LWJGL 3.0, 3.1, coded V-Sync ON (and forced V-Sync on Radeon Drivers), I get 30 FPS (windowed mode).
If I use LWJGL 3.0, 3.1, coded V-Sync ON (and DISABLED V-Sync on Radeon Drivers), I get 60 FPS (windowed mode).
If I use LWJGL 2.x, coded V-Sync ON (and forced V-Sync on Radeon Drivers), I get 60 FPS (windowed mode) as expected on my monitor Hz.
If I use LWJGL 2.x, coded V-Sync ON (and DISABLED V-Sync on Radeon Drivers), I get 60 FPS (windowed mode)

Expected results
I should always get 60 FPS as my monitor expect, instead of 30.
Version of LibGDX and/or relevant dependencies
libGDX 1.9.4, 1.9.5, 1.9.6, 1.9.7-SNAPSHOT
Please select the affected platforms

 Android
 iOS (robovm)
 iOS (MOE)
 HTML/GWT
 Windows
 Linux
 MacOS

Windows 10 + AMD + Forced v-sync on drivers = 30 FPS problem appear.
Windows 10 + NVIDIA + Forced v-sync on drivers = 60 FPS.
Ubuntu 17.10 + NVIDIA+ Forced v-sync on drivers = 60 FPS.
My general PC specs: Windows 10 pro 64 bits. AMD FX-8350 8cores@4Ghz, motherboard Gigabyte GA-970A-DS3P, 16Gb ram, AMD Radeon R9 280x, SSD 840 EVO 500Gb.
NOTE: Using latest drivers on all PC up today.

Closing comment (2020-09-02T01:12:56Z): #6150 is not related to multi-windows, that is just the reason why the fix proposed there doesn't work.
The issue reported in #5826 was that after enabling fullscreen mode on windows, the vsync setting would be ignored.