Create menu_display_get_dpi

This commit is contained in:
twinaphex 2015-04-21 15:45:03 +02:00
parent a104517168
commit c78c8c839f
3 changed files with 23 additions and 8 deletions

View File

@ -601,15 +601,13 @@ static void *glui_init(void)
glui = (glui_handle_t*)menu->userdata;
float dpi = 128;
if (!gfx_ctx_get_metrics(DISPLAY_METRIC_DPI, &dpi))
dpi = 128;
float dpi = menu_display_get_dpi(menu);
glui->line_height = dpi/3;
glui->margin = dpi/6;
glui->ticker_limit = dpi/3;
menu->header_height = dpi/3;
glui->font.size = dpi/8;
glui->line_height = dpi / 3;
glui->margin = dpi / 6;
glui->ticker_limit = dpi / 3;
menu->header_height = dpi / 3;
glui->font.size = dpi / 8;
glui->textures.bg.id = 0;
if (font_driver->bind_block && font_driver->flush)

View File

@ -18,6 +18,7 @@
#include "menu_animation.h"
#include "../dynamic.h"
#include "../../retroarch.h"
#include "../gfx/video_context_driver.h"
bool menu_display_update_pending(void)
{
@ -84,3 +85,17 @@ bool menu_display_init(void *data)
return true;
}
float menu_display_get_dpi(void *data)
{
float dpi, dpi_orig = 128;
menu_handle_t *menu = (menu_handle_t*)data;
if (!menu)
return dpi_orig;
if (!gfx_ctx_get_metrics(DISPLAY_METRIC_DPI, &dpi))
dpi = dpi_orig;
return dpi;
}

View File

@ -28,6 +28,8 @@ bool menu_display_init(void *data);
bool menu_display_update_pending(void);
float menu_display_get_dpi(void *data);
#ifdef __cplusplus
}
#endif