title: SDL bit depth conversion
body: <p>I'm beating my way through a 1.2->2.0 conversion, one problem at a time. So far I have sound, interaction and a screen that shows... well, something.</p>
  
  <p>I'm sure the problem is due to bit depth and/or formats. The original code used 8-bit <em>indexed</em> SPR files for the sprites, loaded them into a series of <code>uint8 *buffu</code>, and then blitted them to the display's Surface.</p>
  
  <p>I have ported this, following the guide and significant trial-and-error (lots of modes and switches simply don't work on my machine), by creating a Texture and a Surface, letting the old code blit into the Surface, and then do this...</p>
  
  <pre><code>SDL_UpdateTexture(sdltxtr, NULL, sdlsurf-&gt;pixels, 640 * sizeof (uint8));
  SDL_RenderClear(sdlrend);
  SDL_RenderCopy(sdlrend, sdltxtr, NULL, NULL);
  SDL_RenderPresent(sdlrend);
  </code></pre>
  
  <p>The result is a screen with stuff, but it's all misaligned. I assume that is because the Surface and Texture have different bit depths and formats than the sprites...</p>
  
  <pre><code>sdltxtr = SDL_CreateTexture(sdlrend,
                              SDL_PIXELFORMAT_ARGB8888,
                              SDL_TEXTUREACCESS_STREAMING,
                              640, 480);
  sdlsurf = SDL_CreateRGBSurface(0, 640, 480, 8, 0,0,0,0);
  </code></pre>
  
  <p>I've tried various settings from the documentation to try to get a surface or texture that's 8-bit indexed, but all of the flags cause the Surface or Texture to be empty.</p>
  
  <p>Any suggestions?</p>