diff options
| author | 0scar <qgt268@alumni.ku.dk> | 2024-02-01 21:27:06 +0000 |
|---|---|---|
| committer | 0scar <qgt268@alumni.ku.dk> | 2024-02-05 07:04:09 +0000 |
| commit | 37a9f55ecd39f99aa800adc875555ecd613722c4 (patch) | |
| tree | d7f5913db2cb11804c2d5aa564207678932ee5be /docs | |
| parent | d8b46657425c6b806584d10fa50b11d49ba03850 (diff) | |
Fixme!
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/architechture.md | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/docs/architechture.md b/docs/architechture.md index 45d0393..787d19d 100644 --- a/docs/architechture.md +++ b/docs/architechture.md @@ -1,9 +1,8 @@ -Project & game architecture +Project & engine architecture --------------------------- -The different source files in the project is divided into several source files -within the `src` directory of this repository with a (somewhat) corresponding -name. +This document is a collection of vaguely related ideas surrounding how some of +the core functionality of the engine is designed. ## State Management [state.c](../src/state.c) @@ -30,6 +29,10 @@ while((newstate = state_update(current_state)) != STATE_Exit) { ## Input Handling [keypress.h](../src/keypress.h) +The input handling can be thought of as a stack of contexts. The method used in +the engine is further described in +["designing a robust input handling system for games"](https://www.gamedev.net/tutorials/programming/general-and-gameplay-programming/designing-a-robust-input-handling-system-for-games-r2975/) + We use a null-terminated statically allocated list of structs containing the following: * `struct Key`: Takes a `uint16 modifier` and a `uint32 key` @@ -51,7 +54,7 @@ for (int i = 0; i < len(keys) && keys[i] != NULL; i++) { time_pressed = now(); keys[i].function_down(funarg_up); - } + } } ``` And basically the same goes for keyup, except, we dont check any modifier keys, @@ -64,6 +67,10 @@ and toggling said visibility again once the key is released. ## Rendering +### Window management + +The plan is to spawn a new thread for each window. + ### Tile rendering When rendering tiles, we go by drawing walls on the floor tile, such that for |
