Day 17 complete

This commit is contained in:
2023-09-22 02:16:40 -04:00
parent 100cf96d4f
commit 5902aec2bf
9 changed files with 502 additions and 300 deletions

13
docs/Day 017.md Normal file
View File

@ -0,0 +1,13 @@
# Day 17
Talks about functional programming. Mostly an emphasis of not abusing global state fields or constricting the interface a state may be musted from. With the 'ideal' if performance is not heavily impacted is to use a pure function.
Like I said in Day 14 however I do want to setup a less stack-spam way to pass around data for ergonomics, so instead I'll be using static analysis with gencpp to make sure they are only used in the correct places (there will be a list of function names that are allowed to use the global state, and if it is used in any other function it will throw an error, preventing handmade from compiling).
I wish Casey used the `GetAsyncKeyState` instead of this window messaging.
(I'll be using it, not a fan of getting input callbacks from the window)
I didn't do iteration accross all controllers, I'll worry about that when I setup multiple players.
When it comes to the "controller stick averaging" and abstracting that to actions (like he did) hes bleeding into what should really be an input system with bounded actions, but he doesn't want to make an input system (so its just rapid hardcoding).
I'll do the averaging on the platform layer (for now) since it simple, but like said previously, I will not be allowing the engine layer to abstract what API devices are assigned to a "controller".