• Advertisement

Archived

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

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

This topic is 5880 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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

  • Advertisement