Changing Texture ColorKey (D3D/C#)
Hi,
Is it possible to change the ColorKey of a Texture after it has been created, or can it only be set at load time?
I primarly want it to provide the good ol' "top-left pixel is ColorKey" functionality to my users.
Thanks,
Jonas
You're referring to the D3DXCreateTexture-style calls, right? That "colorkey" functionality is just a preprocessor that goes over the texture and replaces pixels of that colour with transparent black. So no, it can't be changed after creation.
But there's nothing to stop you loading the texture without the colorkey setting on, locking the texture, reading the top-left corner pixel, and then either loading the texture again with colorkey (rather expensive, but easy to code), or doing the preprocessing yourself.