mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-11 00:04:24 +00:00
Textures: Add ImTextureUserID_Invalid + introducing SetTexID().
Which gives us room for potentially updating ImDrawData during render.
This commit is contained in:
parent
2cde9125d6
commit
ee357aaddf
2 changed files with 18 additions and 9 deletions
|
|
@ -2695,7 +2695,7 @@ void ImFontAtlasUpdateNewFrame(ImFontAtlas* atlas)
|
|||
|
||||
if (tex->Status == ImTextureStatus_Destroyed)
|
||||
{
|
||||
IM_ASSERT(tex->TexID == 0 && tex->BackendUserData == NULL);
|
||||
IM_ASSERT(tex->TexID == ImTextureID_Invalid && tex->BackendUserData == NULL);
|
||||
if (tex->WantDestroyNextFrame)
|
||||
remove_from_list = true; // Destroy was scheduled by us
|
||||
else
|
||||
|
|
@ -2715,7 +2715,7 @@ void ImFontAtlasUpdateNewFrame(ImFontAtlas* atlas)
|
|||
tex->UnusedFrames++;
|
||||
|
||||
// If a texture has never reached the backend, they don't need to know about it.
|
||||
if (tex->Status == ImTextureStatus_WantDestroy && tex->TexID == 0 && tex->BackendUserData == NULL)
|
||||
if (tex->Status == ImTextureStatus_WantDestroy && tex->TexID == ImTextureID_Invalid && tex->BackendUserData == NULL)
|
||||
remove_from_list = true;
|
||||
|
||||
// Remove
|
||||
|
|
@ -3518,7 +3518,7 @@ ImTextureData* ImFontAtlasBuildAddTexture(ImFontAtlas* atlas, int w, int h)
|
|||
/*if (old_tex != NULL && old_tex->Status == ImTextureStatus_WantCreate)
|
||||
{
|
||||
// Reuse texture not yet used by backend.
|
||||
IM_ASSERT(old_tex->TexID == 0 && old_tex->BackendUserData == NULL);
|
||||
IM_ASSERT(old_tex->TexID == ImTextureID_Invalid && old_tex->BackendUserData == NULL);
|
||||
old_tex->DestroyPixels();
|
||||
old_tex->Updates.clear();
|
||||
new_tex = old_tex;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue