Jump to content
  • Advertisement


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


[DirectDraw] Problem with the rotation FX

This topic is 6197 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 tried to rotate a sprite but it doesn''t work. Here''s the code: int angle = 0; DDBLTFX ddbltfx; ddbltfx.dwSize = sizeof(ddbltfx); ddbltfx.dwRotationAngle = angle; angle = angle + 5; lpSecondary->Blt(&destrect, lpSStarship, &srcrect, DDBLT_WAIT | DDBLT_KEYSRC, &ddbltfx); What''s the problem? How can I rotate this sprite?

Share this post

Link to post
Share on other sites

lpSecondary->Blt(&destrect, lpSStarship, &srcrect, DDBLT_WAIT | DDBLT_KEYSRC | DDBLT_ROTATIONANGLE, &ddbltfx);

Just remember that rotation doesn''t work on a lot of video cards, so it might not work on yours.

- Goblineye Entertainment
The road to success is always under construction

Share this post

Link to post
Share on other sites
Almost if not all graphics cards do not support rotated blits. It isn''t emulated either. If you check the caps bits for both the HAL and HEL you''ll find that you don''t have rotation available.

If you want arbitrary rotations you need to either:

a. lock the surface and do it yourself - slow and extra pixel work, but guaranteed to work on anything.

b. Use a 3D API and treat the sprite as a textured square - this is really fast and will work on all graphics cards made from 1997 onwards (and some earlier). Look at the D3DX helper library which comes in the SDK - it has a sprite implemented this way.

b is my preferred option by a long way, and not much more work than locking and doing it yourself.

Simon O''''Connor
Creative Asylum Ltd

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!