I looked in to the CreateSkinnedMesh Function and I found some suss code here .
the weights parser class
class cParserWeights
{
//weights have the following in .X files
//STRING transformNodeName;
//DWORD nWeights;
// array DWORD vertexIndices[nWeights];
//array float weights[nWeights];
// Matrix4x4 matrixOffset
std::vector<DWORD> VertexIndices;
};
Then In CreateSkinnedMesh I was using it like this
skinptr->AddBoneInfluences(bone,//the bone to set
m_SkinWeights[bone].VertexIndices.size(),// Number of vertices to add to the bone's influence.
(UINT *)&m_SkinWeights[bone].VertexIndices[0],//********HERE NOTICE THE (UINT *) Cast Very Bad I think********
//Pointer to an array of vertex indices. Each member of this array has a corresponding member
//in pWeights, such that pIndices corresponds to pWeights. The corresponding value in
//pWeights determines how much influence BoneIndex will have on the vertex indexed by pIndices.
//The size of the pIndices array must be equal to or greater than InfluenceCount.
&m_SkinWeights[bone].Weights[0]);// Pointer to an array of bone weights.
after changing the DWORD to a UINT I now get a out of memory error
//this may now be reflecting the real error dont no but.
What part is running out of memory is the question.
First-chance exception at 0x760dfd1e in RTSTowers.exe: Microsoft C++ exception: _com_error at memory location 0x001cd1d4..
First-chance exception at 0x760dfd1e in RTSTowers.exe: Microsoft C++ exception: _com_error at memory location 0x001cd4c0..
First-chance exception at 0x760dfd1e in RTSTowers.exe: Microsoft C++ exception: _com_error at memory location 0x001cd608..
First-chance exception at 0x760dfd1e in RTSTowers.exe: Microsoft C++ exception: _com_error at memory location 0x001cd720..
First-chance exception at 0x760dfd1e in RTSTowers.exe: Microsoft C++ exception: _com_error at memory location 0x001cd838..
First-chance exception at 0x760dfd1e in RTSTowers.exe: Microsoft C++ exception: _com_error at memory location 0x001cd73c..
First-chance exception at 0x760dfd1e in RTSTowers.exe: Microsoft C++ exception: _com_error at memory location 0x001cd1d4..
First-chance exception at 0x760dfd1e in RTSTowers.exe: Microsoft C++ exception: _com_error at memory location 0x001cd4c0..
First-chance exception at 0x760dfd1e in RTSTowers.exe: Microsoft C++ exception: _com_error at memory location 0x001cd608..
First-chance exception at 0x760dfd1e in RTSTowers.exe: Microsoft C++ exception: _com_error at memory location 0x001cd720..
First-chance exception at 0x760dfd1e in RTSTowers.exe: Microsoft C++ exception: _com_error at memory location 0x001cd838..
First-chance exception at 0x760dfd1e in RTSTowers.exe: Microsoft C++ exception: _com_error at memory location 0x001cd73c..
D3D10: ERROR: ID3D10Device::CreateBuffer: CreateBuffer returning E_OUTOFMEMORY, meaning memory was exhausted. [ STATE_CREATION ERROR #70: CREATEBUFFER_OUTOFMEMORY_RETURN ]