Try / Tempest

API abstraction layer for 3D graphics, UI and sound. Written in C++17 with Vulkan, DX12 and Metal support.
MIT License
104 stars 27 forks source link

Need to take OS scale into account when calculating resolution #67

Open KirillAlekseeenko opened 3 weeks ago

KirillAlekseeenko commented 3 weeks ago

For example, on my machine I set 125% scale and can get only 864p instead of 1080p

On Windows 11 calling SetThreadDpiAwarenessContext(DPI_AWARENESS_CONTEXT_SYSTEM_AWARE); before getting int w = GetSystemMetrics(SM_CXSCREEN), h = GetSystemMetrics(SM_CYSCREEN); works fine. But UI looks smaller and probably needs to be scaled up accordingly.

Try commented 3 weeks ago

Hi, @KirillAlekseeenko !

Dpi awareness is not implemented in engine, as I do not yet have consistent vision/idea on how engine-level api should look-like. Maybe we can keep it simple like on MacOS and provide a single getter for UI-scale; maybe it need to be complement with auto-scaling for Tempest::Widget or even Tempest::Painter.

However I must admit that problem running OpenGothic in HiDpi exist. For now only working solution would be to set INTERFACE Scale to value bigger than one, in SystemPack.ini file.