src/window.c

changeset 231
0da563c4e39c
parent 220
6b266e907f89
--- a/src/window.c	Sun Jul 27 23:54:33 2025 +0200
+++ b/src/window.c	Mon Jul 28 23:11:30 2025 +0200
@@ -29,6 +29,7 @@
 #include "ascension/window.h"
 #include "ascension/context.h"
 
+#include <assert.h>
 #include <GL/glew.h>
 
 void asc_window_settings_init_defaults(AscWindowSettings *settings) {
@@ -210,3 +211,19 @@
     }
     return ASC_VEC2U(dm.w, dm.h);
 }
+
+float asc_window_ui_scale(unsigned int index) {
+    assert(asc_context.windows[index].window != NULL);
+    return asc_context.windows[index].ui_scale;
+}
+
+void asc_window_set_title(unsigned index, const char *title) {
+    assert(asc_context.windows[index].window != NULL);
+    SDL_SetWindowTitle(asc_context.windows[index].window, title);
+}
+
+void asc_window_set_size(unsigned index, asc_vec2u size) {
+    assert(asc_context.windows[index].window != NULL);
+    asc_context.windows[index].dimensions = size;
+    SDL_SetWindowSize(asc_context.windows[index].window, (int)size.width, (int)size.height);
+}

mercurial