title: SDL Sprite how to set sprite center of origin
body: <p>I'm messing around in SDL trying to build a game and have noticed that when I blit a sprite to the screen the origin of the sprite is set to the top left corner, 0,0.</p>
  
  <p>To get around this I've simply adjusted the sprite placement by 1/2 the sprites width but as a solution it feels kind of clunky - I want to build a platform game so surely the COO will need to be at the sprites feet for collision detection with the platforms - and I was wondering if SDL had any functions in place that would allow me to set the center of origin a bit like the sprite editor in construct2.</p>
  
  <p>This is my drawing routine:</p>
  
  <pre><code>// Draws the hero sprite according to clipframe
  void apply_surface( int x, int y, SDL_Surface* source, SDL_Surface* destination,      SDL_Rect* clip = NULL )
  {
    //Holds offsets
    SDL_Rect offset;
    //Get offsets
    offset.x = x;
    offset.y = y;
    //Blit
    SDL_BlitSurface( source, clip, destination, &amp;offset );
  }
  </code></pre>
  
  <p>My instantiation of it:</p>
  
  <pre><code> apply_surface(width /2 - heroSpriteSize /2, height /2 - heroSpriteSize /2, hero, buffer, &amp;wait[frame]);
  </code></pre>