AP2 is a work‑in‑progress graphics engine written in C17. I develop it in my spare time, and the goal is to build a fully supported engine with a clear, consistent API and a straightforward codebase. It’s still early in development, but the core systems are mainly functional and the project is actively growing.
AP2 currently includes:
- Window creation and event handling
- 2D rendering (rectangles, lines, textures, sprites)
- 3D rendering (camera, meshes, lights, custom shaders)
- Keyboard, mouse, and gamepad input
- Audio/Mixer
- Text rendering (bitmap font + TTF)
- Immediate‑mode UI
- (in-dev) Further advanced UI support with customizable styling for desktop applications
- A post-processing pipeline
The engine is designed to stay readable and approachable. Most of the API uses simple structs and AP_* functions, and the internal layout is meant to be easy to follow for contributors.
- Getting started — install, build, first window
- Architecture — subsystems, modules, coordinate spaces
- API overview — map of every public header
- Materials and textures — PBR, specular-glossiness, unlit, custom
- glTF models — loading
.glb/.gltf(single-file and folder-based) - Advanced PBR — Cook-Torrance BRDF, normal/metallic-roughness/emissive maps
- Best practices — code organization, memory, performance, debugging
- Material & 3D API reference — full signatures with examples
- Hello window
- Drawing in 2D
- Textures and sprites
- Input
- Audio
- Text and fonts
- Immediate GUI
- 3D
- Shaders and post-processing
- Tilemaps
- Breakout — bricks, paddle, collision, score
- Top-down walker — WASD/gamepad, camera, spatial SFX
- Desktop tool — inspector-style GUI app
- 3D: a PBR product scene — glTF/GLB loading (incl. folder-based models), studio lighting, orbit camera, per-mesh material overrides, post-processing
- Retained-mode GUI —
AP2_GuiAdvanced: windows, layouts, theming, signals, CSS-like styling, embedded canvas widgets - Camera rigs and cinematic post — first-person/orbit rigs, screen-space picking, the full post-processing effect catalog
- Capstone: a complete application — 3D + tilemap HUD + retained GUI + spatial audio + post, wired into one app
Headers under include/AP2/ win if a tutorial and a signature disagree.
The GitHub Pages site and the wiki are published from this folder on each push.
AP2 supports both CMake and cforge.
cmake -B build cmake --build build ./build/bin/ap2
cforge build cforge run
Dependencies are included in the repository and handled automatically.
AP2 is usable for small projects, experiments, and learning. The engine is still under active development, and systems will continue to evolve. Expect breaking changes as things improve.
Some of the work planned for future versions:
- More complete text rendering
- Additional post‑processing effects
- Improved material/shader system
- More examples and documentation
- Expansion of 3D features
- General engine tooling and workflow improvements
If you have ideas or find issues, feel free to open them.
Contributions are welcome. The project is still growing, so even small improvements help — bug fixes, cleanup, documentation, examples, or focused feature work.
If you’re interested in contributing:
- Open an issue to discuss changes
- Submit a PR when ready
- Keep things simple and consistent with the existing style
I review and merge changes when I have time.
MIT License.