Skip to main content
gamedev.net
🔒 Locked

FlippingHorizontally/verticall...

Started by Leprosy Oct 22, 2000 at 10:56 PM 6 replies 1k views
Original Post
Leprosy
Leprosy
Are there any methods / written code to flip a direct draw image along the horizontal or vertical axis? for a sprite... thanks Lep
Null and Void
Null and Void
I don''t (off the top of my head) know of any built in ways. Try using another surface, then BLT''ing columns or rows of pixels to it, then copy it back to that surface. I do know that rotation is built in though, if you want to use that.

Null and Void
At least I don't know COBOL...

Ironblayde
Ironblayde
You can use the DDBLTFX_MIRRORLEFTRIGHT and DDBLTFX_MIRRORUPDOWN flags in the dwDDFX member of a DDBLTFX structure to do this. I''m not sure if it''s supported in the HEL or not (although I''d think it would be), so use GetCaps() to query the system to find out before you try using it.

-Ironblayde
 Aeon Software

The following sentence is true.
The preceding sentence is false.
"Your superior intellect is no match for our puny weapons!"
Null and Void
Null and Void
Ahh, figures there was a built in way to do it .

Null and Void
At least I don't know COBOL...

BeamMeUp
BeamMeUp
Got here before I could, Iron. Flips are supported by the HEL, although rotation isn''t. Even 90 degree rotations (there are some flags for it) aren''t supported without the correct hardware, which is something I think Microsoft should have included. You have to use Blt, not BltFast - and make sure you ZeroMemory the DDBLTFX structure and set its dwSize. I always forget to do that.

-----------

C++ is the language of the not-so-ancients.
Learn to speak it well.


BeamMeUp
-----------C++ is the language of the not-so-ancients.Learn to speak it well.BeamMeUp
Mader
Mader
I have tried this flipping,,, but it''s no good get like 40 frame per second

HOW can i get more frame per second !!!??? help. is there something i''m missing im my code?




DDBLTFX ddbltfx; //use in flipping images
memset(&ddbltfx,0, sizeof(DDBLTFX) );
ddbltfx.dwSize = sizeof(DDBLTFX) ;



ddbltfx.dwDDFX = DDBLTFX_MIRRORUPDOWN | DDBLTFX_MIRRORLEFTRIGHT;


RECT dest_rect, // the destination rectangle
source_rect; // the source rectangle

// fill in the destination rect
dest_rect.left = mybob->x;
dest_rect.top = mybob->y;
dest_rect.right = mybob->x+mybob->width;
dest_rect.bottom = mybob->y+mybob->height;

// fill in the source rect
source_rect.left = 0;
source_rect.top = 0;
source_rect.right = mybob->width;
source_rect.bottom = mybob->height;

// blt to destination surface
dest->Blt(&dest_rect, (mybob->image[frame]),
&source_rect,(DDBLT_WAIT | DDBLT_KEYSRC | DDBLT_DDFX),
&ddbltfx);

http://www.fighterX.com
acw83
acw83
What was your frame rate before you used the flipping? The bottleneck might not be the blt call, but your other code.

-------------------------
How you like them apples?
Mader
Mader
It was 60! and i was putting it at 60 frames intentialy, the original frame rate was 150!... anyway i tried it without locking the code to 60 FPS,,,, but i''m getting a lot less than 60 fps,,,,, I think the flip is done in hel,, that''s why it takes so much processing power....

so.. no my original code is not at fault.

anyone how to do flips with fast frame rate ?

http://www.fighterX.com
http://www.fighterX.com

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.