1
0
Fork 0
mirror of https://github.com/ocornut/imgui.git synced 2026-01-11 00:04:24 +00:00

Fonts: Fixed various small warnings / build issues.

This commit is contained in:
ocornut 2025-03-05 18:42:41 +01:00
parent dec8d3863a
commit 93410c47e1
3 changed files with 10 additions and 5 deletions

View file

@ -339,7 +339,7 @@ struct ImTextureRef
{
ImTextureRef() { memset(this, 0, sizeof(*this)); }
ImTextureRef(ImTextureID tex_id) { memset(this, 0, sizeof(*this)); _TexID = tex_id; }
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
#if !defined(IMGUI_DISABLE_OBSOLETE_FUNCTIONS) && !defined(ImTextureUserID)
ImTextureRef(void* tex_id) { memset(this, 0, sizeof(*this)); _TexID = (ImTextureID)(size_t)tex_id; } // For legacy backends casting to ImTextureID
//inline operator intptr_t() const { return (intptr_t)_TexID; } // For legacy backends casting to ImTextureID
#endif
@ -3406,7 +3406,7 @@ struct IMGUI_API ImTextureData
unsigned char* 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() const { ImTextureRef tex_ref; tex_ref._TexData = (ImTextureData*)(void*)this; tex_ref._TexID = TexID; return tex_ref; }
ImTextureRef GetTexRef() { ImTextureRef tex_ref; tex_ref._TexData = this; tex_ref._TexID = TexID; return tex_ref; }
ImTextureID GetTexID() const { return TexID; }
// Called by Renderer backend