• Advertisement
Sign in to follow this  

flipping, as in mirrowing, an image

This topic is 4800 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
Direct draw supports mirroring as a blitting effect (DDBLTFX_MIRRORLEFTRIGHT).

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
If you learn D3D (as discussed in your other post) the flip is trivial; exchange texture coordinates. Just another advantage :D

Share this post


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

  • Advertisement