Advertisement

DX Surface + Turn

Started by February 07, 2000 06:13 AM
2 comments, last by WOOHH 25 years, 1 month ago
Do anybody know a way to rotate a Picture in a DirectDraw Surface or the DirectDraw Surface itself???? I don''t want do a sprite!!
If you use DirecDraw only then there is no other possibility but to use sprites.
If you on the other hand use Direct3D then this isn''t a a problem. Just change the four coordinates that build up the thing you wan''t.
But if you wan''t to use sprites anyway just use Photoshop and rotate the picture and save it as a sprite, and when the user hits the key that rotates the thing just tstart blitting another sprite that is a bit rotated.
Advertisement
do this:
get a dc to ur sprite surface (ddraw), create a surface for all of the rotations of the sprite, get dc of that, PolyBlt the rotations of the sprite to it. polyblt takes a src dc, a dest dc, and a polygon to blit into the dest (u still have to calc the pts of the poly, use trig). don''t forget to fill the dest surface with a color key color first, and make it big enought to accept a poly of size(src) at 45 degrees (that means your sprite blocks will be bigger than the one in the source).

later
You can use DDSurface->Blt() to do blitting with rotation... I''m not sure about its speed... but it''s easy to use...

This topic is closed to new replies.

Advertisement