mirror of
https://github.com/Drezil/imgui.git
synced 2024-12-25 00:56:35 +00:00
Comments
This commit is contained in:
parent
713730af0c
commit
753bf5cefe
11
imgui.h
11
imgui.h
@ -1030,6 +1030,7 @@ struct ImGuiTextEditCallbackData
|
|||||||
};
|
};
|
||||||
|
|
||||||
// ImColor() helper to implicity converts colors to either ImU32 (packed 4x1 byte) or ImVec4 (4x1 float)
|
// ImColor() helper to implicity converts colors to either ImU32 (packed 4x1 byte) or ImVec4 (4x1 float)
|
||||||
|
// Prefer using IM_COL32() macros if you want a guaranteed compile-time ImU32 for usage with ImDrawList API.
|
||||||
// Avoid storing ImColor! Store either u32 of ImVec4. This is not a full-featured color class.
|
// Avoid storing ImColor! Store either u32 of ImVec4. This is not a full-featured color class.
|
||||||
// None of the ImGui API are using ImColor directly but you can use it as a convenience to pass colors in either ImU32 or ImVec4 formats.
|
// None of the ImGui API are using ImColor directly but you can use it as a convenience to pass colors in either ImU32 or ImVec4 formats.
|
||||||
struct ImColor
|
struct ImColor
|
||||||
@ -1092,12 +1093,8 @@ struct ImGuiListClipper
|
|||||||
|
|
||||||
// Draw callbacks for advanced uses.
|
// Draw callbacks for advanced uses.
|
||||||
// NB- You most likely do NOT need to use draw callbacks just to create your own widget or customized UI rendering (you can poke into the draw list for that)
|
// NB- You most likely do NOT need to use draw callbacks just to create your own widget or customized UI rendering (you can poke into the draw list for that)
|
||||||
// Draw callback may be useful for example, if you want to render a complex 3D scene inside a UI element, change your GPU render state, etc.
|
// Draw callback may be useful for example, A) Change your GPU render state, B) render a complex 3D scene inside a UI element (without an intermediate texture/render target), etc.
|
||||||
// The expected behavior from your rendering loop is:
|
// The expected behavior from your rendering function is 'if (cmd.UserCallback != NULL) cmd.UserCallback(parent_list, cmd); else RenderTriangles()'
|
||||||
// if (cmd.UserCallback != NULL)
|
|
||||||
// cmd.UserCallback(parent_list, cmd);
|
|
||||||
// else
|
|
||||||
// RenderTriangles()
|
|
||||||
typedef void (*ImDrawCallback)(const ImDrawList* parent_list, const ImDrawCmd* cmd);
|
typedef void (*ImDrawCallback)(const ImDrawList* parent_list, const ImDrawCmd* cmd);
|
||||||
|
|
||||||
// Typically, 1 command = 1 gpu draw call (unless command is a callback)
|
// Typically, 1 command = 1 gpu draw call (unless command is a callback)
|
||||||
@ -1112,7 +1109,7 @@ struct ImDrawCmd
|
|||||||
ImDrawCmd() { ElemCount = 0; ClipRect.x = ClipRect.y = -8192.0f; ClipRect.z = ClipRect.w = +8192.0f; TextureId = NULL; UserCallback = NULL; UserCallbackData = NULL; }
|
ImDrawCmd() { ElemCount = 0; ClipRect.x = ClipRect.y = -8192.0f; ClipRect.z = ClipRect.w = +8192.0f; TextureId = NULL; UserCallback = NULL; UserCallbackData = NULL; }
|
||||||
};
|
};
|
||||||
|
|
||||||
// Vertex index (override with, e.g. '#define ImDrawIdx unsigned int' in ImConfig)
|
// Vertex index (override with '#define ImDrawIdx unsigned int' inside in imconfig.h)
|
||||||
#ifndef ImDrawIdx
|
#ifndef ImDrawIdx
|
||||||
typedef unsigned short ImDrawIdx;
|
typedef unsigned short ImDrawIdx;
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user