Archived

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

Cabadam

Rotating bitmaps

Recommended Posts

Cabadam    122
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
+AA_970+    122
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
Cabadam    122
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