Changed syntax for (very rarely used) IMGUI_OVERRIDE_DRAWVERT_STRUCT_LAYOUT mechanism, instead you only need to '#define ImDrawVert MyDrawVert' to use this feature, avoiding the need to declare the entire structure within an awkward macro. Using the old macro will now error with a message pointing you to the new method. (#38, #103, #1172, #1231, #2489)
@ -97,7 +97,7 @@ struct ImDrawData; // All draw command lists required to render
structImDrawList;// A single draw command list (generally one per window, conceptually you may see this as a dynamic "mesh" builder)
structImDrawListSharedData;// Data shared among multiple draw lists (typically owned by parent ImGui context, but you may create one yourself)
structImDrawListSplitter;// Helper to split a draw list into different layers which can be drawn into out of order, then flattened back.
structImDrawVert;// A single vertex (pos + uv + col = 20 bytes by default. Override layout with IMGUI_OVERRIDE_DRAWVERT_STRUCT_LAYOUT)
structImDrawVert;// A single vertex (pos + uv + col = 20 bytes by default. You may override layout with a #define.
structImFont;// Runtime data for a single font within a parent ImFontAtlas
structImFontAtlas;// Runtime data for multiple fonts, bake multiple fonts into a single texture, TTF/OTF font loader
structImFontConfig;// Configuration data when adding a font or merging fonts
@ -1803,19 +1803,23 @@ typedef unsigned short ImDrawIdx;
#endif
// Vertex layout
#ifndef IMGUI_OVERRIDE_DRAWVERT_STRUCT_LAYOUT
// (You can override the vertex format layout by using e.g. #define ImDrawVert MyDrawVert in imconfig.h
// 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. IMPORTANT: dear imgui DOES NOT CLEAR THE STRUCTURE AND DOESN"T CALL ITS CONSTRUCTOR,
// so any field other than pos/uv/col will be uninitialized. If you add extra fields (such as a Z coordinate) you will need to either
// ignore them, either set them up yourself.)
#ifndef ImDrawVert
structImDrawVert
{
ImVec2pos;
ImVec2uv;
ImU32col;
};
#else
// You can override the vertex format layout by defining IMGUI_OVERRIDE_DRAWVERT_STRUCT_LAYOUT in imconfig.h
// 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 within the macro (you can either declare the struct or use a typedef)
// NOTE: IMGUI DOESN'T CLEAR THE STRUCTURE AND DOESN'T CALL A CONSTRUCTOR SO ANY CUSTOM FIELD WILL BE UNINITIALIZED. IF YOU ADD EXTRA FIELDS (SUCH AS A 'Z' COORDINATES) YOU WILL NEED TO CLEAR THEM DURING RENDER OR TO IGNORE THEM.
IMGUI_OVERRIDE_DRAWVERT_STRUCT_LAYOUT;
#endif
// We previously used IMGUI_OVERRIDE_DRAWVERT_STRUCT_LAYOUT that was expanded in this file. Instead please use '#define ImDrawVert MyDrawVert' [OBSOLETED in 1.71]