Jump to content
  • Advertisement
Sign in to follow this  
erakko

SDL: Animating and rotating

This topic is 3402 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 guess releasing SDL_Surface multiple times and loading different SDL_Surfaces again and again is bad for effectiviness and speed, so I decided to create animation instead. I create one big image, and take regions from it. I took some advice for this from Lazy Foo' Productions site. But then I faced one, "little", problem. My image is rotated, since it's top-down shooter. Now this is hard nut for my head. Result is now, that it picks region from this big image, but it rotates the big image too. So, it picks the right image, but when rotating, it uses the whole image. How can I make it to rotate this small region instead?

Share this post


Link to post
Share on other sites
Advertisement
Copy region of large image to a new surface. Then rotate that small surface.

Even better, do these rotations before the game in an image editor.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!