Jump to content
  • Advertisement
Sign in to follow this  

D3DERR_INVALIDCALL when creating texture

This topic is 3308 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 started to work with HLSL and when I got to make it able to render textures I noticed I can't load a the textures. I haven't changed anything in the code to load and store the texture, at all. I even have an old version saved and used that but it didn't work. I get D3DERR_INVALIDCALL when using: D3DXCreateTextureFromFileA(pD3DDev, tempMaterials.pTextureFilename, &texture) texture is defined as: texture = new LPDIRECT3DTEXTURE9[matCount]; with matCount being the correct number. pD3DDev = LPDIRECT3DDEVICE9 pD3DDev; tempMaterials = D3DXMATERIAL* tempMaterials = (D3DXMATERIAL*)tempBufMaterial->GetBufferPointer(); Where tempBufMaterial is created from a successful D3DXLoadMeshFromX(); I am absolutely clueless, the .bmp files are in the right places too, I can open the mesh with dxviewer and the textures work.

Share this post


Link to post
Share on other sites
Advertisement
It sounds ridiculous but I can't find the debug tab with any check box. I can find "Debugging" under "Configuration Properties" to the left but there are no check boxes and nothing about unmanaged code debugging.

Share this post


Link to post
Share on other sites
Quote:
Original post by Hannesnisula
tempMaterials.pTextureFilename is "bihull.bmp" which is the correct name.
And that file exists on the current path? I.e. in the same directory as the mesh?
And you're sure that the error is coming from that function (Put a breakpoint on it and step over it)?

Share this post


Link to post
Share on other sites
Yes the error is comming from that function. And strangely enough, yes they're in the same folder. If some "default" folder or w/e is set in my project (which I don't know about) it should work anyway because my mesh and pictures are in the same folders everywhere I've got a version of it.

EDIT: I tried with another mesh + texture and that worked. I'm still very confused why the other didn't work, it works with earlier versions of my program.

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!