Createtexturefromfile Problem...

Started by
4 comments, last by RpgActioN 18 years, 11 months ago
In the line...

  if(FAILED(g_pTexture->D3DXCreateTextureFromFile(g_pD3DDevice, "Texture.bmp", 
			 &g_pTexture)))
		return FALSE;
...Dev-Cpp gives me the error "'struct IDirect3DTexture9' has no member named 'D3DXCreateTextureFromFileA'" "D3DXCreateTextureFromFileA" has not been called, to my knowledge, in this program... only "D3DXCreateTextureFromFile".
Advertisement
D3DXCreateTextureFromFileA is the same as D3DXCreateTextureFromFile except that your compiler has resolved it to the ANSI version (D3DXCreateTextureFromFileA) instead of the Unicode version (D3DXCreateTextureFromFileW).
That said I am not sure what the actual problem is... what version of the SDK are you working with?
The cheese stands alone.
D3DXCreateTextureFromFile() is NOT a member of IDirect3DTexture9. Just call it like this:

D3DXCreateTextureFromFile(g_pD3DDevice, "Texture.bmp", &g_pTexture);

-Mezz
If I take off the g_pTexture, it just gives me linker errors.
You also need to link to d3dx9.lib or d3dx9d.lib (the debug version of d3dx9.lib). If that doesn't work, what linker errors are you getting?
Yeah, it works, I mean, but what's the point of having the SDK if you're not going to use it?

This topic is closed to new replies.

Advertisement