Jump to content
  • Advertisement
Sign in to follow this  
mirza101

directx textures

This topic is 4734 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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!