From 31ebccd248410cd8abe6174404319fc6ab7bcab4 Mon Sep 17 00:00:00 2001 From: brunoherbelin Date: Sat, 10 Oct 2020 10:48:39 +0200 Subject: [PATCH] Hack to prevent font oversampling for low-memory graphics card. --- ImGuiToolkit.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ImGuiToolkit.cpp b/ImGuiToolkit.cpp index 7975ed2..77f24d6 100644 --- a/ImGuiToolkit.cpp +++ b/ImGuiToolkit.cpp @@ -751,6 +751,8 @@ void ImGuiToolkit::SetFont(ImGuiToolkit::font_style style, const std::string &tt ImFontConfig font_config; fontname.copy(font_config.Name, 40); font_config.FontDataOwnedByAtlas = false; // data will be copied in font atlas + if ( max * max < 16777216 ) // hack: try to avoid font textures too larges by disabling oversamplig + oversample = 1; font_config.OversampleH = CLAMP( oversample, 1, 5 ); font_config.OversampleV = CLAMP( oversample, 1, 5 );