alcinnz
alcinnz boosted

I added hot reloading of C++ gameplay code to my game :D

This is possible because "engine" code and "gameplay" code is split into different shared libraries. So when you hit F5, it compiles a new shared library for the gameplay code and loads the new one (as well as reloading all the assets etc).

#cplusplus#gamedev #programming

Screen recording where I demonstrate changing gameplay source code and assets and hot reloading the game
Screen recording where I demonstrate changing gameplay source code and assets and hot reloading the game
alcinnz
alcinnz boosted

I was able to use precompiled headers to significantly speed up recompilation! A full rebuild of all the gameplay code used to take 4.5 seconds, on my laptop. Now that I made it pre-compile the engine headers, it does it in 1.6 seconds.

I've tried precompiled headers before and struggled to get real speed-up, but I guess this is literally the perfect case for it; every gameplay source code is gonna include the exact same engine library header 😊 #cplusplus#cpp