title: How to load Raw Pixel Bitmap on SDL?
body: <p>Currently I use bmp files for an SDL app, but I want to hide them to distribute my exe. I thought moving them as raw bytes into header files was a good way, since the BMP are very simple Black&amp;White patterns.</p>
  
  <p>Am not sure if this is possible by using SDL only, but so far I fail to load a simple pattern of bits.</p>
  
  <pre><code>// data.h    
  const unsigned char rawPixels[] =
  {
      0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,0xFF, 0xFF, 0xFF, 0xFF,0xFF, 0xFF, 0xFF, 0xFF,
  0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,0xFF, 0xFF, 0xFF, 0xFF,0xFF, 0xFF, 0xFF, 0xFF,
  };
  
  
  // main.cpp
  ...
  SDL_RWops *pixelsWop = SDL_RWFromConstMem((const unsigned char *)rawPixels, sizeof(rawPixels));
  SDL_Surface *pixelsSurface = SDL_LoadBMP_RW(pixelsWop, 1);
  SDL_BlitSurface(pixelsSurface, NULL, NULL, NULL);
  ...
  </code></pre>
  
  <p>I only get an empty surface from the SDL_LoadBMP_RW call, maybe the array should contain proper BMP header, etc. Could someone point out if that's the problem? 
  Is there another way of loading this?</p>