Jump to content
  • Advertisement

Archived

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

Cabadam

Rotating bitmaps

This topic is 6538 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

Ok, I am new to DirectDraw, and just learned how to load bitmaps into a surface and blit them from there to the primary surface. Now, I need to know how to rotate these bitmaps. Is there an easy way to do this? Thanks, Adam pandcc3@comwerx.net

Share this post


Link to post
Share on other sites
Advertisement
I''m not sure but i think you have to lock the surface, and re-draw the pixles accoring to this equation

x'' = cos(theta)*x - sin(theta)*y
y'' = sin(theta)*x + cos(theta)*y

theta = the angle in radians

If your new to direct draw i think you better read up on pixel plotting and 16 bit color (or whatever bpp your using).

BTW, i haven''t done this (yet) so i don''t know if the equation is right.

Also your suppose to blt to a back buffer not the primary buffer. If you don''t do this you''ll get flickering when you do animations.

+AA_970+

Share this post


Link to post
Share on other sites
Ok, thanks I''ll give it a try.
And I am blitting to backbuffer, left that out in first post, sorry.

Thanks,
Adam
pandcc3@comwerx.net

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!