TransParency?
If this wasnt so api specific i would put it in the beginners forumn because i dont think this is a very difficult problem. Im just starting DirectX and ive made a simple program that displays a textured polygon right in the middle of the window. I load the (bmp) texture with D3DXCreateTextureFromFileEx(..) and i specify the ColorKey as D3DCOLOR_RGBA(255,0,0,255); I think i set all of the rendering states correctly but when the polygon is drawn the texture loses its normal red background like i wanted but instead of drawing the background color it draws black. Is there a reason for this. Im not sure if i need to give more information please say so if i do. I can probably just put the whole program in a box its pretty small; Thanks.
While im here whats the difference between managed DX and unmanaged( if there is unmanaged)?
I probably sound like a total noob right now
I probably sound like a total noob right now
I believe you have to put in this line:
DEVICE->SetRenderState(D3DRS_ALPHATESTENABLE, TRUE);
And I think Managed DirectX is for Visual Basic or C#?
Neither of which you want to use.
Stick with C++ and DirectX ('unmanaged')
DEVICE->SetRenderState(D3DRS_ALPHATESTENABLE, TRUE);
And I think Managed DirectX is for Visual Basic or C#?
Neither of which you want to use.
Stick with C++ and DirectX ('unmanaged')
The color code you use in D3DXCreateTextureFromFileEX is the color you want it to skip over, or rather which color is completely transparent.
Try this:
// enable alpha blending
g_pd3dDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE);
// disable alpha testing, just in case
g_pd3dDevice->SetRenderState(D3DRS_ALPHATESTENABLE, FALSE);
Try this:
// enable alpha blending
g_pd3dDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE);
// disable alpha testing, just in case
g_pd3dDevice->SetRenderState(D3DRS_ALPHATESTENABLE, FALSE);
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement