Day 21 complete

This commit is contained in:
2023-09-26 17:26:35 -04:00
parent 1c3cf08687
commit 9220550dd4
22 changed files with 640 additions and 254 deletions

15
docs/Day 021.md Normal file
View 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!
![img](https://files.catbox.moe/sdebtc.png)
![img](https://files.catbox.moe/ufkacl.png)
![img](https://files.catbox.moe/zr52au.png)
![img](https://files.catbox.moe/g3f1vv.png)