1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-14 00:55:20 +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

@@ -60,6 +60,7 @@ Hud::Hud(Client *client, LocalPlayer *player,
this->inventory = inventory;
readScalingSetting();
g_settings->registerChangedCallback("dpi_change_notifier", setting_changed_callback, this);
g_settings->registerChangedCallback("hud_scaling", setting_changed_callback, this);
for (auto &hbar_color : hbar_colors)
@@ -153,6 +154,7 @@ void Hud::readScalingSetting()
Hud::~Hud()
{
g_settings->deregisterChangedCallback("dpi_change_notifier", setting_changed_callback, this);
g_settings->deregisterChangedCallback("hud_scaling", setting_changed_callback, this);
if (m_selection_mesh)