mirror of
https://github.com/CTCaer/RetroArch.git
synced 2024-12-22 18:58:21 +00:00
Create menu_display_get_dpi
This commit is contained in:
parent
a104517168
commit
c78c8c839f
@ -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)
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user