impr: Don't create a new font texture for no reason

This commit is contained in:
WerWolv 2023-02-17 12:03:00 +01:00
parent d84dfa2c42
commit 279e085887
1 changed files with 1 additions and 16 deletions

View File

@ -761,22 +761,7 @@ namespace hex {
auto scale = ImHexApi::System::getGlobalScale(); auto scale = ImHexApi::System::getGlobalScale();
style.ScaleAllSizes(scale); style.ScaleAllSizes(scale);
io.DisplayFramebufferScale = ImVec2(scale, scale); io.DisplayFramebufferScale = ImVec2(scale, scale);
io.Fonts->SetTexID(fonts->TexID);
{
GLsizei width, height;
u8 *fontData;
io.Fonts->GetTexDataAsRGBA32(&fontData, &width, &height);
// Create new font atlas
GLuint tex;
glGenTextures(1, &tex);
glBindTexture(GL_TEXTURE_2D, tex);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, width, height, 0, GL_RGBA8, GL_UNSIGNED_INT, fontData);
io.Fonts->SetTexID(reinterpret_cast<ImTextureID>(tex));
}
style.WindowMenuButtonPosition = ImGuiDir_None; style.WindowMenuButtonPosition = ImGuiDir_None;
style.IndentSpacing = 10.0F; style.IndentSpacing = 10.0F;