diff options
| author | Arslaan Pathan <[email protected]> | 2026-04-08 13:41:35 +1200 |
|---|---|---|
| committer | Arslaan Pathan <[email protected]> | 2026-04-08 13:41:35 +1200 |
| commit | c9660a840256308d4dde40613a1af3296d3fdead (patch) | |
| tree | 13e3049ea6bc6d2606bffeced7dc1ead990a1169 /include | |
| parent | 04ff8c0a6acc2cc9204492690b7f99f892ed439a (diff) | |
| download | saffron-c9660a840256308d4dde40613a1af3296d3fdead.tar.xz saffron-c9660a840256308d4dde40613a1af3296d3fdead.zip | |
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
Diffstat (limited to 'include')
| -rw-r--r-- | include/saffron_api.h | 20 | ||||
| -rw-r--r-- | include/saffron_window.h | 15 |
2 files changed, 35 insertions, 0 deletions
diff --git a/include/saffron_api.h b/include/saffron_api.h new file mode 100644 index 0000000..a993ae6 --- /dev/null +++ b/include/saffron_api.h @@ -0,0 +1,20 @@ +#ifndef SAFFRON_API_H +#define SAFFRON_API_H + +#include "saffron_widget.h" /* satisfy the lsp and also if someone includes api without the saffron.h wrapper (you lunatic) then it still works */ +#include "saffron_window.h" + +bool saffron_init(void); +void saffron_quit(void); + +void saffron_widget_draw(SaffronWidget* widget, SDL_Renderer *renderer); +void saffron_widget_add_child(SaffronWidget* parent, SaffronWidget* child); +SaffronWidget* saffron_widget_new(); /* generic primitive for generic widgets, e.g. the window root. ideally window root is a hbox/vbox/box once those are implemented */ +void saffron_widget_free(SaffronWidget* widget); + +SaffronWindow* saffron_window_new(const char* title, int w, int h); +void saffron_window_free(SaffronWindow* window); +void saffron_window_show(SaffronWindow* window); +void saffron_window_main(SaffronWindow* window); + +#endif diff --git a/include/saffron_window.h b/include/saffron_window.h index e69de29..80aaa39 100644 --- a/include/saffron_window.h +++ b/include/saffron_window.h @@ -0,0 +1,15 @@ +#ifndef SAFFRON_WINDOW_H +#define SAFFRON_WINDOW_H + +#include <SDL3/SDL.h> +#include "saffron_widget.h" + +typedef struct { + SaffronWidget *root; + SDL_Window *sdl_window; + SDL_Renderer *renderer; + int w, h; + const char* title; +} SaffronWindow; + +#endif |
