Stuttering when running application in windowed mode

When there is motion running at 60fps with VSync on in windowed mode, there is stuttering. (Windows target)

Running the application in fullscreen keeps the motion smooth.
Why is this? What can be done to improve it?

What version of OpenFL is this?

Latest released. 4.7.3 with haxe 3.4 and hxcpp 3.4.49 on Windows 10.
This problem is not new however; its been like this for as long as i can remember.

All runs normally in fullscreen mode, but when running in window mode there is clear stutter when moving something each frame / 60fps. Have tried this on many different computers / haxe versions / OpenFL releases. Results are the always the same.

This may have to do with drivers

I think the timer resolution on Windows was recently increased, but there’s an SDL_HINT_TIMER_RESOLUTION setting that can adjust this on Windows

1 Like

This can also be a problem with Nvidia G-Sync ready gfx cards and Nvidia G-Sync aware monitors. The system manages to straighten up given some seconds of rest but it definitely shows up when the sync system is on.
Experienced this until I configured a specific combination of occasions where Nvidia G-Sync should be allowed to sync, it has options for full screen mode, full and windowed, or just windowed mode G-Sync. It was most noticeable when compiling -debug but it was there after just some seconds of rotating a particle emitter in away3D. Very weird, suppose it isn’t trivial to expose this at the Haxe level, probably would have to be a define per case at SDL lib recompilation ?

Edit 1: https://wiki.libsdl.org/SDL_HINT_TIMER_RESOLUTION?highlight=(\bCategoryDefine\b)|(CategoryHints)
Says it can be set at any time.

It says the timer resolution is a default of 1 ms, so I think the hint is mostly for lowering the resolution and reducing power use

1 Like

It seems that just by increasing the framerate from 60 to 61 fps helps quite a bit. Still not not 100% perfect but definitly better. SDL_HINT_TIMER_RESOLUTION doesnt seem to have any effect.