robmar wrote:So I could just add a global counter and increment it in the grab function..

// Ensure all 3D resources freed
if ( m_pDriver )
{
// Delete all meshes
if ( m_pSmgr )
{
IAnimatedMesh *pMesh;
int i, iMl = 0;
IMeshCache* pMeshCache = m_pSmgr->getMeshCache();
if ( pMeshCache )
{
dml: s32 iMeshCount = pMeshCache->getMeshCount();
for ( i = 0; i < iMeshCount; i++ )
{
pMesh = pMeshCache->getMeshByIndex( i );
if ( pMesh )
pMeshCache->removeMesh( pMesh );
}
if ( iMl < 10 && pMeshCache->getMeshCount() )
{
iMl++;
goto dml;
}
}
else
{
ASSERT( false );
return -1;
}
m_pMeshCube = NULL; // Has now been deleted
}
pMesh = pMeshCache->getMeshByIndex( i );
u32 uMeshCount = pMeshCache->getMeshCount();
for ( u32 ui = uMeshCount; ui > 0; ui-- )
{
pMesh = pMeshCache->getMeshByIndex( ui-1 );
if ( pMesh )
pMeshCache->removeMesh( pMesh );
}

Users browsing this forum: No registered users and 1 guest