DX Surface + Turn
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.
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.
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
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
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement