Hello Everyone,
I have made a very simple hot reloading host program, that just loads the functions start()
and frame()
from a dll and runs a game loop:
I'm then running a thread which uses ReadDirectoryChangesW
to listen for file writes and then trigger a reload which just reloads the dll and pulls the functions out again:
However, not all the time but occasionally after a reload I get a crash in PeekMessage and I can't see why this would happen.
Calling start()
and frame()
is pretty much all the host program does, so all the window creation, events loop, opengl stuff is all done in the dll which is a bit different to how Handmade Hero does it. I'm assuming some resource in the windows api is tied to the dll and might get destroyed when the dll is unloaded. But it's strange that it only happens occasionally.
I'm not sure how to debug this, or even if this kind of thing is expected to work in the first place. I haven't found any info on this on the web so far. So if anyone had some advice or is more knowledgeable about this windows stuff I'd really appreciate it.
Thanks very much!
P.S. I'm on Windows 11 and using MinGW and gcc to compile.