From 9e5353174f00db541c1da6c77140f6c89b05431d Mon Sep 17 00:00:00 2001 From: Kuanlan Date: Thu, 4 Mar 2021 12:50:14 +0800 Subject: [PATCH] Backends: DX9: Fix handling of colored textures (#3844, #3868) (merge) --- backends/imgui_impl_dx9.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backends/imgui_impl_dx9.cpp b/backends/imgui_impl_dx9.cpp index e58aa44074c4..a64c1a282d6f 100644 --- a/backends/imgui_impl_dx9.cpp +++ b/backends/imgui_impl_dx9.cpp @@ -446,7 +446,7 @@ static bool ImGui_ImplDX9_CreateFontsTexture() unsigned char* pixels; int width, height, bytes_per_pixel; io.Fonts->GetTexDataAsRGBA32(&pixels, &width, &height, &bytes_per_pixel); - + // Convert RGBA32 to BGRA32 (because RGBA32 is not well supported by DX9 devices) #ifndef IMGUI_USE_BGRA_PACKED_COLOR if (io.Fonts->TexPixelsUseColors) @@ -471,12 +471,12 @@ static bool ImGui_ImplDX9_CreateFontsTexture() // Store our identifier io.Fonts->SetTexID((ImTextureID)g_pFontTexture); - + #ifndef IMGUI_USE_BGRA_PACKED_COLOR if (io.Fonts->TexPixelsUseColors) ImGui::MemFree(pixels); #endif - + return true; }