Original Post
hello i have two different texturing methods but the first one disappears when i move away from the textured quad while the second remains visible at a much further distance, any ideas what im doing wrong ? thanks in advance.
void Quad::SetTexture(float width, float height, unsigned char* pcx)
{
SafeRelease(mTexture); // make sure its empty first
HR( D3DXCreateTexture(gd3dDevice, (UINT)width, (UINT)height, 0, 0, D3DFMT_A8R8G8B8, D3DPOOL_MANAGED, &mTexture) );
D3DLOCKED_RECT bits;
size_t size = size_t(width * height * 4);
HR( mTexture->LockRect(0, &bits, NULL, 0) );
memcpy(bits.pBits, pcx, size);
HR( mTexture->UnlockRect(0) );
}
void Quad::SetTexture(char* filepath)
{
SafeRelease(mTexture); // make sure its empty first
D3DCOLOR colorkey = 0xFFff00ff; // transparent colour
HR(D3DXCreateTextureFromFileEx (gd3dDevice, filepath, 0, 0, 1, 0,
D3DFMT_A8R8G8B8, D3DPOOL_MANAGED, D3DX_FILTER_NONE, D3DX_DEFAULT,
colorkey, NULL, NULL, &mTexture));
}