Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

ColourKey with D3DXCreateTextureFromResourceEx not working!

HickoryHickory Member Posts: 56
I have a DirectX 9 project in which I've a texture I've loaded using D3DXCreateTextureFromResourceEx like so:

[code]
D3DXCreateTextureFromResourceEx(
pDevice,
hInst,
ResourceName,
D3DX_DEFAULT,
D3DX_DEFAULT,
D3DX_DEFAULT,
0,
DisplayMode,
D3DPOOL_DEFAULT,
D3DX_FILTER_NONE,
D3DX_FILTER_BOX,
TransparentCol, //is set to my 0xFFFF0000 which is the color i use for transparency
NULL,
NULL,
&pTexture);
[/code]

But when the texture is billboarded, I see solid black in the places that were once red, and should be transparent. So DX is obviously setting my colour to transparent black, but I'm not sure what I've set up wrong. Which States need to enabled/setup to allow transparency, or which States might I have enabled that would block it from happening? Maybe It's even something else I'm forgetting?

Any thoughts would be appreciated. Thanks.

Comments

  • tango_zulutango_zulu Member Posts: 1
    I have the same problem. Did you find a solution? Transparent black seems like an oxymoron. I don't want it to be black. I want it to be transparent. I stretchcopy a different bitmap so it should show through. The MSDN DirectX FAQ also refers to transparent black. I hope this is not "by design".

    : I have a DirectX 9 project in which I've a texture I've loaded using D3DXCreateTextureFromResourceEx like so:
    :
    : [code]
    : D3DXCreateTextureFromResourceEx(
    : pDevice,
    : hInst,
    : ResourceName,
    : D3DX_DEFAULT,
    : D3DX_DEFAULT,
    : D3DX_DEFAULT,
    : 0,
    : DisplayMode,
    : D3DPOOL_DEFAULT,
    : D3DX_FILTER_NONE,
    : D3DX_FILTER_BOX,
    : TransparentCol, //is set to my 0xFFFF0000 which is the color i use for transparency
    : NULL,
    : NULL,
    : &pTexture);
    : [/code]
    :
    : But when the texture is billboarded, I see solid black in the places that were once red, and should be transparent. So DX is obviously setting my colour to transparent black, but I'm not sure what I've set up wrong. Which States need to enabled/setup to allow transparency, or which States might I have enabled that would block it from happening? Maybe It's even something else I'm forgetting?
    :
    : Any thoughts would be appreciated. Thanks.
    :

Sign In or Register to comment.