Handmade Hero»Forums»Code
19 posts
day 011 : why handmade.h ?
Edited by siska on
Hi guys,

On day 011, Casey starts the separation of the platform-independent code from the platform-dependent code. He explains that with his approach (game code renders a service to the platform code), you don't really need a handmade.h file (since you include handmade.cpp in the platform code).
That seems logical to me (C/C++ noob) ... but then why is he still including a handmade.h in handmade.cpp ? :unsure:

Thanks !
511 posts
day 011 : why handmade.h ?
Because he likes to be able to put the definition of structures next to the code using them. For that it's easier to use 2 files than to clone the view.
19 posts
day 011 : why handmade.h ?
Oh ! OK ...
Thanks for explaining !