Jump to content
  • Advertisement
Sign in to follow this  
jYeon2061

texture loading problem

This topic is 3688 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

When I try to load and set a texture on a 3d square, the square comes out white. I put the texture into the project folder so that it should find it but no matter where i put it it keeps coming out white. Anyone know the problem?

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by sirob
Are you using the Debug Runtimes?
That's my line [smile]

As sirob implied, it sounds like the texture isn't loading at all, which is giving you a NULL texture pointer, which you're then assigning to the device, which is having the same effect as having no texture applied at all. And assuming you have a white material set up, you'd just get a white quad.

You should be checking the return values for all important D3D and D3DX functions, where "important" is defined as "returns a pointer or fills some structure with information that you later rely on". In this case, D3DXLoadTextureFromFile, or whatever function you're using returns a pointer indirectly, and you should always make sure this function succeeds (with the SUCCEEDED or FAILED macros).
Another alternative is that you're loading the texture into a memory pool that the device can't access, such as D3DPOOL_SYSTEMEM or D3DPOOL_SCRATCH.
And another possibility is that your loading code is wrong. It's really impossible to say without some code.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!