Sign in to follow this  
mirza101

directx textures

Recommended Posts

mirza101    122
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

Share this post


Link to post
Share on other sites
pi_equals_3    517
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.

Share this post


Link to post
Share on other sites
mirza101    122
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?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
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".

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this