From 41729222431449a81535b28ad27ce2620cb5819b Mon Sep 17 00:00:00 2001 From: Federico Angelilli Date: Fri, 17 Nov 2023 13:30:38 +0100 Subject: Move all the state required for rendering in a struct --- state.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 state.c (limited to 'state.c') diff --git a/state.c b/state.c new file mode 100644 index 0000000..bb31fa6 --- /dev/null +++ b/state.c @@ -0,0 +1,21 @@ +#include + +#include "state.h" + +State *state_create(Window *win, Drawable *draw) +{ + State *state = g_malloc(sizeof(State)); + g_assert_nonnull(state); + + state->win = win; + state->draw = draw; + + return state; +} + +void state_destroy(State *state) +{ + g_free(state); +} + +// vim: ts=4 sw=4 et -- cgit v1.2.3