diff options
| author | Arslaan Pathan <[email protected]> | 2026-05-02 18:28:22 +1200 |
|---|---|---|
| committer | Arslaan Pathan <[email protected]> | 2026-05-02 18:28:22 +1200 |
| commit | 5e43ce6764ed702bfb8fb9719051d42f1e841e34 (patch) | |
| tree | ca244ddaa5dfb45ed3aaf102deba531ff6a5ff9e /src | |
| parent | 6ad244502d1c3c09a26012c5e7fad901c95cc38e (diff) | |
| download | saffron-5e43ce6764ed702bfb8fb9719051d42f1e841e34.tar.xz saffron-5e43ce6764ed702bfb8fb9719051d42f1e841e34.zip | |
Add OpenGL as a test because webkit
Diffstat (limited to 'src')
| -rw-r--r-- | src/saffron_layout.c | 4 | ||||
| -rw-r--r-- | src/saffron_widget.c | 1 | ||||
| -rw-r--r-- | src/saffron_window.c | 4 |
3 files changed, 8 insertions, 1 deletions
diff --git a/src/saffron_layout.c b/src/saffron_layout.c index 72d915c..4601e83 100644 --- a/src/saffron_layout.c +++ b/src/saffron_layout.c @@ -58,6 +58,10 @@ void saffron_box_layout(SaffronBox* box) { child->y = y_offset; y_offset += child->h + box->spacing; } + + if (child->on_resize) { + child->on_resize(child); + } if (child->type == SAFFRON_WIDGET_BOX) { saffron_box_layout((SaffronBox*)child); diff --git a/src/saffron_widget.c b/src/saffron_widget.c index 6cb1664..ac5e300 100644 --- a/src/saffron_widget.c +++ b/src/saffron_widget.c @@ -26,6 +26,7 @@ void saffron_widget_init(SaffronWidget* widget) { widget->type = SAFFRON_WIDGET_UNKNOWN; widget->free = NULL; widget->theme = NULL; + widget->on_resize = NULL; } SaffronWidget* saffron_widget_new(void) { diff --git a/src/saffron_window.c b/src/saffron_window.c index 34da341..6c89c50 100644 --- a/src/saffron_window.c +++ b/src/saffron_window.c @@ -7,6 +7,8 @@ #include <SDL3/SDL.h> #include <SDL3_ttf/SDL_ttf.h> #include <saffron.h> +#include <SDL3/SDL_egl.h> +#include <SDL3/SDL_opengles2.h> SaffronWindow* saffron_window_new(const char* title, int w, int h) { SaffronWindow* window = malloc(sizeof(SaffronWindow)); @@ -17,7 +19,7 @@ SaffronWindow* saffron_window_new(const char* title, int w, int h) { memset(window->hooks, 0, sizeof(window->hooks)); window->hook_count = 0; - Uint32 flags = SDL_WINDOW_RESIZABLE | SDL_WINDOW_HIGH_PIXEL_DENSITY; + Uint32 flags = SDL_WINDOW_RESIZABLE | SDL_WINDOW_HIGH_PIXEL_DENSITY | SDL_WINDOW_OPENGL; window->sdl_window = SDL_CreateWindow(title, w, h, flags); window->renderer = SDL_CreateRenderer(window->sdl_window, NULL); window->root->theme = SF_MACRO_DEFAULT_THEME; |
