Advertisement

DirectDraw & blitting a flipped image

Started by January 11, 2000 11:03 PM
2 comments, last by Bucket_Head 25 years, 1 month ago
Hello there! What I''d like to be able to do is blit from a src rect to a dest rect, but flipping the image from the dest rect horizontally. This will save image ram, which has obvious benefits. If it''s at all possible to do this using BltFast, let me know, although I figure I''ll probably have to ''degrade'' to Blt to do this. That''s alright though. Any help is much appreciated, thank you for your time. - Ah, to write code; to compose electrical music, to manipulate the bits that make up everything...such is our chosen line of work. And for a game, no less!
- Hai, watashi no chichi no kuruma ga oishikatta desu!...or, in other words, "Yes, my dad's car was delicious!"
so basically, you want to blit it, but backwards? a mirror image of the source surface? Well, I don''t know of any DirectDraw functions that do that, you''d need to either just have the source surface already backwards, instead of making a frontwards image backwards each time you blt it. that would save cpu time, and is the only way to do it.

To flip it, just get direct memory access to the source surface, and flip the pixels. Lock the source surface first, then get a pointer to the surface. Then flip it.
Advertisement
You''ll have to use Blt (it''s not really any slower than BltFast is in reality). Basically, in the DDBLTFX structure set the dwDDFX member to DDBLTFX_MIRRORLEFTRIGHT. I haven''t tried this myself though, so there might be some other things you must worry about (like it might require hardware support). Also of interest are:

DDBLTFX_MIRRORUPDOWN:
Turns the surface on its x-axis. This blit mirrors the surface from top to bottom.

DDBLTFX_NOTEARING :
Schedules this blit to avoid tearing.

DDBLTFX_ROTATE180 :
Rotates the surface 180 degrees clockwise during this blit.

DDBLTFX_ROTATE270 :
Rotates the surface 270 degrees clockwise during this blit.

DDBLTFX_ROTATE90 :
Same as other stuff

--TheGoop
Ahh, that''s the answer I was looking for! Thanks very much Goop! I''ll see you around.

- Ah, to write code; to compose electrical music, to manipulate the bits that make up everything...such is our chosen line of work. And for a game, no less!
- Hai, watashi no chichi no kuruma ga oishikatta desu!...or, in other words, "Yes, my dad's car was delicious!"

This topic is closed to new replies.

Advertisement