ColorKey problems

Started by
2 comments, last by eyesonly_d 22 years, 4 months ago
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)
Advertisement
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.
I would love going home to M7, but I can't detect black holes.
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.
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.

This topic is closed to new replies.

Advertisement