Program clean up....

Blitz3D Forums/Blitz3D Programming/Program clean up....

luke101(Posted 2004) [#1]
Hello, I am trying to figure out if there is an easy way to release all resources when the program exits

Also wanted to know if there is a way to know when my blitz program window is minimized or not..I will appreciate any help


darklordz(Posted 2004) [#2]
loadall()

While not keyhit(1)
Renderworld
Updateworld
Flip
Wend

Freeall()
Endgraphics()

function loadall()
image = loadimage "x.bmp"
sound = loadsound "x.wav"
end function

function freeall()
freeimage(image)
freesound(sound)
end function


big10p(Posted 2004) [#3]
Or just ClearWorld. ;)

Dont think you can check window status in B3D, though. Not without using a dll, or something.


Yan(Posted 2004) [#4]
Erm...
End
YAN


Zethrax(Posted 2004) [#5]
Like Yan says, program resources are cleared automatically when the program ends.