src/ascension/window.h

changeset 154
4dff9cc488fe
parent 149
560772519ff9
--- a/src/ascension/window.h	Sun Jun 15 19:50:51 2025 +0200
+++ b/src/ascension/window.h	Sun Jun 15 21:02:29 2025 +0200
@@ -58,6 +58,7 @@
     SDL_Window *window;
     asc_vec2u dimensions;
     AscGLContext glctx;
+    float ui_scale;
     AscScene ui;
     AscScene scenes[ASC_MAX_SCENES];
 } AscWindow;
@@ -140,6 +141,37 @@
  */
 AscScene *asc_window_scene(unsigned int index);
 
+/**
+ * The desktop display resolution related to the active window.
+ *
+ * @return the desktop display resolution of the display the active window is associated with
+ */
+asc_vec2u asc_window_display_resolution(void);
+
+// TODO: there is a ui.h - better move stuff there?
+
+/**
+ * Sets the UI scaling factor for the active window.
+ *
+ * @param scale the scaling factor
+ */
+void asc_ui_scale(float scale);
+
+/**
+ * Returns the current UI scaling factor for the active window.
+ *
+ * @return the scaling factor
+ */
+float asc_ui_get_scale(void);
+
+/**
+ * Automatically chooses a UI scaling factor depending on display resolution.
+ *
+ * @note you need to call this function again when the window changes the display
+ * // TODO: check if there is an SDL event when the window changes the display and implement a reaction
+ */
+void asc_ui_scale_auto(void);
+
 void asc_add_ui_node(AscSceneNode *node);
 
 #endif /* ASCENSION_WINDOW_H */

mercurial