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