• Advertisement

Archived

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

Destination Color Key isnt working here =/

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

Hello Ya, another damn problem with DDraw, now with destination Color Key. I set up source color key and it worked perfectly, now with dest color key it wont work. Here is what I do : --- Initialization part of my program -- DDCOLORKEY transp_blue; transp_blue.dwColorSpaceLowValue = _RGB16BIT565 (0, 0, 255); transp_blue.dwColorSpaceHighValue = _RGB16BIT565 (0, 0, 255); the_bmp->SetColorKey (DDCKEY_DESTBLT, &transp_blue); --- Now on the Blitting (main part of the program) --- if (lpddsback->Blt (&dest_rect, the_bmp, &bmp_rect, (DDBLT_WAIT / DDBLT_KEYDEST), NULL) == DDERR_UNSUPPORTED) { // pop up a message box saying that error occured. } --- It wont pop up the message box when checking for DDERR_UNSUPPORTED, but it will when I change that to "Blt (...) != DD_OK". The result on screen is that it simply dont display any bitmap on the screen. And it works perfectly when I remove the "DDBLT_KEYDEST" flag (or change it to DDBLT_KEYSRC and do the proper initialization). Anyone has any ideas? I searched the Lamothe''s CD for "DDBLT_KEYDEST" and searched the DX6 (the one Im using) examples for the same keyword and it wont find any match. Any help is appreciated (I hope to not have to do the Blitting manually when I want to use destination transparency, or whatever it is called). Thanks a lot, -RoTTer

Share this post


Link to post
Share on other sites
Advertisement
So what error does it report?

No sense being pessimistic. It wouldn''t work anyway.

Share this post


Link to post
Share on other sites
Hello,

Thanks for the answer =]


Well, about the error... I dont know!
I just usually check if it has an error or not, but I never wanted to know which error was it. Now that I need to know that, how could I do it? Make a switch (result) and check any of the possible error that the Blt function returns?

Im not really sure how can I know which is the error =/. I hope theres an easier way to do it (compared to the one I wrote).

Thanks a lot,
-RoTTer

Share this post


Link to post
Share on other sites
Unfortunately, there are no easier way than to compare against every possible error that can be returned. At least none that I know of.

I''m not sure this is your problem since you do get an error, but shouldn''t the color key be set with 24 bits and not 16. I believe DX converts to 16 bit as needed by itself.

Share this post


Link to post
Share on other sites

  • Advertisement