From c9660a840256308d4dde40613a1af3296d3fdead Mon Sep 17 00:00:00 2001 From: Arslaan Pathan Date: Wed, 8 Apr 2026 13:41:35 +1200 Subject: what (i cannot put the commit message into words) I added a lot of stuff, it dont really work fully yet but its very good stuff --- src/saffron_window.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/saffron_window.c (limited to 'src/saffron_window.c') diff --git a/src/saffron_window.c b/src/saffron_window.c new file mode 100644 index 0000000..10adfce --- /dev/null +++ b/src/saffron_window.c @@ -0,0 +1,24 @@ +#include +#include +#include +#include +#include +#include + +SaffronWindow* saffron_window_new(const char* title, int w, int h) { + SaffronWindow* window = malloc(sizeof(SaffronWindow)); + window->root = saffron_widget_new(); // frick, need to implement this. + window->title = title; + window->w = w; + window->h = h; + window->sdl_window = SDL_CreateWindow(title, w, h, SDL_WINDOW_RESIZABLE); + window->renderer = SDL_CreateRenderer(window->sdl_window, NULL); + return window; +} + +void saffron_window_free(SaffronWindow* window) { + SDL_DestroyRenderer(window->renderer); + SDL_DestroyWindow(window->sdl_window); + saffron_widget_free(window->root); + free(window); +} -- cgit v1.2.3