diff options
| author | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2022-06-24 16:55:18 +0200 |
|---|---|---|
| committer | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2022-06-26 20:00:27 +0200 |
| commit | 7c75118429596dcfd86dbefb32e9ae79585c4da0 (patch) | |
| tree | d06478b8e303d0e2729c57b079f481fbcf5b9adf /src/player/privinc | |
| parent | f17c76c4007563389188c147d4e1c766039fb686 (diff) | |
| download | rts-7c75118429596dcfd86dbefb32e9ae79585c4da0.tar.gz | |
Revamp gui component
`gui` was tighly coupled to game logic, and could not be extended for
other purposes. Therefore, a generic GUI implementation, loosely
inspired by well-known GUI frameworks such as GTK, is now provided, with
the following properties:
- Does not depend on dynamic or static memory allocation, only automatic
(i.e., stack) memory allocation required.
- Portable among existing implementations.
- Simple to extend.
- Tiny memory footprint.
`gui` is now composed by GUI elements that can be chained to form a tree
structure. This is useful e.g.: to calculate X/Y coordinates for a given
GUI element given its parent(s).
This commit also refactors the older implementation, moving
game-specific logic into `player` and making use of the new component.
Diffstat (limited to 'src/player/privinc')
| -rw-r--r-- | src/player/privinc/human_player_private.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/player/privinc/human_player_private.h b/src/player/privinc/human_player_private.h new file mode 100644 index 0000000..5d8a557 --- /dev/null +++ b/src/player/privinc/human_player_private.h @@ -0,0 +1,18 @@ +#ifndef HUMAN_PLAYER_PRIVATE_H +#define HUMAN_PLAYER_PRIVATE_H + +#include <human_player.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + +void human_player_gui_update(struct human_player *h); +int human_player_gui_render(const struct human_player *h); + +#ifdef __cplusplus +} +#endif + +#endif /* HUMAN_PLAYER_PRIVATE_H */ |
