D3DXCreateTextureFromFile()

Started by
2 comments, last by raizde2 19 years, 7 months ago
I was trying to do this tutorial: http://www.riaz.de/tutorials/d3d05/d3d05.html wich uses the ones before, wich they worked nice for me (using dev-c++) the problem is when I made this last one tutorial instead of seeing the texture of the tutorial (I downloaded the tutorial project and got his texture) I see a red and black texture!!! even if I dont have the texture in my project folder I still see the same red and black texture... where is it getting this? on the tutorial project if I take the texture the look of the pyramid is all white... so why isn't mine working?? where is it going to pick that texture?
Advertisement
Did you specify the correct texture coordinates? Did you change your flexible vertex format (FVF) to reflect your new texturing data members?
just made the things on the tutorial...

please see the site I posted, see if the tutorial is correct...

one thing I notice is that he wrote this:

D3DXCreateTextureFromFile(g_App.GetDevice(),"texture.png",&pPyramideTexture);

but in the msdn this function is not like this (and on other sites they write something like hr=D3DX... and other stuff), but if it worked for him, shouldn't it work for me? or is there a diference in the way it works, since I use dev-c++ and he says he uses visual 6.0?

the things you ask, I'm quite new so I really not sure...

also it says this, but also happens when I compile his version, but also when I compli his verson the texture doesn't work... but I'm not using his full project since he has lots of things that on dev-c++ makes errors...

[Warning] taking address of temporary

but on tutorial 4 wich uses color instead of texture this already appeared and didnt do anything bad...

wich is related to:

g_App.GetDevice()->SetTransform(D3DTS_WORLD,&(matRotationX*matRotationY*matTranslation));

but don't think this is the problem to my texture not working...
OK I discovered the problem, the first time I compiled the code I didnt had the texture file... when I got it, the program wasn't using it , so what I made was deleting the .exe, the .o, the .win and the .LAYOUT made by dev-c++, then open the project again and compiled it again and now is ok, so what I think is that since he didnt had the texture it got it from somewhere wlse (dont know where though) and than he memorized it somehow (didnt release maybe) and so he had always the same red texture even after I made the texture... strange though... can someone explain me? I corrected the problem but I still would love to know where was he getting the texture and why after I got the texture he still used the old one (even if I complie it again) is it the .win?

PS: I'm trying to get the red and black texture again so I coud discover what really happened but now when I delete the files and the texture the pyramide gets all white (wich is correct) but not what happened the first time lol!

This topic is closed to new replies.

Advertisement