mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 10:41:50 +00:00
Dynamically import GetDpiForSystem, to support older Windows versions
This commit is contained in:
parent
0b1c2ebc8f
commit
34533ad4f1
@ -51,7 +51,13 @@ int main( int argc, char** argv )
|
||||
|
||||
float dpiScale = 1.f;
|
||||
#ifdef _WIN32
|
||||
dpiScale = GetDpiForSystem() / 96.f;
|
||||
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;
|
||||
#endif
|
||||
|
||||
// Setup ImGui binding
|
||||
|
Loading…
Reference in New Issue
Block a user