summaryrefslogtreecommitdiff
path: root/src/window.h
diff options
context:
space:
mode:
authorAaditya Dhruv <[email protected]>2026-01-25 15:10:37 -0600
committerAaditya Dhruv <[email protected]>2026-01-25 15:10:37 -0600
commit118980e02e59ff31871df59dce257075394f3533 (patch)
tree26fba4492bb4b561d21bf49b35d892a821d54fab /src/window.h
parent0e6e1245b70df4dfcba135d50e1b53d1a8ef7eb8 (diff)
wip
Diffstat (limited to 'src/window.h')
-rw-r--r--src/window.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/window.h b/src/window.h
new file mode 100644
index 0000000..9a8c942
--- /dev/null
+++ b/src/window.h
@@ -0,0 +1,26 @@
+#include "SDL2/SDL.h"
+#include "SDL2/SDL_video.h"
+#include "SDL2/SDL_render.h"
+
+
+struct window {
+ SDL_Renderer* renderer;
+ SDL_Window* window;
+};
+
+/**
+ * Get a basic SDL window up and running. This also initializes the OpenGL context, sets up a renderer and stores all the relevant data in the window struct. Memory is managed externally. We usually don't even need to free that allocated memory because it lasts till program death.
+ * @param @out window destination window pointer
+ * @return 0 on success, -1 on failure
+ *
+ */
+int window_init(struct window* window);
+
+
+/**
+ * Cleanup the allocated Window and quit SDL. Basically called when the user closes the window
+ *
+ * @param window Window to close
+ *
+ */
+void window_cleanup(struct window* window);