timerglfwperiodicity

Time model for glfwSwapBuffers


This function sets the swap interval for the current context, i.e. the number of screen updates to wait before swapping the buffers of a window and returning from glfwSwapBuffers. This is sometimes called 'vertical synchronization', 'vertical retrace synchronization' or 'vsync'.

Does this mean

 ----------------------------------
 Generate next frame
 Wait until next frame is available
 ----------------------------------

that is, the period of the loop is independent on the computation task or

 ----------------------------------
 Generate next frame
 Wait for 1/refresh_rate time units
 ----------------------------------

that is, the delay is added as extra time to perform the loop.


Solution

  • The fist one is correct. There is no fixed size delay.