Textures: ImTextureData::GetPixels() returns void* for clarity.

This commit is contained in:
ocornut
2025-06-20 15:17:13 +02:00
parent 9a50c09172
commit 2f9c518ca8
3 changed files with 7 additions and 7 deletions
+2 -2
View File
@@ -3440,8 +3440,8 @@ struct ImTextureData
~ImTextureData() { DestroyPixels(); }
IMGUI_API void Create(ImTextureFormat format, int w, int h);
IMGUI_API void DestroyPixels();
unsigned char* GetPixels() { IM_ASSERT(Pixels != NULL); return Pixels; }
unsigned char* GetPixelsAt(int x, int y) { IM_ASSERT(Pixels != NULL); return Pixels + (x + y * Width) * BytesPerPixel; }
void* GetPixels() { IM_ASSERT(Pixels != NULL); return Pixels; }
void* GetPixelsAt(int x, int y) { IM_ASSERT(Pixels != NULL); return Pixels + (x + y * Width) * BytesPerPixel; }
int GetSizeInBytes() const { return Width * Height * BytesPerPixel; }
int GetPitch() const { return Width * BytesPerPixel; }
ImTextureRef GetTexRef() { ImTextureRef tex_ref; tex_ref._TexData = this; tex_ref._TexID = ImTextureID_Invalid; return tex_ref; }