Original Post
🔒 Locked
FlippingHorizontally/verticall...
Advertisement
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... |
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.
-Ironblayde
Aeon Software
The following sentence is true.
The preceding sentence is false.
Ahh, figures there was a built in way to do it
.
| Null and Void At least I don't know COBOL... |
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
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);
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);
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
so.. no my original code is not at fault.
anyone how to do flips with fast frame rate ?
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.
Advertisement