Courtesy of Karl Zylinkski's blog on how to do hot code reloading with Odin. Find his more comprehensive template here.
Install the Odin programming language.
Build the game DLL:
odin build game -build-mode:dll -out:game.dllCompile main and run it:
odin run mainIn game/game.odin, modify game_update:
game_update :: proc() -> bool
{
- memory.some_state += 1
+ memory.some_state -= 1
fmt.println(memory.some_state)
return true
}Rebuild the game DLL:
odin build game -build-mode:dll -out:game.dllNow you're "hot relodin"!
odin build main_release