Jump to content
  • Advertisement
Sign in to follow this  
Dario1986

D3DXCreateTextureFromFile: problems!

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

Hello, I have a problem with this function: The function works correctly when i use it on the FormCreate event, but... when i try to use it on any other event, it just return D3DERR_INVALIDDATA... it drives me crazy!!!, this function only works within the FormCreate Event. i'm using c++builder. any ideas?

Share this post


Link to post
Share on other sites
Advertisement
Since you haven't posted any code to look at, it's difficult to guess.

However, I'd guess you have an invalid filename.

Share this post


Link to post
Share on other sites
I've never had any trouble with it, 'xept as above, wrong file paths. save it's return value, and see if you can find anything out that way?

Share this post


Link to post
Share on other sites
Hi guys, thanks for your comments.
I was trying to get the error, and i got to know something really weird.
The function works well, in the next code.

void __fastcall TForm1::Open1Click(TObject *Sender)
{

char *filename;

OpenDialog1->Title="Abrir Archivo de Tomb Raider 4";
OpenDialog1->Filter="Tomb Raider 4|*.tr4";


D3DXCreateTextureFromFile( obj_device ,"Solido.bmp", &pepe);


OpenDialog1->Execute();
.
.
.

But IF i call the function BELOW the OpenDialog1->Execute(), then the function doesn't work and return a D3D_ERRINVALIDDATA value, so i got the conclusion that D3DXCreateTextureFromFile doesn't work afther you call the "Execute" method from the OpenDialog1 box.

I did a test, i don't call the Opendialog1->execute method and the d3dxcreate function works wherever you want!!

could you make a test yourself,plz? i'm really confused! :S

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!