mirror of
https://github.com/wolfpld/tracy
synced 2025-04-29 04:23:51 +00:00
Viewer is now system DPI aware on windows.
This commit is contained in:
parent
4f6a3057c4
commit
ba68df329f
@ -62,6 +62,9 @@
|
||||
<AdditionalDependencies>ws2_32.lib;opengl32.lib;..\..\libs\glfw\lib-vc2015\glfw3.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
</Link>
|
||||
<Manifest>
|
||||
<EnableDpiAwareness>true</EnableDpiAwareness>
|
||||
</Manifest>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
@ -85,6 +88,9 @@
|
||||
<AdditionalDependencies>ws2_32.lib;opengl32.lib;..\..\libs\glfw\lib-vc2015\glfw3.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
</Link>
|
||||
<Manifest>
|
||||
<EnableDpiAwareness>true</EnableDpiAwareness>
|
||||
</Manifest>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\..\common\TracySocket.cpp" />
|
||||
|
@ -7,6 +7,10 @@
|
||||
#include "../nfd/nfd.h"
|
||||
#include <sys/stat.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
# include <windows.h>
|
||||
#endif
|
||||
|
||||
#include "../../server/TracyBadVersion.hpp"
|
||||
#include "../../server/TracyFileRead.hpp"
|
||||
#include "../../server/TracyView.hpp"
|
||||
@ -45,6 +49,11 @@ int main( int argc, char** argv )
|
||||
glfwSwapInterval(1); // Enable vsync
|
||||
gl3wInit();
|
||||
|
||||
float dpiScale = 1.f;
|
||||
#ifdef _WIN32
|
||||
dpiScale = GetDpiForSystem() / 96.f;
|
||||
#endif
|
||||
|
||||
// Setup ImGui binding
|
||||
ImGui::CreateContext();
|
||||
ImGui_ImplGlfwGL3_Init(window, true);
|
||||
@ -65,7 +74,7 @@ int main( int argc, char** argv )
|
||||
if( stat( font, &st ) == 0 )
|
||||
{
|
||||
ImGuiIO& io = ImGui::GetIO();
|
||||
io.Fonts->AddFontFromFileTTF( font, 15.0f );
|
||||
io.Fonts->AddFontFromFileTTF( font, 15.0f * dpiScale );
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user