title: SDL doesn't draw image
body: <p>This is my main.cpp</p>
  
  <pre><code>#include &lt;cstdlib&gt;
  #include &lt;iostream&gt;
  
  #include "Sprite.h"
  #include &lt;SDL/SDL.h&gt;
  #include &lt;SDL/SDL_ttf.h&gt;
  #include "SDL/SDL_mixer.h"
  
  #undef main
  
  SDL_Surface* m_pScreen;
  SDL_Surface* bg_image;
  
  int main(int argc, char* argv[]){
  
          SDL_Event evt;
          bool p_running = true;
  
          // initialize SDL
          SDL_Init(SDL_INIT_EVERYTHING);
          SDL_EnableUNICODE( SDL_ENABLE );
          TTF_Init();
  
          // set the title bar text
          SDL_WM_SetCaption("test1", NULL);
  
          // create the screen surface
          m_pScreen = SDL_SetVideoMode(500, 400, 32, SDL_DOUBLEBUF);
  
          bg_image = NULL;
  
          bg_image = Sprite::Load("images/bg.png");
  
          Sprite::Draw(m_pScreen, bg_image, 0, 0);
  
  
          while(p_running)
          {
            SDL_WaitEvent(&amp;evt);
            if(evt.type == SDL_QUIT)
              p_running = false;
          }
  
          SDL_Quit();
  
         system("pause");
         return 0;
  
  }
  </code></pre>
  
  <p>Sprite.h:</p>
  
  <pre><code>#ifndef  _SPRITE_H_
  #define _SPRITE_H_
  
  #include &lt;SDL/SDL.h&gt;
  #include &lt;SDL/SDL_image.h&gt;
  
  class Sprite
  {
      public:
  
               Sprite();
  
               static SDL_Surface* Load(char* pFile);
  
               static bool Draw( SDL_Surface* dest, SDL_Surface* src, int x, int y );
  
               static bool Draw( SDL_Surface* dest, SDL_Surface* src, int x, int y, int x2,
                int y2, int width, int height );
  };
  
  
  
  // constructor
  Sprite::Sprite() {}
  
  SDL_Surface* Sprite::Load( char* File )
  {
      SDL_Surface* temp = NULL;
      SDL_Surface* optimized = NULL;
  
      if(( temp = IMG_Load(File)) == NULL )
      {
            return NULL;
      }
  
      optimized = SDL_DisplayFormatAlpha(temp);
  
      SDL_FreeSurface(temp);
  
      //Uint32 colorkey = SDL_MapRGB( optimized-&gt;format, 0xFF, 0x80, 0xC0 );//0xFF, 0x04, 0xC1 );
      //SDL_SetColorKey( optimized, SDL_RLEACCEL | SDL_SRCCOLORKEY, colorkey );
  
      return optimized;
  }
  
  bool Sprite::Draw( SDL_Surface* dest, SDL_Surface* src, int x, int y )
  {
        if(dest == NULL || src == NULL)
         {
                    return false;
         }
  
         SDL_Rect  destR;
  
         destR.x = x;
         destR.y = y;
  
         SDL_BlitSurface(src, NULL, dest, &amp;destR);
  
          return true;
  }
  
  
  
  
  #endif
  </code></pre>
  
  <p>I have created a folder named images and inside i ahve added a file called bg.png 500x400 with some black background and some white lines so i can set that as my background...</p>
  
  <p>The problem is that i always get a black screen instead of the image i try to load</p>