aboutsummaryrefslogtreecommitdiff
path: root/docs/architechture.md
diff options
context:
space:
mode:
authoronelin <oscar@nelin.dk>2026-06-22 20:25:52 +0000
committeronelin <oscar@nelin.dk>2026-06-22 20:25:52 +0000
commitfe96bbc9bba40535a444e2bd69c30f0c8f29b326 (patch)
tree728f997952f9cc065039911d85fbe50560ad3e52 /docs/architechture.md
parentc9a3b8fcfcf534201b69fbe03b55e8bce75d1526 (diff)
docs(architechture): Add notes
Diffstat (limited to 'docs/architechture.md')
-rw-r--r--docs/architechture.md21
1 files changed, 21 insertions, 0 deletions
diff --git a/docs/architechture.md b/docs/architechture.md
index 787d19d..3c47cd2 100644
--- a/docs/architechture.md
+++ b/docs/architechture.md
@@ -4,6 +4,13 @@ Project & engine architecture
This document is a collection of vaguely related ideas surrounding how some of
the core functionality of the engine is designed.
+## State
+
+A state should define an initialization, update, and cleanup function.
+
+Optionally, it should define a `RenderStack` which allows customizing how your
+game is rendered. Use this to add shadow mapping, secondary cameras and UI.
+
## State Management [state.c](../src/state.c)
![gamestate illustration](gamestate.svg)
@@ -67,6 +74,20 @@ and toggling said visibility again once the key is released.
## Rendering
+### Custom pipelines
+
+DAW initializes GLFW, which uses a "default framebuffer". When you do not setup
+a custom renderpipeline (RenderStack), the default behaviour when you issue
+a drawcall is for DAW to render to an internal framebuffer drawn to a texture,
+which is then displayed on a fullscreen quad on the default framebuffer. You can
+then define your own "default shader" to add custom post-processing.
+
+If you define a custom pipeline, you setup one or more framebuffers, the first
+one _is_ then used by DAW in place of the "internal" one, displayed to the
+"default framebuffer" for GLFW.
+
+This allows you to add stuff like UI on a separate layer of your pipeline.
+
### Window management
The plan is to spawn a new thread for each window.