Fonts: marked ImFontAtlas::Build() as obsolete

This commit is contained in:
ocornut
2025-06-11 15:43:07 +02:00
parent 4399599de9
commit df8450d928
4 changed files with 28 additions and 24 deletions
+3 -3
View File
@@ -3530,15 +3530,15 @@ struct ImFontAtlas
IMGUI_API void ClearFonts(); // [OBSOLETE] Clear input+output font data (same as ClearInputData() + glyphs storage, UV coordinates).
IMGUI_API void ClearTexData(); // [OBSOLETE] Clear output texture data (CPU side). Saves RAM once the texture has been copied to graphics memory.
IMGUI_API void BuildGrowTexture();
IMGUI_API void BuildCompactTexture();
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
// Build atlas, retrieve pixel data.
// User is in charge of copying the pixels into graphics memory (e.g. create a texture with your engine). Then store your texture handle with SetTexID().
// The pitch is always = Width * BytesPerPixels (1 or 4)
// Building in RGBA32 format is provided for convenience and compatibility, but note that unless you manually manipulate or copy color data into
// the texture (e.g. when using the AddCustomRect*** api), then the RGB pixels emitted will always be white (~75% of memory/bandwidth waste.
IMGUI_API bool Build(); // Build pixels data. This is called automatically for you by the GetTexData*** functions.
IMGUI_API void BuildGrowTexture();
IMGUI_API void BuildCompactTexture();
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
IMGUI_API void GetTexDataAsAlpha8(unsigned char** out_pixels, int* out_width, int* out_height, int* out_bytes_per_pixel = NULL); // 1 byte per-pixel
IMGUI_API void GetTexDataAsRGBA32(unsigned char** out_pixels, int* out_width, int* out_height, int* out_bytes_per_pixel = NULL); // 4 bytes-per-pixel
void SetTexID(ImTextureID id) { TexRef._TexData = NULL; TexRef._TexID = id; } // Called by legacy backends.