Sign in to follow this  

directx textures

This topic is 4392 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

This topic is 4392 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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