determining entity count?
Blitz3D Forums/Blitz3D Programming/determining entity count?
| ||
Is there a way to know how many entities Blitz currently has in memory? I'm working on solving memory leaks and this would be extremely helpful. I've searched and can't find an answer to this. I know of Trisrendered(), and RuntimeStats(), but those don't have entity count info. |
| ||
No - you really should manage your entities handles in such a way that you can identify them at any point. Possibly you already know this though.... |
| ||
Of course, but the point is to find memory leaks. This means finding the source of untracked entities. The best way to find them is to keep track of how many exist at any given time in the program. I know I'm good, but I don't pretend to be so good that I remember to properly clean up every entity the first time through coding when I'm on a roll. :) |
| ||
There is a hack to iterate trough all entities, somewhere in the archives. It also allows EntityExist, and of course to count the entities while iterating. ok here: http://www.blitzbasic.com/codearcs/codearcs.php?code=2012 |
| ||
Awesome, thanks a ton. |