HandmadeHero/README.md

69 lines
2.7 KiB
Markdown
Raw Normal View History

2023-09-08 07:07:34 -07:00
# HandmadeHero
2023-10-06 10:06:40 -07:00
Any code I do for this [series](https://handmadehero.org) will be here.
2023-09-08 13:09:49 -07:00
***(Only original hand-written code will be here, no code from the series itself)***
2023-09-08 10:00:05 -07:00
## Scripts
2023-10-06 10:06:40 -07:00
* `build.ps1` - Builds the project use `.\scripts\build msvc <args> <module>` or `.\scripts\build clang <args> <module>`
* `debug` adds debug symbols, etc
* `dev` for development builds. (automatically adds debug)
2023-09-20 11:43:55 -07:00
* `optimize` for optimized builds.
2023-10-06 10:06:40 -07:00
* `verbose` gives more info on arguments passed to tools, etc.
* `module` is the module to build, can be any of `platform` or `engine` for this point in the codebase. (Eventually game will also be a separate module)
2023-09-08 10:00:05 -07:00
* `clean.ps1` - Cleans the project
2023-10-06 10:06:40 -07:00
* `update_deps.ps1` - Updates the project dependencies to their latest from their respective repos.
2023-09-09 17:30:45 -07:00
*Make sure to run `update_deps.ps1` before building for the first time.*
## Notes
Building requires msvc or llvm's clang + lld, and powershell 7
The build is done in two stages:
2023-10-06 10:06:40 -07:00
1. Build and run metaprogram to scan and generate dependent code for the module being built.
2. Build the the runtime for the module.
Module build order:
1. Engine
2. Platform
2023-09-28 12:16:22 -07:00
## Milestone
2023-09-28 10:44:43 -07:00
2023-10-06 10:06:40 -07:00
Day 30 : Moving Between Tile Maps
Features Done so far:
* Tailor made build system via powershell scripts
* Supports building the repo with msvc or clang
* Can stage codegen metaprograms to run before building the module
* Will automatically not run if app process is found (for engine module).
* Can emit exported mangled symbols for the engine module for hot-reload with the platform module without needing to use C linkage symbols or a complex hot-reload library (Live++, etc).
* Platform Layer:
* Direct Sound audio
* Keyboard & Mouse Input via GetAsyncKeyState & Win32 window messagng
* XInput controller support
* Dualsense controller support via joyshock library
* Software rendering via Win32 GDI
* Instantaneous hot reload of engine module
* Block Memory allocation via VirtualAlloc for engine module
* Memory mapped files for engine & game snapshots.
* Engine Layer:
* Take & load snapshots of either the engine's or game's memory state.
* Allows for engine or game state to be restored even if a crash occurs to exact memory state it was before.
* Basic input abstraction into hard-coded actions (``EngineActions` & `PlayerActions`)
* Record & replay input.
* (WIP) : 2D Tile Map setup
2023-09-28 10:44:43 -07:00
2023-09-18 17:16:40 -07:00
## Gallery
2023-10-06 10:07:57 -07:00
![img](docs/imgs/handmade_win32_2023-10-06_12-43-47.gif)
2023-10-01 17:23:32 -07:00
![img](docs/imgs/handmade_win32_2023-10-01_20-22-20.gif)
2023-10-06 10:06:40 -07:00
![img](docs/imgs/Code_2023-10-01_19-20-56.gif)
2023-09-28 12:16:22 -07:00
![img](docs/imgs/Code_2023-09-28_15-14-53.gif)
2023-09-24 19:37:05 -07:00
![img](https://files.catbox.moe/9zau4s.png)
2023-09-18 17:16:40 -07:00
![img](https://files.catbox.moe/b7ifa8.png)