Why do Null objects get rendered?

BlitzMax Forums/MiniB3D Module/Why do Null objects get rendered?

siread(Posted 2007) [#1]
If I set a mesh to Null, it continues to get rendered. Is this right? Do I have to call HideEntity before deleting the mesh?


simonh(Posted 2007) [#2]
It gets rendered because a reference to it still exists in TEntity.entity_list, which is a global list of all entities. So the GC collecter never takes it away.

Use FreeEntity to delete it properly.


siread(Posted 2007) [#3]
Ah, thanks. :)


siread(Posted 2007) [#4]
I've noticed that if I FreeEntity(camera) it still exists in TEntity.entity_list, causing the program to crash on the next UpdateWorld. I am missing something?


ima747(Posted 2007) [#5]
you need atleast one camera to be able to render. and you need atleast 1 light to be able to see things as well unless you set the ambient light up


siread(Posted 2007) [#6]
I have 2 cameras though, and when I free the second one it crashes. No problem though, I can just make them both global entities.