title: An Error with SDL_CeateWindow appearing when program started
body: <p>The code below initializes an SDL window. Because of bug I can't find <code>SDL_CreateWindow()</code> returns <code>NULL</code>.</p>
  
  <pre class="lang-c prettyprint-override"><code>int xwin_init(int w, int h)
  {
      int r;
      r = SDL_Init(SDL_INIT_VIDEO);
      assert(win == NULL);
      win = SDL_CreateWindow("PRG Semester Project",SDL_WINDOWPOS_UNDEFINED,SDL_WINDOWPOS_UNDEFINED, w, h,SDL_WINDOW_SHOWN);
      SDL_SetWindowTitle(win, "PRG SEM");
      SDL_Surface *surface = SDL_CreateRGBSurfaceFrom(icon_32x32_bits,32, 32, 24, 32*3, 0xff, 0xff00,0xff0000, 0x0000);
      SDL_SetWindowIcon(win, surface);
      SDL_FreeSurface(surface);
      return r;
  }
  </code></pre>
  
  <p>The error message looks like this:</p>
  
  <pre class="lang-none prettyprint-override"><code>prgsem: xwin_sdl.c:58: xwin_init: Assertion win != NULL' failed`
  </code></pre>