void MeshX::LoadMultipleMeshs(LPDIRECT3DDEVICE9 d3ddev){ char *mesharray[] = {"models/mp5.x","models/mp5.x"}; for(int i = 0; i < sizeof(mesharray); i++) { hr = D3DXLoadMeshFromX(mesharray, // load this file D3DXMESH_SYSTEMMEM, // load the mesh into system memory d3ddev, // the Direct3D Device NULL, // we aren't using adjacency &bufShipMaterial2, // put the materials here NULL, // we aren't using effect instances &numMaterials2, // the number of materials in this model &meshs); // put the mesh here , its crashing here if(SUCCEEDED(hr)) { MessageBox(NULL,mesharray,"loaded",0); } else { //MessageBox(NULL,"gun model not loaded","",0); } }}
in the class .h i have
//multiple mesh dataLPD3DXMESH meshs[2]; // define the mesh pointerLPD3DXBUFFER bufShipMaterial2[2];D3DMATERIAL9* material2[2]; // define the material objectLPDIRECT3DTEXTURE9* texture2[2]; // a pointer to a textureDWORD numMaterials2[2]; // stores the number