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

Fonts: fixed support for IMGUI_STB_NAMESPACE.

This commit is contained in:
ocornut 2025-05-19 13:43:16 +02:00
parent 822903e56d
commit 3d848a886a

View file

@ -3746,13 +3746,21 @@ struct ImFontAtlasPostProcessData
int Height; int Height;
}; };
// Internal storage for incrementally packing and building a ImFontAtlas // We avoid dragging imstb_rectpack.h into public header (partly because binding generators are having issues with it)
struct stbrp_context_opaque { char data[80]; }; #ifdef IMGUI_STB_NAMESPACE
namespace IMGUI_STB_NAMESPACE { struct stbrp_node; }
typedef IMGUI_STB_NAMESPACE::stbrp_node stbrp_node_im;
#else
struct stbrp_node; struct stbrp_node;
typedef stbrp_node stbrp_node_im;
#endif
struct stbrp_context_opaque { char data[80]; };
// Internal storage for incrementally packing and building a ImFontAtlas
struct ImFontAtlasBuilder struct ImFontAtlasBuilder
{ {
stbrp_context_opaque PackContext; // Actually 'stbrp_context' but we don't want to define this in the header file. stbrp_context_opaque PackContext; // Actually 'stbrp_context' but we don't want to define this in the header file.
ImVector<stbrp_node> PackNodes; ImVector<stbrp_node_im> PackNodes;
ImVector<ImTextureRect> Rects; ImVector<ImTextureRect> Rects;
ImVector<ImFontAtlasRectEntry> RectsIndex; // ImFontAtlasRectId -> index into Rects[] ImVector<ImFontAtlasRectEntry> RectsIndex; // ImFontAtlasRectId -> index into Rects[]
ImVector<unsigned char> TempBuffer; // Misc scratch buffer ImVector<unsigned char> TempBuffer; // Misc scratch buffer