summaryrefslogtreecommitdiffhomepage
path: root/main/draw.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'main/draw.cpp')
-rw-r--r--main/draw.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/main/draw.cpp b/main/draw.cpp
index 4366fd9b..18d64675 100644
--- a/main/draw.cpp
+++ b/main/draw.cpp
@@ -198,6 +198,11 @@ void main_impl::do_update()
void main_impl::drawEvent()
{
+ _dpi_scale = 1;
+ if (int index = SDL_GetWindowDisplayIndex(window()); index >= 0)
+ if (float dpi = 96; !SDL_GetDisplayDPI(index, &dpi, nullptr, nullptr))
+ _dpi_scale = dpi / 96;
+
_shader.set_tint({1, 1, 1, 1});
{