directx textures
i neeed a help because my texture won't load
here is the code for opening
LPDIRECT3DTEXTURE9 tex = NULL;
if(FAILED(D3DXCreateTextureFromFile(device.device3d , "some file name", &tex))){
MessageBox(0,"no texture",0,0);
};
device3d is a normal directx3d device but is in a class that i made to make it easy for me to initalize 3d
file name is correct
what could be the problem
HELP
I'm assuming that it's failing and causing the message box to show, as opposed to loading but being displayed incorrectly.
To figure out why it's failing, you can assign the return value to an HRESULT and check it against the return values found here.
To figure out why it's failing, you can assign the return value to an HRESULT and check it against the return values found here.
i did what you said and now it returns D3DXERR_INVALIDDATA. what does this mean, the bitmap is ok i checked it
i found my error
seems like the function loads my bitmap when i write the file name this way "bitmap.bmp", but it won't load it if i write it like this "c:\....\bitmap.bmp", fullpath.
what is the reason for this?
seems like the function loads my bitmap when i write the file name this way "bitmap.bmp", but it won't load it if i write it like this "c:\....\bitmap.bmp", fullpath.
what is the reason for this?
The '\' character is being treated as an escape character. To open "C:\Temp\Bitmap.bmp" you need to make the pathname "C:\\Temp\\Bitmap.bmp".
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement