Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

flamewill

DirectDraw 7.0 Blt Bug?

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

So far I have successfully loaded bitmaps to DirectDraw surfaces and flip them to create animation. Right now I am trying to mirror an image and the most peculiar thing happens. Snippets of my code as follows. The mirror (and color key) works only if the destination rectangle has a different height/width than the source rectangle. Otherwise, I can Blt to the destination, but no mirror and no transparency.
...

destRect.top = y;
destRect.left = x;
destRect.bottom = y + width;
destRect.right = x + height;

ZeroMemory( &ddfx, sizeof( ddfx ) );
ddfx.dwSize = sizeof( ddfx );
ddfx.dwDDFX = DDBLTFX_MIRRORLEFTRIGHT;

result = pCanvas->Blt( &destRect, pSurface, &srcRect, DDBLT_KEYSRC | DDBLT_DDFX, &ddfx );

...
The code as above will blt the image from pSurface to pCanvas. However it will not mirror or use transparency when blitting. Yet if I add one to destRect.bottom or destRect.right, it works. Of course the image is thus a little distorted due to stretching. Just hoping that someone else has also come across this and know what is going on...? [edited by - flamewill on August 15, 2003 8:32:02 PM]

Share this post


Link to post
Share on other sites
Advertisement
Thanks for your help, KalvinB. I tried to reply to my previous (identical) post, but the "Reply To Topic" doesn''t work! I really need to get that gremlin off my back.

Back on topic. It must have something to do with the RECT''s because blitting that image results in the error: DDERR_INVALIDRECT. Unfortunately, even after I adjusted the source and destination rectangles the problem wasn''t fixed.

The more peculiar thing is that the DDERR_INVALIDRECT error only pops up during the first three scans. The image is still there... What am I missing?

Share this post


Link to post
Share on other sites
Just found out what the DDERR_INVALIDRECT problem is: a dumb bug in my code (as it usually is). The initial problem is still there, no mirror, no transparency, and no DDERR...

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
i find it odd that whenever something doesn''t work, people blame microsoft, or whoever else may have supplied the library. the truth is, 99.9999% of the time, its your fault.

Share this post


Link to post
Share on other sites
Oh, no. Please don''t misunderstand, I''m not blaming Microsoft for this - although I love blaming Microsoft on many other things. I''m trying to find out if others have also experienced this or a similar problem.

I agree that 99% of the time the programmer has overlooked something. That''s why I spend 99% of the time debugging my code, and 1% of the time asking for help in the forums.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!