id3dxmesh

Assertion Error: _BLOCK_TYPE_IS_VALID(pHead->nBlockUse)

I get the error in the title in the following code: std::vector<short> GetIndicesFromID3DXMesh(ID3DXMesh* model) { //LPVOID * ppData; DWORD stride = sizeof(short); BYTE* ibptr = NULL; short* indices = new short[model->GetNumFaces() * 3]; std::vector<short> copy; model->LockIndexBuffer(0, (LPVOID*)&indices); ...

Cloning ID3DXMesh with declration that has 12 floats breaks?

I have the following vertex declration: struct MESHVERTInstanced { float x, y, z; // Position float nx, ny, nz; // Normal float tu, tv; // Texcoord float idx; // index of the vertex! float tanx, tany, tanz; // The tangent const static D3DVERTEXELEMENT9 Decl[6]; static IDirect3DVertexD...