You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now the idea is to always vsync on back buffer swap.
This will make any app run at the display devices (probably) fixed refresh rate.
An app that takes 1.1 frames to render will wait 0.9 frames for the next vblank causing your app to run at half of the display's refresh rate when you could be running much faster.
Refresh rates are not required to be 60hz, so you would have to measure your framerate every frame to figure out if you are running slower or faster.
I recommend letting the user trigger a draw and swap and the user running their own timer.
The triggers for draw and swap should be separate so people have the choice to use single buffered contexts (which may be making a comeback oddly).
For running your own timer I recommend timer.NewTicker().
I found it works perfectly as a frame timer with desktop gl.
For controlling whether SwapBuffers() vsync's
This simple function is available with nearly the same definition for egl/glx/wgl. https://www.khronos.org/registry/egl/sdk/docs/man/html/eglSwapInterval.xhtml
It just takes an integer >= 0 that is the number of vblanks SwapBuffers should wait for.
Something similar exists for darwin but ios looks a bit ugly.
The text was updated successfully, but these errors were encountered:
While fixing app on x11/egl and porting it to x11/glx I found some need for a redesign.
See https://go-review.googlesource.com/#/c/1851 for some discussion.
Right now the idea is to always vsync on back buffer swap.
This will make any app run at the display devices (probably) fixed refresh rate.
An app that takes 1.1 frames to render will wait 0.9 frames for the next vblank causing your app to run at half of the display's refresh rate when you could be running much faster.
Refresh rates are not required to be 60hz, so you would have to measure your framerate every frame to figure out if you are running slower or faster.
I recommend letting the user trigger a draw and swap and the user running their own timer.
The triggers for draw and swap should be separate so people have the choice to use single buffered contexts (which may be making a comeback oddly).
For running your own timer I recommend timer.NewTicker().
I found it works perfectly as a frame timer with desktop gl.
For controlling whether SwapBuffers() vsync's
This simple function is available with nearly the same definition for egl/glx/wgl.
https://www.khronos.org/registry/egl/sdk/docs/man/html/eglSwapInterval.xhtml
It just takes an integer >= 0 that is the number of vblanks SwapBuffers should wait for.
Something similar exists for darwin but ios looks a bit ugly.
The text was updated successfully, but these errors were encountered: