title: SDL_BlitSurface doesn't seem to work
body: <p><strong>Resolved by Brainsteel. Code below was fixed and now works.</strong>
  Window width: 640, Window height: 480</p>
  
  <p>The function calling order:
  Start()</p>
  
  <p>Loop()</p>
  
  <p>Stop() (currently commented because if Loop doesn't return 0 it will call Stop before returning 1)</p>
  
  <p>The structure:</p>
  
  <pre><code>#define MAX_IMAGES 50
  
  struct ImageStructure{
      SDL_Surface* Texture;
      int x;
      int y;
  };
  
  ImageStructure Image[MAX_IMAGES]; //All Image Textures are set to NULL by default in the start function
  SDL_Event Event;
  SDL_Surface* Screen = NULL;
  </code></pre>
  
  <p>Now the Start function. I've cleaned out all the setup code</p>
  
  <pre><code>int Program::Start(){
      for(int id = 0; id &lt; MAX_IMAGES; id++){
          Image[id].Texture = NULL;
          Image[id].x = 0;
          Image[id].y = 0;
      }
  
      if(LoadIMG(1, 0, 0) != 0){
          return 1;
      }
  
      if(PrintText(2, "Hello World", 10, 310) != 0){
          return 2;
      }
  
      return 0;
  }
  </code></pre>
  
  <p>The Loop function. Cleaned out all the event code</p>
  
  <pre><code>int Program::Loop(){
      while(Event.type != SDL_QUIT){
  
          for(int id = 0; id &lt; MAX_IMAGES; id++){
              if(Image[id].Texture != NULL){
                  if(ShowIMG(id) != 0){
                      return 1;
                  }
              }
          }
  
          if(SDL_Flip(Screen) == -1){
              return 1;
          }
      }
  }
  </code></pre>
  
  <p>The LoadIMG function</p>
  
  <pre><code>int Program::LoadIMG(int id, int x, int y){
      SDL_Surface* loadedImage = NULL;
      switch(id){
          case 0:
              loadedImage = IMG_Load("Textures\\Icon.jpeg");
              break;
          case 1:
              loadedImage = IMG_Load("Textures\\Test.jpeg");
              break;
          default:
              return 1;
      }
      if(loadedImage != NULL){
          Image[id].Texture = SDL_DisplayFormat(loadedImage);
          Image[id].x = x;
          Image[id].y = y;
      }
      else{
          return 1;
      }
      SDL_FreeSurface(loadedImage);
      return 0;
  }
  </code></pre>
  
  <p>The ShowIMG function</p>
  
  <pre><code>int Program::ShowIMG(int id){
      SDL_Rect position;
      position.x = Image[id].x;
      position.y = Image[id].y;
      SDL_BlitSurface(Image[id].Texture, NULL, Screen, &amp;position);
      return 0;
  }
  </code></pre>
  
  <p>And the PrintText function</p>
  
  <pre><code>int Program::PrintText(int id, std::string Text, int x, int y){
      TTF_Font *Font = NULL;
      SDL_Color TextColor = {255, 255, 255};
      Font = TTF_OpenFont("Other\\PoseiAOE.ttf", 22);
      if(Font == NULL){
          return 1;
      }
      Image[id].Texture = TTF_RenderText_Solid(Font, Text.c_str(), TextColor);
      Image[id].x = x;
      Image[id].y = y;
      if(Image[id].Texture == NULL){
          return 1;
      }
      return 0;
  }
  </code></pre>