PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Colorkey in DirectDraw mobile

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!?
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
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!