Browse Source

Textures: Fixed support for `#define ImTextureID_Invalid` to non-zero value.

ocornut 2 months ago
parent
commit
bc051dcf91
2 changed files with 4 additions and 1 deletions
  1. 3 0
      docs/CHANGELOG.txt
  2. 1 1
      imgui.h

+ 3 - 0
docs/CHANGELOG.txt

@@ -43,6 +43,9 @@ Breaking changes:
 
 
 Other changes:
 Other changes:
 
 
+- Textures: Fixed support for `#define ImTextureID_Invalid` to non-zero value:
+  ImTextureData() was incorrectly cleared with zeroes. (#8745) [@rachit7645]
+- Demo: Added "Text -> Font Size" demo section. (#8738) [@Demonese]
 - Backends: SDL3: avoid calling SDL_StartTextInput() again if already active.
 - Backends: SDL3: avoid calling SDL_StartTextInput() again if already active.
   (#8727) [@morrazzzz]
   (#8727) [@morrazzzz]
 - Backends: OSX: added ImGuiMouseCursor_Wait and ImGuiMouseCursor_Progress
 - Backends: OSX: added ImGuiMouseCursor_Wait and ImGuiMouseCursor_Progress

+ 1 - 1
imgui.h

@@ -3440,7 +3440,7 @@ struct ImTextureData
     bool                WantDestroyNextFrame;   // rw   -   // [Internal] Queued to set ImTextureStatus_WantDestroy next frame. May still be used in the current frame.
     bool                WantDestroyNextFrame;   // rw   -   // [Internal] Queued to set ImTextureStatus_WantDestroy next frame. May still be used in the current frame.
 
 
     // Functions
     // Functions
-    ImTextureData()     { memset(this, 0, sizeof(*this)); }
+    ImTextureData()     { memset(this, 0, sizeof(*this)); TexID = ImTextureID_Invalid; }
     ~ImTextureData()    { DestroyPixels(); }
     ~ImTextureData()    { DestroyPixels(); }
     IMGUI_API void      Create(ImTextureFormat format, int w, int h);
     IMGUI_API void      Create(ImTextureFormat format, int w, int h);
     IMGUI_API void      DestroyPixels();
     IMGUI_API void      DestroyPixels();