You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Examples: Win32+DX9/DX10/DX11/DX12: made example DPI aware by default. (docking: partial support for multi-dpi by scaling fonts + viewports but not style)
Copy file name to clipboardExpand all lines: examples/example_win32_directx10/main.cpp
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -70,6 +70,8 @@ int main(int, char**)
70
70
ImGuiStyle& style = ImGui::GetStyle();
71
71
style.FontScaleDpi = dpi_scale;
72
72
style.ScaleAllSizes(dpi_scale);
73
+
io.ConfigDpiScaleFonts = true; // [Experimental] Automatically overwrite style.FontScaleDpi when Monitor DPI changes. This will scale fonts but _NOT_ scale sizes/padding for now.
74
+
io.ConfigDpiScaleViewports = true; // [Experimental] Scale Dear ImGui and Platform Windows when Monitor DPI changes.
73
75
74
76
// When viewports are enabled we tweak WindowRounding/WindowBg so platform windows can look identical to regular ones.
75
77
if (io.ConfigFlags & ImGuiConfigFlags_ViewportsEnable)
Copy file name to clipboardExpand all lines: examples/example_win32_directx11/main.cpp
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -73,6 +73,8 @@ int main(int, char**)
73
73
ImGuiStyle& style = ImGui::GetStyle();
74
74
style.FontScaleDpi = dpi_scale;
75
75
style.ScaleAllSizes(dpi_scale);
76
+
io.ConfigDpiScaleFonts = true; // [Experimental] Automatically overwrite style.FontScaleDpi when Monitor DPI changes. This will scale fonts but _NOT_ scale sizes/padding for now.
77
+
io.ConfigDpiScaleViewports = true; // [Experimental] Scale Dear ImGui and Platform Windows when Monitor DPI changes.
76
78
77
79
// When viewports are enabled we tweak WindowRounding/WindowBg so platform windows can look identical to regular ones.
78
80
if (io.ConfigFlags & ImGuiConfigFlags_ViewportsEnable)
Copy file name to clipboardExpand all lines: examples/example_win32_directx12/main.cpp
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -149,6 +149,8 @@ int main(int, char**)
149
149
ImGuiStyle& style = ImGui::GetStyle();
150
150
style.FontScaleDpi = dpi_scale;
151
151
style.ScaleAllSizes(dpi_scale);
152
+
io.ConfigDpiScaleFonts = true; // [Experimental] Automatically overwrite style.FontScaleDpi when Monitor DPI changes. This will scale fonts but _NOT_ scale sizes/padding for now.
153
+
io.ConfigDpiScaleViewports = true; // [Experimental] Scale Dear ImGui and Platform Windows when Monitor DPI changes.
152
154
153
155
// When viewports are enabled we tweak WindowRounding/WindowBg so platform windows can look identical to regular ones.
154
156
if (io.ConfigFlags & ImGuiConfigFlags_ViewportsEnable)
Copy file name to clipboardExpand all lines: examples/example_win32_directx9/main.cpp
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -68,6 +68,8 @@ int main(int, char**)
68
68
ImGuiStyle& style = ImGui::GetStyle();
69
69
style.FontScaleDpi = dpi_scale;
70
70
style.ScaleAllSizes(dpi_scale);
71
+
io.ConfigDpiScaleFonts = true; // [Experimental] Automatically overwrite style.FontScaleDpi when Monitor DPI changes. This will scale fonts but _NOT_ scale sizes/padding for now.
72
+
io.ConfigDpiScaleViewports = true; // [Experimental] Scale Dear ImGui and Platform Windows when Monitor DPI changes.
71
73
72
74
// When viewports are enabled we tweak WindowRounding/WindowBg so platform windows can look identical to regular ones.
73
75
if (io.ConfigFlags & ImGuiConfigFlags_ViewportsEnable)
0 commit comments