title: SDL2 does not render without a delay
body: <p>This simple SDL2 program opens an empty window on my system (ie. it renders nothing) unless I uncomment the SDL_Delay line.</p>
  
  <pre><code>#include &lt;SDL.h&gt;
  
  int main(int argc, char** argv) {
  
      constexpr unsigned width = 256, height = 256;
  
      if (SDL_Init(SDL_INIT_EVERYTHING) &lt; 0) {
          SDL_Log("Failed to initialize SDL: %s", SDL_GetError());
          return 1;
      }
  
      SDL_Window* window = SDL_CreateWindow("Test",
                                            SDL_WINDOWPOS_UNDEFINED,
                                            SDL_WINDOWPOS_UNDEFINED,
                                            width, height,
                                            0);
      SDL_Renderer* renderer = SDL_CreateRenderer(window, -1, 0);
  
      SDL_SetRenderDrawColor(renderer, 0, 0, 255, 255);
      SDL_RenderClear(renderer);
      // SDL_Delay(20);
      SDL_RenderPresent(renderer);
  
      bool quit{};
      SDL_Event event;
      while (!quit) {
          SDL_WaitEvent(&amp;event);
  
          switch (event.type) {
          case SDL_QUIT:
              quit = true;
              break;
          }
      }
  
      SDL_Quit();
  
      return 0;
  }
  </code></pre>
  
  <p>The delay has to be about 10-20ms or nothing shows up, but it's not consistent - if it's set to 10ms, it works about half of the time.</p>
  
  <p>After reading <a href="https://stackoverflow.com/questions/29332155/sample-sdl-program-gives-an-empty-window">this answer</a> I added the event loop, but I get the same behavior without it. Users on <code>#sdl</code> on IRC have gotten the expected blue screen from the same code.</p>
  
  <p>Any idea what's going on here/what I've done wrong?</p>