From 191e17eaf8f106ad198e6b739d83ccd9ee9103bd Mon Sep 17 00:00:00 2001 From: ocornut Date: Sat, 15 Nov 2014 13:18:25 +0000 Subject: [PATCH] Added IMGUI_OVERRIDE_DRAWVERT_STRUCT_LAYOUT --- imgui.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/imgui.h b/imgui.h index 9be1099c..e5141438 100644 --- a/imgui.h +++ b/imgui.h @@ -405,6 +405,7 @@ enum ImGuiStyleVar_ ImGuiStyleVar_ColumnsMinSpacing, // float }; +// Enumeration for ColorEditMode() enum ImGuiColorEditMode_ { ImGuiColorEditMode_UserSelect = -1, @@ -610,12 +611,20 @@ struct ImDrawCmd ImVec4 clip_rect; }; +#ifndef IMGUI_OVERRIDE_DRAWVERT_STRUCT_LAYOUT +// Default vertex layout struct ImDrawVert { ImVec2 pos; ImVec2 uv; ImU32 col; }; +#else +// You can change the vertex format layout by defining IMGUI_OVERRIDE_DRAWVERT_STRUCT_LAYOUT. +// The code expect ImVec2 pos (8 bytes), ImVec2 uv (8 bytes), ImU32 col (4 bytes), but you can re-order them or add other fields as needed to simplify integration in your engine. +// The type has to be described by the #define (you can either declare the struct or use a typedef) +IMGUI_OVERRIDE_DRAWVERT_STRUCT_LAYOUT; +#endif // Draw command list // This is the low-level list of polygon that ImGui:: functions are filling. At the end of the frame, all command lists are passed to your ImGuiIO::RenderDrawListFn function for rendering.