mirror of
https://github.com/Ed94/HandmadeHero.git
synced 2025-07-01 03:11:04 -07:00
Day 21 complete
This commit is contained in:
15
docs/Day 021.md
Normal file
15
docs/Day 021.md
Normal file
@ -0,0 +1,15 @@
|
||||
# Day 21
|
||||
|
||||
So I learned today the good reason why he doesn't use static variables; So that when he makes this library dynamically loaded we don't lose the state of the game on reload.
|
||||
|
||||
This day was extremely gratifying to get working.
|
||||
|
||||
I went the extra mile than what Casey did and allow for name mangled symbols (for both clang and msvc).
|
||||
It took a few more steps than his solution but I get to keep the eronomics of namespaces.
|
||||
|
||||
After the linker finishes emitting, I use the build script to parse the .map file and extract the decorated symbols I need to load in the platform layer. Those are exported to a file called `handmade_engine.symbols` and then in the platform layer I load them up using an enum as the lookup table for the line the symbol will be in the file. From there its just loading up the symbol with GetProcAddress!
|
||||
|
||||

|
||||

|
||||

|
||||

|
Reference in New Issue
Block a user