Archived

This topic is now archived and is closed to further replies.

new_man

Texture color key

Recommended Posts

KalvinB    102
for DX7 go here

For DX8 in the D3DUtil.cpp file add


    
HRESULT D3DUtil_CreateTextureCK( LPDIRECT3DDEVICE8 pd3dDevice, TCHAR* strTexture,
LPDIRECT3DTEXTURE8* ppTexture, D3DFORMAT d3dFormat,
byte alpha, byte red, byte blue, byte green)
{
// Get the path to the texture

TCHAR strPath[MAX_PATH];
DXUtil_FindMediaFile( strPath, strTexture );

// Create the texture using D3DX

return D3DXCreateTextureFromFileEx(
pd3dDevice,
strPath,
D3DX_DEFAULT,
D3DX_DEFAULT,
D3DX_DEFAULT,
0,
d3dFormat,
D3DPOOL_MANAGED,
D3DX_FILTER_TRIANGLE|D3DX_FILTER_MIRROR,
D3DX_FILTER_TRIANGLE|D3DX_FILTER_MIRROR,
D3DCOLOR_ARGB(alpha,red,blue,green),
NULL,
NULL,
ppTexture );
}


usage is


        
D3DUtil_CreateTextureCK( m_pd3dDevice, filename, &m_pTexture,D3DFMT_UNKNOWN,a,r,g,b )


Always use D3DFMT_UNKNOWN

Ben

IcarusIndie.com

[The Rabbit Hole | The Labyrinth | Programming | Gang Wars | The Wall]

[edited by - KalvinB on April 28, 2002 7:33:29 PM]

Share this post


Link to post
Share on other sites