title: Drawing a rectangle with SDL2
body: <p>I just started using SDL2 and I already have a problem.
  I want to create a window and paint it in red.
  But it remains white, and I don't understand why.</p>
  
  <p>Here is the code :</p>
  
  <pre><code>int main (int argc, char** argv) {
      SDL_Window* pWindow = NULL;
      pWindow = SDL_CreateWindow("Jeu de la vie", SDL_WINDOWPOS_UNDEFINED,
          SDL_WINDOWPOS_UNDEFINED,
          640,
          480,
          SDL_WINDOW_SHOWN);
  
      SDL_Surface* pSurface = NULL;
      pSurface = SDL_GetWindowSurface(pWindow);
      SDL_FillRect(pSurface, NULL, SDL_MapRGB(pSurface-&gt;format, 255, 0, 0));
  
      while(1);
  
      SDL_FreeSurface(pSurface);
      SDL_DestroyWindow(pWindow);
      SDL_Quit();
      return EXIT_SUCCESS;
  }
  </code></pre>