title: How can I clear a SDL_Surface to be replaced with another one?
body: <p>Been trying to find this online for a while now.</p>
  
  <p>I have a SDL_Surface with some content (in one it's text, in another is a part of a sprite). Inside the game loop I get the data onto the screen fine. But then it loops again and it doesn't replace the old data but just writes over it. So in the case of the text, it becomes a mess.</p>
  
  <p>I've tried SDL_FreeSurface and it didn't work, anyone know another way?</p>
  
  <pre><code>fpsStream.str("");
  fpsStream &lt;&lt; fps.get_ticks();
  fpsString = fpsStream.str();
  
  game.fpsSurface = TTF_RenderText_Solid(game.fpsFont, fpsString.c_str(), textColor);
  game.BlitSurface(0, 0, game.fpsSurface, game.screen);
  </code></pre>