Jump to content
  • Advertisement
Sign in to follow this  
kubicon

flipping, as in mirrowing, an image

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

How should I go about flipping an image that's on a surface in DirectDraw7. For instance, a character that is facing right but I want the same image facing left?

Share this post


Link to post
Share on other sites
Advertisement
The easiest way to go about it is have two separate images, render one for left and the other for right..


Unless you want to write your own rotation function, which can get a bit confusing :) (swapping the bits over left->right)

Share this post


Link to post
Share on other sites
You can perform the mirroring in hardware (if supported by the graphics card). The last parameter that Blt takes is of the type DDBLTFX, and one member of this structure is dwDDFX. If you set this equal to DDBLTFX_MIRRORLEFTRIGHT, then the image will be mirrored when it is blitted to the desired surface. Of course, the fastest way to do these operations is by making a duplicate of every image that needs to be mirrored ahead of time. Unfortunately, this requires twice the memory and increases the amount of time necessary to load the game.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!