Hi guys, I'm wondering why I get a crash when initializing the indices array below (bottom)-
Code:struct TerrainGroupData { TerrainGroupData(){}; TerrainGroupData(Ogre::Vector3 ** iVertices, unsigned long ** iIndices, size_t* iFaceNum, size_t* iVertNum) { vertices = iVertices; indices = iIndices; meshIndexCount = iFaceNum; meshVertexCount = iVertNum; } ~TerrainGroupData(){ delete [] vertices; delete [] indices; }; size_t *meshVertexCount; size_t *meshIndexCount; Ogre::Vector3 ** vertices; unsigned long ** indices; }; ... // using the struct in cpp file terrainGroupData.indices = new unsigned long*[1]; size_t size = 3; // resize this terrain's index buffer terrainGroupData.indices[0] = new unsigned long[size]; // crash here


Reply With Quote
Bookmarks