azur: configure azrp resolution based on azur_init() in gint

This commit is contained in:
Lephenixnoir 2023-06-12 19:00:55 +02:00
parent 2f185a36d7
commit 0cd9acc12f
Signed by: Lephenixnoir
GPG Key ID: 1BBA026E13FC0495
2 changed files with 14 additions and 6 deletions

View File

@ -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 <azur/gint/render.h>. */
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.

View File

@ -3,11 +3,19 @@
#include <gint/timer.h>
#include <gint/cpu.h>
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;
}