Im Trying to load textures in directx to draw a textured quad.
but the D3DXCreateTextureFromFile never returns D3D_OK ....
here is my code to load the texture....
FeralTexture(string Name,FeralVector2 Position,IDirect3DDevice9 *device)
{
FileName = Name;
m_pDevice = device;
x= Position.x;
y= Position.y;
if(D3DXCreateTextureFromFile(m_pDevice,FileName.c_str(),&m_pTextureFile) != D3D_OK)
{
TextureCreated = false;
m_pTextureFile = NULL;
D3DXCreateTextureFromFile(m_pDevice,FileName.c_str(),&m_pTextureFile);
}
else
{
if(D3DXGetImageInfoFromFile(FileName.c_str(),&ImageInfo) == D3D_OK)
{
TextureCreated = true;
Width = ImageInfo.Width;
Height = ImageInfo.Height;
MinVector = FeralVector2(x,y);
MaxVector = FeralVector2(x+Width,y+Height);
//BoundingRect = FeralRect2(MinVector,MaxVector);
}
else
{
Width = 0;
Height = 0;
}
}
}
i placed copies of the image in both the debug folder of my project and in the main folder of my project... neither works....
Any input will be greatly appreciated ....