Archived

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

eyesonly_d

ColorKey problems

Recommended Posts

eyesonly_d    122
I''ve been working on my first major DirectX creation and have run into an annoying problem. Does anybody know a way to set up the color key so that it will work in any display mode? (256 color, 16bit, 32bit, etc) Maybe this is a dumb question but, I am having trouble finding a way to setup the DirectDraw color key structure so that it will work on these variety of modes. Any help on this would be greatly appriciated. Some info in case you need it ... Using MS VC 6.0 Pro DirectX 8.0a Using DirectDraw 7 Using 24bit bitmaps included as resources in the project The way I have it now, the color key works well in 16bit desktop, but not in a 32bit desktop (It uses black for transparency for some reason)

Share this post


Link to post
Share on other sites
OB1st    122
I posted a simmiler question couple of days, the answer was the color value differs for different pixels attributes.

If this is correct(I was not able to correct the problem based on this), then the solution would be some kind of switch structure that assigns the correct color values based on the mode that you can add to the array of available modes obtained by the enumaratedisplay function.



Love is illusion. Hate is real. I would rather be crazy.

Share this post


Link to post
Share on other sites
eyesonly_d    122
Thanx, I think I got the problem solved. I believe that Windows makes sure that black is always zero so I used that as my key and everything is working great again ... so I guess I answered my own question.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
An idea! You can use black (zero) color key for your sprites. It works with any display mode. Also, when using black transparent color you can avoid the edge glowing effect which can be seen sometimes when drawing sprites transparently.

Share this post


Link to post
Share on other sites