|
|
@ -5,7 +5,7 @@
|
|
|
|
// [X] Renderer: User texture binding. Use 'LPDIRECT3DTEXTURE9' as ImTextureID. Read the FAQ about ImTextureID!
|
|
|
|
// [X] Renderer: User texture binding. Use 'LPDIRECT3DTEXTURE9' as ImTextureID. Read the FAQ about ImTextureID!
|
|
|
|
// [X] Renderer: Support for large meshes (64k+ vertices) with 16-bit indices.
|
|
|
|
// [X] Renderer: Support for large meshes (64k+ vertices) with 16-bit indices.
|
|
|
|
|
|
|
|
|
|
|
|
// You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this.
|
|
|
|
// You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this.
|
|
|
|
// Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need.
|
|
|
|
// Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need.
|
|
|
|
// If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp.
|
|
|
|
// If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp.
|
|
|
|
// Read online: https://github.com/ocornut/imgui/tree/master/docs
|
|
|
|
// Read online: https://github.com/ocornut/imgui/tree/master/docs
|
|
|
@ -278,8 +278,8 @@ static bool ImGui_ImplDX9_CreateFontsTexture()
|
|
|
|
#ifndef IMGUI_USE_BGRA_PACKED_COLOR
|
|
|
|
#ifndef IMGUI_USE_BGRA_PACKED_COLOR
|
|
|
|
if (io.Fonts->TexPixelsUseColors)
|
|
|
|
if (io.Fonts->TexPixelsUseColors)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ImU32* dst_start = (ImU32*)ImGui::MemAlloc(width * height * bytes_per_pixel);
|
|
|
|
ImU32* dst_start = (ImU32*)ImGui::MemAlloc((size_t)width * height * bytes_per_pixel);
|
|
|
|
for (ImU32* src = (ImU32*)pixels, *dst = dst_start, *dst_end = dst_start + width * height; dst < dst_end; src++, dst++)
|
|
|
|
for (ImU32* src = (ImU32*)pixels, *dst = dst_start, *dst_end = dst_start + (size_t)width * height; dst < dst_end; src++, dst++)
|
|
|
|
*dst = IMGUI_COL_TO_DX9_ARGB(*src);
|
|
|
|
*dst = IMGUI_COL_TO_DX9_ARGB(*src);
|
|
|
|
pixels = (unsigned char*)dst_start;
|
|
|
|
pixels = (unsigned char*)dst_start;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -293,7 +293,7 @@ static bool ImGui_ImplDX9_CreateFontsTexture()
|
|
|
|
if (g_FontTexture->LockRect(0, &tex_locked_rect, NULL, 0) != D3D_OK)
|
|
|
|
if (g_FontTexture->LockRect(0, &tex_locked_rect, NULL, 0) != D3D_OK)
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
for (int y = 0; y < height; y++)
|
|
|
|
for (int y = 0; y < height; y++)
|
|
|
|
memcpy((unsigned char*)tex_locked_rect.pBits + tex_locked_rect.Pitch * y, pixels + (width * bytes_per_pixel) * y, (width * bytes_per_pixel));
|
|
|
|
memcpy((unsigned char*)tex_locked_rect.pBits + (size_t)tex_locked_rect.Pitch * y, pixels + (size_t)width * bytes_per_pixel * y, (size_t)width * bytes_per_pixel);
|
|
|
|
g_FontTexture->UnlockRect(0);
|
|
|
|
g_FontTexture->UnlockRect(0);
|
|
|
|
|
|
|
|
|
|
|
|
// Store our identifier
|
|
|
|
// Store our identifier
|
|
|
|