An example that demonstrates how to implement hot reloading for a game engine and integrate it with CMake
.
hot_reloading_with_cmake.webm
The engine neeeds to be built as a dll
.
- Copy the game engine's
dll
to a new file. - Load the copied
dll
from theplatform
layer or alauncher
at runtime. - Every frame check if the original
dll
has been modified and if so unload the copieddll
and repeat the process. - In debug mode, ensure that the generated
pdb
files are named randomly to avoid locking.
- Linux.
- Windows.
sudo apt install -y cmake
- Download and install CMake (version 3.20 atleast).
- Run one of the provided scripts, for example
build_debug.sh
orbuild_debug.bat
. - Output is in
build/bin/${CONFIG}/
directory.