Internals: DrawData: Refactored chunks into a ImDrawDataBuilder we can reuse.

This commit is contained in:
omar
2018-01-15 17:48:07 +01:00
parent 061d8df033
commit 038453258e
2 changed files with 72 additions and 55 deletions

View File

@ -463,6 +463,16 @@ struct IMGUI_API ImDrawListSharedData
ImDrawListSharedData();
};
struct ImDrawDataBuilder
{
ImVector<ImDrawList*> Layers[3]; // Layered for: regular, popup, tooltip
void Clear() { for (int n = 0; n < IM_ARRAYSIZE(Layers); n++) Layers[n].resize(0); }
void ClearFreeMemory() { for (int n = 0; n < IM_ARRAYSIZE(Layers); n++) Layers[n].clear(); }
IMGUI_API void FlattenIntoSingleLayer();
IMGUI_API void SetupDrawData(ImDrawData* out_draw_data);
};
// Storage for SetNexWindow** functions
struct ImGuiNextWindowData
{
@ -547,7 +557,7 @@ struct ImGuiContext
// Render
ImDrawData DrawData; // Main ImDrawData instance to pass render information to the user
ImVector<ImDrawList*> DrawDataLists[3];
ImDrawDataBuilder DrawDataBuilder;
float ModalWindowDarkeningRatio;
ImDrawList OverlayDrawList; // Optional software render of mouse cursors, if io.MouseDrawCursor is set + a few debug overlays
ImGuiMouseCursor MouseCursor;