title: SDL_RenderPresent() not waiting for vsync - how to wait?
body: <p>I initialize SDL with this code:</p>
  
  <pre><code>SDL_Init(SDL_INIT_VIDEO);
  
  SDL_Window* win = SDL_CreateWindow(
      "SDL Window",
      SDL_WINDOWPOS_UNDEFINED,
      SDL_WINDOWPOS_UNDEFINED,
      WIDTH,
      HEIGHT,
      SDL_WINDOW_SHOWN
  );
  
  SDL_Renderer* ren = SDL_CreateRenderer(win, -1, SDL_RENDERER_SOFTWARE);
  SDL_GL_SetSwapInterval(1); // probably has no effect since it's not using GL
  </code></pre>
  
  <p>I then render with a non-SDL software renderer and present it to the window with this code:</p>
  
  <pre><code>SDL_UpdateTexture(screenBuffer, NULL, screenData, WIDTH*4);
  
  SDL_RenderClear(ren);
  SDL_RenderCopy(ren, screenBuffer, NULL, NULL);
  SDL_RenderPresent(ren);
  </code></pre>
  
  <p>The framerate is completely uncapped, and I have no idea why.</p>
  
  <p>Adding <code>| SDL_RENDERER_PRESENTVSYNC</code> to the SDL_CreateRenderer flags simply makes the window a blank white screen. Though I need to use the <code>SDL_RENDERER_SOFTWARE</code> flag (even though I'm not using SDL's software renderer other than to present the screen) or else will <code>SDL_RenderPresent()</code> will stall for a very, very long time resulting in about 1 frame per second.</p>
  
  <p>How can I make <code>SDL_RenderPresent()</code> wait for vsync, or wait for it (accurately) myself?</p>