Skip to content

Commit

Permalink
Backends: DX9: Fix handling of colored textures (ocornut#3844, ocornu…
Browse files Browse the repository at this point in the history
…t#3868) (merge)
  • Loading branch information
Kuanlan authored and Kuanlan committed Mar 19, 2021
1 parent e2bb14d commit e114ea0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions backends/imgui_impl_dx9.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,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)
Expand All @@ -472,12 +472,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;
}

Expand Down

0 comments on commit e114ea0

Please sign in to comment.