mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 10:41:50 +00:00
Support DPI scaling on Linux.
This commit is contained in:
parent
24c834bf8c
commit
4a33dcc1bc
@ -275,10 +275,17 @@ int main( int argc, char** argv )
|
||||
typedef UINT(*GDFS)(void);
|
||||
GDFS getDpiForSystem = nullptr;
|
||||
HMODULE dll = GetModuleHandleW(L"user32.dll");
|
||||
if (dll != INVALID_HANDLE_VALUE)
|
||||
getDpiForSystem = (GDFS)GetProcAddress(dll, "GetDpiForSystem");
|
||||
if (getDpiForSystem)
|
||||
dpiScale = getDpiForSystem() / 96.f;
|
||||
if( dll != INVALID_HANDLE_VALUE ) getDpiForSystem = (GDFS)GetProcAddress(dll, "GetDpiForSystem");
|
||||
if( getDpiForSystem ) dpiScale = getDpiForSystem() / 96.f;
|
||||
#elif defined __linux__
|
||||
auto monitor = glfwGetWindowMonitor( window );
|
||||
if( !monitor ) monitor = glfwGetPrimaryMonitor();
|
||||
if( monitor )
|
||||
{
|
||||
float x, y;
|
||||
glfwGetMonitorContentScale( monitor, &x, &y );
|
||||
dpiScale = x;
|
||||
}
|
||||
#endif
|
||||
|
||||
// Setup ImGui binding
|
||||
|
Loading…
Reference in New Issue
Block a user