aboutsummaryrefslogtreecommitdiff
path: root/state.c
diff options
context:
space:
mode:
authorFederico Angelilli <code@fedang.net>2023-11-17 13:30:38 +0100
committerFederico Angelilli <code@fedang.net>2023-11-17 13:30:38 +0100
commit41729222431449a81535b28ad27ce2620cb5819b (patch)
tree0cbbffb343bc1b942ea5527cd52f0cc53143b122 /state.c
parenta88d3a4c61f482ffeafba89910b896a92830f95f (diff)
Move all the state required for rendering in a struct
Diffstat (limited to 'state.c')
-rw-r--r--state.c21
1 files changed, 21 insertions, 0 deletions
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 <glib.h>
+
+#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