|
@@ -29,7 +29,7 @@
|
|
|
// Library Version
|
|
|
// (Integer encoded as XYYZZ for use in #if preprocessor conditionals, e.g. '#if IMGUI_VERSION_NUM >= 12345')
|
|
|
#define IMGUI_VERSION "1.91.4 WIP"
|
|
|
-#define IMGUI_VERSION_NUM 19132
|
|
|
+#define IMGUI_VERSION_NUM 19133
|
|
|
#define IMGUI_HAS_TABLE
|
|
|
|
|
|
/*
|
|
@@ -2953,9 +2953,11 @@ struct ImDrawCmd
|
|
|
unsigned int IdxOffset; // 4 // Start offset in index buffer.
|
|
|
unsigned int ElemCount; // 4 // Number of indices (multiple of 3) to be rendered as triangles. Vertices are stored in the callee ImDrawList's vtx_buffer[] array, indices in idx_buffer[].
|
|
|
ImDrawCallback UserCallback; // 4-8 // If != NULL, call the function instead of rendering the vertices. clip_rect and texture_id will be set normally.
|
|
|
- void* UserCallbackData; // 4-8 // The draw callback code can access this.
|
|
|
+ void* UserCallbackData; // 4-8 // Callback user data (when UserCallback != NULL). If called AddCallback() with size == 0, this is a copy of the AddCallback() argument. If called AddCallback() with size > 0, this is pointing to a buffer where data is stored.
|
|
|
+ int UserCallbackDataSize; // 4 // Size of callback user data when using storage, otherwise 0.
|
|
|
+ int UserCallbackDataOffset;// 4 // [Internal] Offset of callback user data when using storage, otherwise -1.
|
|
|
|
|
|
- ImDrawCmd() { memset(this, 0, sizeof(*this)); } // Also ensure our padding fields are zeroed
|
|
|
+ ImDrawCmd() { memset(this, 0, sizeof(*this)); } // Also ensure our padding fields are zeroed
|
|
|
|
|
|
// Since 1.83: returns ImTextureID associated with this draw call. Warning: DO NOT assume this is always same as 'TextureId' (we will change this function for an upcoming feature)
|
|
|
inline ImTextureID GetTexID() const { return TextureId; }
|
|
@@ -3068,6 +3070,7 @@ struct ImDrawList
|
|
|
ImDrawListSplitter _Splitter; // [Internal] for channels api (note: prefer using your own persistent instance of ImDrawListSplitter!)
|
|
|
ImVector<ImVec4> _ClipRectStack; // [Internal]
|
|
|
ImVector<ImTextureID> _TextureIdStack; // [Internal]
|
|
|
+ ImVector<ImU8> _CallbacksDataBuf; // [Internal]
|
|
|
float _FringeScale; // [Internal] anti-alias fringe is scaled by this value, this helps to keep things sharp while zooming at vertex buffer content
|
|
|
const char* _OwnerName; // Pointer to owner window's name for debugging
|
|
|
|
|
@@ -3140,8 +3143,18 @@ struct ImDrawList
|
|
|
IMGUI_API void PathBezierQuadraticCurveTo(const ImVec2& p2, const ImVec2& p3, int num_segments = 0); // Quadratic Bezier (3 control points)
|
|
|
IMGUI_API void PathRect(const ImVec2& rect_min, const ImVec2& rect_max, float rounding = 0.0f, ImDrawFlags flags = 0);
|
|
|
|
|
|
- // Advanced
|
|
|
- IMGUI_API void AddCallback(ImDrawCallback callback, void* callback_data); // Your rendering function must check for 'UserCallback' in ImDrawCmd and call the function instead of rendering triangles.
|
|
|
+ // Advanced: Draw Callbacks
|
|
|
+ // - May be used to alter render state (change sampler, blending, current shader). May be used to emit custom rendering commands (difficult to do correctly, but possible).
|
|
|
+ // - Use special ImDrawCallback_ResetRenderState callback to instruct backend to reset its render state to the default.
|
|
|
+ // - Your rendering loop must check for 'UserCallback' in ImDrawCmd and call the function instead of rendering triangles. All standard backends are honoring this.
|
|
|
+ // - For some backends, the callback may access selected render-states exposed by the backend in a ImGui_ImplXXXX_RenderState structure pointed to by platform_io.Renderer_RenderState.
|
|
|
+ // - IMPORTANT: please be mindful of the different level of indirection between using size==0 (copying argument) and using size>0 (copying pointed data into a buffer).
|
|
|
+ // - If userdata_size == 0: we copy/store the 'userdata' argument as-is. It will be available unmodified in ImDrawCmd::UserCallbackData during render.
|
|
|
+ // - If userdata_size > 0, we copy/store 'userdata_size' bytes pointed to by 'userdata'. We store them in a buffer stored inside the drawlist. ImDrawCmd::UserCallbackData will point inside that buffer so you have to retrieve data from there. Your callback may need to use ImDrawCmd::UserCallbackDataSize if you expect dynamically-sized data.
|
|
|
+ // - Support for userdata_size > 0 was added in v1.91.4, October 2024. So earlier code always only allowed to copy/store a simple void*.
|
|
|
+ IMGUI_API void AddCallback(ImDrawCallback callback, void* userdata, size_t userdata_size = 0);
|
|
|
+
|
|
|
+ // Advanced: Miscellaneous
|
|
|
IMGUI_API void AddDrawCmd(); // This is useful if you need to forcefully create a new draw call (to allow for dependent rendering / blending). Otherwise primitives are merged into the same draw-call as much as possible
|
|
|
IMGUI_API ImDrawList* CloneOutput() const; // Create a clone of the CmdBuffer/IdxBuffer/VtxBuffer.
|
|
|
|