1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-11 17:51:04 +00: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
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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)