diff --git a/imgui.cpp b/imgui.cpp index c6146f66e..8aab693f8 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -21337,7 +21337,10 @@ void ImGui::DebugNodeTexture(ImTextureData* tex) Checkbox("Show used rect", &cfg->ShowTextureUsedRect); PushStyleVar(ImGuiStyleVar_ImageBorderSize, ImMax(1.0f, g.Style.ImageBorderSize)); ImVec2 p = GetCursorScreenPos(); - ImageWithBg(tex->GetTexRef(), ImVec2((float)tex->Width, (float)tex->Height), ImVec2(0.0f, 0.0f), ImVec2(1.0f, 1.0f), ImVec4(0.0f, 0.0f, 0.0f, 1.0f)); + if (tex->WantDestroyNextFrame) + Dummy(ImVec2((float)tex->Width, (float)tex->Height)); + else + ImageWithBg(tex->GetTexRef(), ImVec2((float)tex->Width, (float)tex->Height), ImVec2(0.0f, 0.0f), ImVec2(1.0f, 1.0f), ImVec4(0.0f, 0.0f, 0.0f, 1.0f)); if (cfg->ShowTextureUsedRect) GetWindowDrawList()->AddRect(ImVec2(p.x + tex->UsedRect.x, p.y + tex->UsedRect.y), ImVec2(p.x + tex->UsedRect.x + tex->UsedRect.w, p.y + tex->UsedRect.y + tex->UsedRect.h), IM_COL32(255, 0, 255, 255)); PopStyleVar(); diff --git a/imgui_draw.cpp b/imgui_draw.cpp index eea063828..a08ee7458 100644 --- a/imgui_draw.cpp +++ b/imgui_draw.cpp @@ -679,6 +679,8 @@ void ImDrawList::PushTexture(ImTextureRef tex_ref) { _TextureStack.push_back(tex_ref); _CmdHeader.TexRef = tex_ref; + if (tex_ref._TexData != NULL) + IM_ASSERT(tex_ref._TexData->WantDestroyNextFrame == false); _OnChangedTextureID(); }