From 0cd9acc12fe5b8d9b9477739a7a3dd3bf08a4cd5 Mon Sep 17 00:00:00 2001 From: Lephenixnoir Date: Mon, 12 Jun 2023 19:00:55 +0200 Subject: [PATCH] azur: configure azrp resolution based on azur_init() in gint --- azur/include/azur/azur.h | 6 +++--- azur/src/gint/init.cpp | 14 +++++++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/azur/include/azur/azur.h b/azur/include/azur/azur.h index fc4da1b..ca78650 100644 --- a/azur/include/azur/azur.h +++ b/azur/include/azur/azur.h @@ -12,9 +12,9 @@ AZUR_BEGIN_DECLS success, non-zero on failure. Resources allocated by azur_init() are automatically destroyed by a destructor. - On GINT_CG, the window size is fixed to 396x224 and ignored at this stage. - The rendering system can still be configured for super-resolution with - azrp_config_scale() from . */ + On GINT_CG, the window size can be 396x224, 198x112 or 132x75 and this + configures the rendering engine for super-resolution. Returns non-zero if + the size is not one of these. */ int azur_init(char const *title, int window_width, int window_height); /* azur_main_loop(): Run the update/render loop. diff --git a/azur/src/gint/init.cpp b/azur/src/gint/init.cpp index 2a327c1..b105de5 100644 --- a/azur/src/gint/init.cpp +++ b/azur/src/gint/init.cpp @@ -3,11 +3,19 @@ #include #include -int azur_init(char const *title, int window_width, int window_height) +int azur_init(char const *title, int width, int height) { (void)title; - (void)window_width; - (void)window_height; + + if(width == 396 && height == 224) + azrp_config_scale(1); + else if(width == 198 && height == 112) + azrp_config_scale(2); + else if(width == 132 && height == 75) + azrp_config_scale(3); + else + return -1; + return 0; }