1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-14 09:05:19 +02:00

SDL2: Support highdpi (#14703)

and handle DPI changes at runtime
This commit is contained in:
grorp
2024-06-16 17:49:42 +02:00
committed by GitHub
parent 7a64527db5
commit a9cca5e76c
12 changed files with 84 additions and 47 deletions

View File

@@ -69,6 +69,7 @@ static void dump_start_data(const GameStartData &data)
ClientLauncher::~ClientLauncher()
{
delete input;
g_settings->deregisterChangedCallback("dpi_change_notifier", setting_changed_callback, this);
g_settings->deregisterChangedCallback("gui_scaling", setting_changed_callback, this);
delete g_fontengine;
@@ -129,6 +130,7 @@ bool ClientLauncher::run(GameStartData &start_data, const Settings &cmd_args)
guienv = m_rendering_engine->get_gui_env();
config_guienv();
g_settings->registerChangedCallback("dpi_change_notifier", setting_changed_callback, this);
g_settings->registerChangedCallback("gui_scaling", setting_changed_callback, this);
g_fontengine = new FontEngine(guienv);