Closed greenfork closed 1 year ago
Yes exactly, so either put closeWindow in a try/finally or defer or let the user encapsulate in a destructor backed object.
Yes exactly, so either put closeWindow in a try/finally or defer
On top-level defers are forbidden. It might be an okay idea to wrap every example in main
.
or let the user encapsulate in a destructor backed object.
I don't think it is a nice idea to say that to the user. The users of this library might be of beginner level.
Currently another problem is that I'm not sure that we have a complete list of all possible destructors. We can't say to the user "here is a list of types you need to memorize, you don't need to unload them; here is another list which you should unload manually".
unloadVrStereoConfig I removed it, its a noop for now.
That is fine, we can add it later once it has implementation.
unloadWaveSamples just a for loop that calls unloadWaveSample, since we used seq[Wave] it was not need. unloadImageColors, unloadFontData, unloadImagePalette I think same as above
unloadFileData, unloadFileText it's hard to tell what to do with these, could we instead use std equivalents instead of LoadFile*
It is okay to use the std variant but we probably still want a destructor for it so that --gc:orc
is going to manage the memory in this case.
unloadCodepoints haven't decided what to do with codepoints yet.
This can wait for sure.
Currently another problem is that I'm not sure that we have a complete list of all possible destructors.
There is one I left out... ClearDroppedFiles and I don't think anyone has yet.
Currently crashes on exit. If I remove
closeWindow()
, doesn't crash. Probably because there's a call tounloadTexture
after the window was closed and that causes the crash.