Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


D3D9 Createfromfileex

This topic is 5754 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 am transferring my texture manager from GL to D3D9 and I ran into a problem using the D3DXCreateTextureFromFileEx function. I do everything correct, but the returned Texture9 interface is not valid, so I cant use it. I retrieve everything from the file, width,height, format, using the 0 value (or D3DX_DEFAULT). What might the problem be? I am using a 24bit BMP. I will try to use jpeg too.

Share this post

Link to post
Share on other sites
No, jpeg isnt working either. The returned interface isnt valid.

but here is my code:

if (!D3DXCreateTextureFromFileEx(dev, tex.strFilename, 0, 0, 0, 0, D3DFMT_UNKNOWN,
0,NULL,NULL, &tex.pTexture))
return false;

sorry if it messed up by html.

[edited by - aker_jus on December 23, 2002 3:34:45 PM]

Share this post

Link to post
Share on other sites
You cannot test for a successful function call by using:


This is because the function returns zero (D3D_OK == S_OK == 0x00000000L) if the function call is *successful*. So even if your function was succeeding you would always be returning false.

Try something like...


This should hopefully work.


Share this post

Link to post
Share on other sites

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