title: SDL/OpenGL game runs too fast on 144Hz screen; can't use vsync
body: <p>This is how I handle the game loop:</p>
  
  <pre><code>while (running) {
      diff = duration_cast&lt;milliseconds&gt;(end - start).count();
      start = clock::now();
  
      dt = diff / (16.0);
  
      handleInput(); // get input
      update(dt); // game logic
      render(); // render game
  
      SDL_GL_SwapWindow(window); // swap frame buffer
  
      end = clock::now();
  }
  </code></pre>
  
  <p>It is intended to be a fixed timestep game locked to 60FPS (it's a re-made emulation of an SNES game) however it runs on 144 timestep on my 144hz screen, making it far too fast. Vsync can't solve this, so what can?</p>