Each .h / .c duo should have one clear job.
What launches your game
Temp tests used throughout the dev process
critical speed test projects
ressources for project system
scripts for build system etc ..
Tools for the web
Loading/unloading multiple types of assets
Playing sound
2D platformer physics
Manages inputs received from the window
Wrappers over OS specific functionality (eg. filepaths)
Functions and utilites related to math that are not found in cglm
Binding everything to Wren
Rendering related functions and structs
sqlite , file system , json etc ...
- Types: PascalCase
- Fonctions: PascalCase
- Macros: UPPER_SNAKE_CASE
- Autre: snake_case
Functions that operate a struct or are part of a "module" are "noun first", examples:
WindowCreatePhysicsTickAudioLoad
Always handle errors or at least have a // TODO: handle.
- Ideally a function should not be longer than 15 lines
- If something can be extracted to a utility function, do it, and if the contents of the functions could be reused somewhere, place it somewhere appropriate and make it public
- No logical operation should be split accross multiple files (or even functions)
- You can break rules if it helps readability