Archived

This topic is now archived and is closed to further replies.

DAharon

SDL_BlitSurface(), where's the x,y?

Recommended Posts

I am playing around with SDL, and I can''t get a bitmap to show up anywhere on the screen other than the top left corner. How do you control where on the screen the bitmap will appear?

Share this post


Link to post
Share on other sites
SDL_Rect dest = {x, y, 0, 0};
SDL_BlitSurface(image, NULL, screen_surface, &dest);

Note that the w and h members of the destination rectangle are ignored by SDL_BlitSurface, and the destination rectangle will probably be modified by SDL_BlitSurface to report how the image got clipped.

Share this post


Link to post
Share on other sites