mirror of
https://github.com/wolfpld/tracy.git
synced 2025-03-20 07:40:02 +08: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;
|
float dpiScale = 1.f;
|
||||||
#ifdef _WIN32
|
#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
|
#endif
|
||||||
|
|
||||||
// Setup ImGui binding
|
// Setup ImGui binding
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user