mirror of
https://github.com/wolfpld/tracy
synced 2025-04-29 12:23:53 +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>
|
<AdditionalDependencies>ws2_32.lib;opengl32.lib;..\..\libs\glfw\lib-vc2015\glfw3.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
<SubSystem>Windows</SubSystem>
|
<SubSystem>Windows</SubSystem>
|
||||||
</Link>
|
</Link>
|
||||||
|
<Manifest>
|
||||||
|
<EnableDpiAwareness>true</EnableDpiAwareness>
|
||||||
|
</Manifest>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
@ -85,6 +88,9 @@
|
|||||||
<AdditionalDependencies>ws2_32.lib;opengl32.lib;..\..\libs\glfw\lib-vc2015\glfw3.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<AdditionalDependencies>ws2_32.lib;opengl32.lib;..\..\libs\glfw\lib-vc2015\glfw3.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
<SubSystem>Windows</SubSystem>
|
<SubSystem>Windows</SubSystem>
|
||||||
</Link>
|
</Link>
|
||||||
|
<Manifest>
|
||||||
|
<EnableDpiAwareness>true</EnableDpiAwareness>
|
||||||
|
</Manifest>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="..\..\..\common\TracySocket.cpp" />
|
<ClCompile Include="..\..\..\common\TracySocket.cpp" />
|
||||||
|
@ -7,6 +7,10 @@
|
|||||||
#include "../nfd/nfd.h"
|
#include "../nfd/nfd.h"
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
# include <windows.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "../../server/TracyBadVersion.hpp"
|
#include "../../server/TracyBadVersion.hpp"
|
||||||
#include "../../server/TracyFileRead.hpp"
|
#include "../../server/TracyFileRead.hpp"
|
||||||
#include "../../server/TracyView.hpp"
|
#include "../../server/TracyView.hpp"
|
||||||
@ -45,6 +49,11 @@ int main( int argc, char** argv )
|
|||||||
glfwSwapInterval(1); // Enable vsync
|
glfwSwapInterval(1); // Enable vsync
|
||||||
gl3wInit();
|
gl3wInit();
|
||||||
|
|
||||||
|
float dpiScale = 1.f;
|
||||||
|
#ifdef _WIN32
|
||||||
|
dpiScale = GetDpiForSystem() / 96.f;
|
||||||
|
#endif
|
||||||
|
|
||||||
// Setup ImGui binding
|
// Setup ImGui binding
|
||||||
ImGui::CreateContext();
|
ImGui::CreateContext();
|
||||||
ImGui_ImplGlfwGL3_Init(window, true);
|
ImGui_ImplGlfwGL3_Init(window, true);
|
||||||
@ -65,7 +74,7 @@ int main( int argc, char** argv )
|
|||||||
if( stat( font, &st ) == 0 )
|
if( stat( font, &st ) == 0 )
|
||||||
{
|
{
|
||||||
ImGuiIO& io = ImGui::GetIO();
|
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