Added to iOS

not working on X11 & Wayland
This commit is contained in:
Carlos Aragones
2020-09-21 14:38:51 +02:00
parent 17c375002f
commit d9a9fe554f
6 changed files with 89 additions and 2 deletions

View File

@ -248,3 +248,25 @@ mfb_timer_init() {
g_timer_resolution = 1.0 / g_timer_frequency;
}
//-------------------------------------
void
mfb_get_monitor_dpi(struct mfb_window *window, float *dpi_x, float *dpi_y) {
(void) window;
float scale = 1.0f;
scale = [[UIScreen mainScreen] scale];
if (dpi_x) {
*dpi_x = scale;
if(*dpi_x == 0) {
*dpi_x = 1;
}
}
if (dpi_y) {
*dpi_y = scale;
if (*dpi_y == 0) {
*dpi_y = 1;
}
}
}