Page 1 of 1

Colorkey in DirectDraw mobile

PostPosted: Jul 13, 2007 @ 10:28pm
by Cardinal
So I'm having some problems that maybe one of you has seen.

Essentially, it seems that setting a source color key for a surface to anything other than black doesn't work! I have a surface with magenta as the color to be keyed out, if I called SetColorKey on the surface and set the low and high range to 0xff00ff and then when blitting use the DDBLT_KEYSRC flag... the magenta doesn't get keyed out... but if I set the magenta to black and the color key to black, it works no problem!

Even the sample donuts game that comes with the DirectX SDK uses black as a color key!

Anybody else have this problem!?

PostPosted: Jul 14, 2007 @ 12:12am
by Dan East
This is complete speculation on my part, but if the textures are converted to a different color depth when they are loaded, then they may not have the exact color values they had originally.

Same with the color key itself. Try querying the color key value after you set it and see what you get back.

Dan East

PostPosted: Jul 14, 2007 @ 5:12pm
by Cardinal
HHmmm yes that is a possibility. The color is set with a 32-bit value though... I'll have to fidget with it a little...

Good thinking!