Just a heads up to my fellow Blitzers. Clearing a surface after freeing the mesh it belongs to silently corrupts memory until your app dies in some random fashion.
I just spent 2 days trying to figure out why my new rendering code was dying in random places and for seemingly no good reason.
The problem was that I had...
FreeEntity( MyMesh )
ClearSurface( MySurf )
...and what I needed to have was...
ClearSurface( MySurf )
FreeEntity( MyMesh )
Seems obvious, but Blitz gives -no- kind of runtime error or warning about doing this. Memory is silently corrupted behind the scenes and the app will eventually die.
So be aware.
I just spent 2 days trying to figure out why my new rendering code was dying in random places and for seemingly no good reason.
The problem was that I had...
FreeEntity( MyMesh )
ClearSurface( MySurf )
...and what I needed to have was...
ClearSurface( MySurf )
FreeEntity( MyMesh )
Seems obvious, but Blitz gives -no- kind of runtime error or warning about doing this. Memory is silently corrupted behind the scenes and the app will eventually die.
So be aware.