Argh, this isn't hard. When you create a camera, you create it the normal way:
mesh = LoadMesh("mesh.3ds")
When you free it, you first free it, and then set it's value to 0:
FreeEntity mesh
mesh = 0
Then when you want to check if it exists, just do:
if mesh<>0 then
;code if mesh exists
else
;code if mesh NOT exists
endif
The variable mesh after loading the model is really just a 32 bit integer telling the position of the model in the memory. It's nothing more. So, just free it, and set the pointer value back to 0, so you can check if it exists later. Just make sure that you DON'T first set it to 0, and then free it, because that will cause it to try freeing a model at memory offset 0, which doesn't exists; Memory Access Violation. And don't just set it to 0 without freeing it first, cuz then it will never be unloaded, and then cause memoryleak (memory that gets used, but not freed) until the blitz appliaction closes. Also, an another common mistake is this:
mesh = LoadMesh("somemesh.3ds")
mesh = LoadMesh("anothermesh.3ds")
This will load a mesh into the memory, and put the pointer for using/freeing later into 'mesh', but then it loads an another model into the memory, and puts the pointer too into 'mesh'. That will make you loose the first pointer; you will not be able to free the first one again; memoryleak.
mesh = LoadMesh("mesh.3ds")
When you free it, you first free it, and then set it's value to 0:
FreeEntity mesh
mesh = 0
Then when you want to check if it exists, just do:
if mesh<>0 then
;code if mesh exists
else
;code if mesh NOT exists
endif
The variable mesh after loading the model is really just a 32 bit integer telling the position of the model in the memory. It's nothing more. So, just free it, and set the pointer value back to 0, so you can check if it exists later. Just make sure that you DON'T first set it to 0, and then free it, because that will cause it to try freeing a model at memory offset 0, which doesn't exists; Memory Access Violation. And don't just set it to 0 without freeing it first, cuz then it will never be unloaded, and then cause memoryleak (memory that gets used, but not freed) until the blitz appliaction closes. Also, an another common mistake is this:
mesh = LoadMesh("somemesh.3ds")
mesh = LoadMesh("anothermesh.3ds")
This will load a mesh into the memory, and put the pointer for using/freeing later into 'mesh', but then it loads an another model into the memory, and puts the pointer too into 'mesh'. That will make you loose the first pointer; you will not be able to free the first one again; memoryleak.