   Problem With D3DXCreateTextureFromFile
  Hi all, ive been stuck on an error for a few weeks now, in the line:<code>LPD3DXBUFFER materialBuffer;DWORD numMaterials;  // Note: DWORD is a typedef for unsigned longLPD3DXMESH mesh;    // creates an instance of the mesh object and loads the file geometry into the mesh objectD3DXLoadMeshFromX(TEXT("sph.x"),   D3DXMESH_SYSTEMMEM,   &d3dManager->getDevice(),   NULL,   &materialBuffer,   NULL,   &numMaterials,   &mesh );    // a bit of a nasty cast required to get the buffer pointer to be a pointer to D3DXMATERIALD3DXMATERIAL* d3dxMaterials = (D3DXMATERIAL*)materialBuffer->GetBufferPointer();    // two arrays to hold our material and texture pointersD3DMATERIAL9 *meshMaterials = new D3DMATERIAL9[numMaterials];    LPDIRECT3DTEXTURE9 *meshTextures  = new LPDIRECT3DTEXTURE9[numMaterials];    for (DWORD i=0; i<numMaterials; i++) {   // Copy the material   meshMaterials = d3dxMaterials.MatD3D;   // Set the ambient color for the material (D3DX does not do this)   meshMaterials.Ambient = meshMaterials.Diffuse;   // Create the texture if it exists - it may not   meshTextures = NULL;   if (d3dxMaterials.pTextureFilename) {  D3DXCreateTextureFromFile(&d3dManager->getDevice(),   d3dxMaterials.pTextureFilename,   &meshTextures);   }    }    materialBuffer->Release();</code>in the D3DXCreateTextureFromFile( Method, with the &meshTextures bit i get the errors:Main.cpp|214|error: invalid conversion from `void**' to `IDirect3DTexture9**'|Main.cpp|214|error:   initializing argument 3 of `HRESULT D3DXCreateTextureFromFileA(IDirect3DDevice9*, const CHAR*, IDirect3DTexture9**)'|i want to load a mesh from a .x file, and that works, its only when it comes to the textures i cant get it working. any ideasalso sorry if the code brackeds didnt work, only starded posting thisweek so am new to the lingo and thaa ways of the force, i b a Paduwan lol
Quote:also sorry if the code brackeds didnt workFor code, use [ source ][ /source ] (no spaces). You can edit your post using the edit button in the upper right :)   