Sign in to follow this  

flipping, as in mirrowing, an image

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

This topic is 4729 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this