mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-25 20:48:24 +01:00
2069 lines
99 KiB
C#
2069 lines
99 KiB
C#
// <auto-generated/>
|
|
// Generated by Brutal.ImGui.Generator; do not edit by hand.
|
|
#nullable enable
|
|
|
|
namespace Brutal.ImGuiApi
|
|
{
|
|
public static partial class ImDrawListExtensions
|
|
{
|
|
/// <summary>
|
|
/// <para>
|
|
/// Render-level scissoring. This is passed down to your render function but not used for CPU-side coarse
|
|
/// clipping. Prefer using higher-level ImGui::PushClipRect() to affect logic (hit-testing and widget
|
|
/// culling)
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3369">imgui.h:3369</see>
|
|
/// ,
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui_draw.cpp#L651">imgui_draw.cpp:651</see>
|
|
/// <br/>
|
|
/// <c>void PushClipRect(const ImVec2& clip_rect_min, const ImVec2& clip_rect_max, bool intersect_with_current_clip_rect = false)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Render-level scissoring. This is passed down to your render function but not used for CPU-side coarse
|
|
/// clipping. Prefer using higher-level ImGui::PushClipRect() to affect logic (hit-testing and widget
|
|
/// culling)
|
|
/// </para>
|
|
/// </remarks>
|
|
public static unsafe void PushClipRect(
|
|
this ImDrawListPtr target,
|
|
in float2 clipRectMin,
|
|
in float2 clipRectMax,
|
|
bool intersectWithCurrentClipRect = false
|
|
)
|
|
{
|
|
fixed (float2* clipRectMax_fixed = &clipRectMax)
|
|
{
|
|
fixed (float2* clipRectMin_fixed = &clipRectMin)
|
|
{
|
|
PInvoke.ImDrawList_PushClipRect(
|
|
target,
|
|
clipRectMin_fixed,
|
|
clipRectMax_fixed,
|
|
intersectWithCurrentClipRect
|
|
);
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3370">imgui.h:3370</see>
|
|
/// ,
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui_draw.cpp#L670">imgui_draw.cpp:670</see>
|
|
/// <br/><c>void PushClipRectFullScreen()</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe void PushClipRectFullScreen(this ImDrawListPtr target) =>
|
|
PInvoke.ImDrawList_PushClipRectFullScreen(target);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3371">imgui.h:3371</see>
|
|
/// ,
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui_draw.cpp#L675">imgui_draw.cpp:675</see>
|
|
/// <br/><c>void PopClipRect()</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe void PopClipRect(this ImDrawListPtr target) => PInvoke.ImDrawList_PopClipRect(target);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3372">imgui.h:3372</see>
|
|
/// ,
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui_draw.cpp#L682">imgui_draw.cpp:682</see>
|
|
/// <br/><c>void PushTexture(ImTextureRef tex_ref)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe void PushTexture(this ImDrawListPtr target, ImTextureRef texRef) =>
|
|
PInvoke.ImDrawList_PushTexture(target, texRef);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3373">imgui.h:3373</see>
|
|
/// ,
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui_draw.cpp#L691">imgui_draw.cpp:691</see>
|
|
/// <br/><c>void PopTexture()</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe void PopTexture(this ImDrawListPtr target) => PInvoke.ImDrawList_PopTexture(target);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3374">imgui.h:3374</see>
|
|
/// <br/><c>inline ImVec2 GetClipRectMin() const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe float2 GetClipRectMin(this ImDrawListPtr target) =>
|
|
PInvoke.ImDrawList_GetClipRectMin(target);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3375">imgui.h:3375</see>
|
|
/// <br/><c>inline ImVec2 GetClipRectMax() const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe float2 GetClipRectMax(this ImDrawListPtr target) =>
|
|
PInvoke.ImDrawList_GetClipRectMax(target);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3384">imgui.h:3384</see>
|
|
/// ,
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui_draw.cpp#L1479">imgui_draw.cpp:1479</see>
|
|
/// <br/><c>void AddLine(const ImVec2& p1, const ImVec2& p2, ImU32 col, float thickness = 1.0f)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Primitives
|
|
/// - Filled shapes must always use clockwise winding order. The anti-aliasing fringe depends on it. Counter-clockwise shapes will have "inward" anti-aliasing.
|
|
/// - For rectangular primitives, "p_min" and "p_max" represent the upper-left and lower-right corners.
|
|
/// - For circle primitives, use "num_segments == 0" to automatically calculate tessellation (preferred).
|
|
/// In older versions (until Dear ImGui 1.77) the AddCircle functions defaulted to num_segments == 12.
|
|
/// In future versions we will use textures to provide cheaper and higher-quality circles.
|
|
/// Use AddNgon() and AddNgonFilled() functions if you need to guarantee a specific number of sides.
|
|
/// </code>
|
|
/// </remarks>
|
|
public static unsafe void AddLine(
|
|
this ImDrawListPtr target,
|
|
in float2 p1,
|
|
in float2 p2,
|
|
ImColor8 col,
|
|
float thickness = 1f
|
|
)
|
|
{
|
|
fixed (float2* p2_fixed = &p2)
|
|
{
|
|
fixed (float2* p1_fixed = &p1)
|
|
{
|
|
PInvoke.ImDrawList_AddLine(target, p1_fixed, p2_fixed, col, thickness);
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// a: upper-left, b: lower-right (== upper-left + size)
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3385">imgui.h:3385</see>
|
|
/// ,
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui_draw.cpp#L1490">imgui_draw.cpp:1490</see>
|
|
/// <br/>
|
|
/// <c>void AddRect(const ImVec2& p_min, const ImVec2& p_max, ImU32 col, float rounding = 0.0f, ImDrawFlags flags = 0, float thickness = 1.0f)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Primitives
|
|
/// - Filled shapes must always use clockwise winding order. The anti-aliasing fringe depends on it. Counter-clockwise shapes will have "inward" anti-aliasing.
|
|
/// - For rectangular primitives, "p_min" and "p_max" represent the upper-left and lower-right corners.
|
|
/// - For circle primitives, use "num_segments == 0" to automatically calculate tessellation (preferred).
|
|
/// In older versions (until Dear ImGui 1.77) the AddCircle functions defaulted to num_segments == 12.
|
|
/// In future versions we will use textures to provide cheaper and higher-quality circles.
|
|
/// Use AddNgon() and AddNgonFilled() functions if you need to guarantee a specific number of sides.
|
|
/// </code>
|
|
/// <code>
|
|
/// p_min = upper-left, p_max = lower-right
|
|
/// Note we don't render 1 pixels sized rectangles properly.
|
|
/// </code>
|
|
/// </remarks>
|
|
public static unsafe void AddRect(
|
|
this ImDrawListPtr target,
|
|
in float2 pMin,
|
|
in float2 pMax,
|
|
ImColor8 col,
|
|
float rounding = 0f,
|
|
ImDrawFlags flags = default,
|
|
float thickness = 1f
|
|
)
|
|
{
|
|
fixed (float2* pMax_fixed = &pMax)
|
|
{
|
|
fixed (float2* pMin_fixed = &pMin)
|
|
{
|
|
PInvoke.ImDrawList_AddRect(target, pMin_fixed, pMax_fixed, col, rounding, flags, thickness);
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// a: upper-left, b: lower-right (== upper-left + size)
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3386">imgui.h:3386</see>
|
|
/// ,
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui_draw.cpp#L1501">imgui_draw.cpp:1501</see>
|
|
/// <br/>
|
|
/// <c>void AddRectFilled(const ImVec2& p_min, const ImVec2& p_max, ImU32 col, float rounding = 0.0f, ImDrawFlags flags = 0)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Primitives
|
|
/// - Filled shapes must always use clockwise winding order. The anti-aliasing fringe depends on it. Counter-clockwise shapes will have "inward" anti-aliasing.
|
|
/// - For rectangular primitives, "p_min" and "p_max" represent the upper-left and lower-right corners.
|
|
/// - For circle primitives, use "num_segments == 0" to automatically calculate tessellation (preferred).
|
|
/// In older versions (until Dear ImGui 1.77) the AddCircle functions defaulted to num_segments == 12.
|
|
/// In future versions we will use textures to provide cheaper and higher-quality circles.
|
|
/// Use AddNgon() and AddNgonFilled() functions if you need to guarantee a specific number of sides.
|
|
/// </code>
|
|
/// </remarks>
|
|
public static unsafe void AddRectFilled(
|
|
this ImDrawListPtr target,
|
|
in float2 pMin,
|
|
in float2 pMax,
|
|
ImColor8 col,
|
|
float rounding = 0f,
|
|
ImDrawFlags flags = default
|
|
)
|
|
{
|
|
fixed (float2* pMax_fixed = &pMax)
|
|
{
|
|
fixed (float2* pMin_fixed = &pMin)
|
|
{
|
|
PInvoke.ImDrawList_AddRectFilled(target, pMin_fixed, pMax_fixed, col, rounding, flags);
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3387">imgui.h:3387</see>
|
|
/// ,
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui_draw.cpp#L1518">imgui_draw.cpp:1518</see>
|
|
/// <br/>
|
|
/// <c>void AddRectFilledMultiColor(const ImVec2& p_min, const ImVec2& p_max, ImU32 col_upr_left, ImU32 col_upr_right, ImU32 col_bot_right, ImU32 col_bot_left)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Primitives
|
|
/// - Filled shapes must always use clockwise winding order. The anti-aliasing fringe depends on it. Counter-clockwise shapes will have "inward" anti-aliasing.
|
|
/// - For rectangular primitives, "p_min" and "p_max" represent the upper-left and lower-right corners.
|
|
/// - For circle primitives, use "num_segments == 0" to automatically calculate tessellation (preferred).
|
|
/// In older versions (until Dear ImGui 1.77) the AddCircle functions defaulted to num_segments == 12.
|
|
/// In future versions we will use textures to provide cheaper and higher-quality circles.
|
|
/// Use AddNgon() and AddNgonFilled() functions if you need to guarantee a specific number of sides.
|
|
/// </code>
|
|
/// <para>
|
|
/// p_min = upper-left, p_max = lower-right
|
|
/// </para>
|
|
/// </remarks>
|
|
public static unsafe void AddRectFilledMultiColor(
|
|
this ImDrawListPtr target,
|
|
in float2 pMin,
|
|
in float2 pMax,
|
|
uint colUprLeft,
|
|
uint colUprRight,
|
|
uint colBotRight,
|
|
uint colBotLeft
|
|
)
|
|
{
|
|
fixed (float2* pMax_fixed = &pMax)
|
|
{
|
|
fixed (float2* pMin_fixed = &pMin)
|
|
{
|
|
PInvoke.ImDrawList_AddRectFilledMultiColor(
|
|
target,
|
|
pMin_fixed,
|
|
pMax_fixed,
|
|
colUprLeft,
|
|
colUprRight,
|
|
colBotRight,
|
|
colBotLeft
|
|
);
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3388">imgui.h:3388</see>
|
|
/// ,
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui_draw.cpp#L1533">imgui_draw.cpp:1533</see>
|
|
/// <br/>
|
|
/// <c>void AddQuad(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, ImU32 col, float thickness = 1.0f)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Primitives
|
|
/// - Filled shapes must always use clockwise winding order. The anti-aliasing fringe depends on it. Counter-clockwise shapes will have "inward" anti-aliasing.
|
|
/// - For rectangular primitives, "p_min" and "p_max" represent the upper-left and lower-right corners.
|
|
/// - For circle primitives, use "num_segments == 0" to automatically calculate tessellation (preferred).
|
|
/// In older versions (until Dear ImGui 1.77) the AddCircle functions defaulted to num_segments == 12.
|
|
/// In future versions we will use textures to provide cheaper and higher-quality circles.
|
|
/// Use AddNgon() and AddNgonFilled() functions if you need to guarantee a specific number of sides.
|
|
/// </code>
|
|
/// </remarks>
|
|
public static unsafe void AddQuad(
|
|
this ImDrawListPtr target,
|
|
in float2 p1,
|
|
in float2 p2,
|
|
in float2 p3,
|
|
in float2 p4,
|
|
ImColor8 col,
|
|
float thickness = 1f
|
|
)
|
|
{
|
|
fixed (float2* p4_fixed = &p4)
|
|
{
|
|
fixed (float2* p3_fixed = &p3)
|
|
{
|
|
fixed (float2* p2_fixed = &p2)
|
|
{
|
|
fixed (float2* p1_fixed = &p1)
|
|
{
|
|
PInvoke.ImDrawList_AddQuad(target, p1_fixed, p2_fixed, p3_fixed, p4_fixed, col, thickness);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3389">imgui.h:3389</see>
|
|
/// ,
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui_draw.cpp#L1545">imgui_draw.cpp:1545</see>
|
|
/// <br/>
|
|
/// <c>void AddQuadFilled(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, ImU32 col)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Primitives
|
|
/// - Filled shapes must always use clockwise winding order. The anti-aliasing fringe depends on it. Counter-clockwise shapes will have "inward" anti-aliasing.
|
|
/// - For rectangular primitives, "p_min" and "p_max" represent the upper-left and lower-right corners.
|
|
/// - For circle primitives, use "num_segments == 0" to automatically calculate tessellation (preferred).
|
|
/// In older versions (until Dear ImGui 1.77) the AddCircle functions defaulted to num_segments == 12.
|
|
/// In future versions we will use textures to provide cheaper and higher-quality circles.
|
|
/// Use AddNgon() and AddNgonFilled() functions if you need to guarantee a specific number of sides.
|
|
/// </code>
|
|
/// </remarks>
|
|
public static unsafe void AddQuadFilled(
|
|
this ImDrawListPtr target,
|
|
in float2 p1,
|
|
in float2 p2,
|
|
in float2 p3,
|
|
in float2 p4,
|
|
ImColor8 col
|
|
)
|
|
{
|
|
fixed (float2* p4_fixed = &p4)
|
|
{
|
|
fixed (float2* p3_fixed = &p3)
|
|
{
|
|
fixed (float2* p2_fixed = &p2)
|
|
{
|
|
fixed (float2* p1_fixed = &p1)
|
|
{
|
|
PInvoke.ImDrawList_AddQuadFilled(target, p1_fixed, p2_fixed, p3_fixed, p4_fixed, col);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3390">imgui.h:3390</see>
|
|
/// ,
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui_draw.cpp#L1557">imgui_draw.cpp:1557</see>
|
|
/// <br/>
|
|
/// <c>void AddTriangle(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, ImU32 col, float thickness = 1.0f)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Primitives
|
|
/// - Filled shapes must always use clockwise winding order. The anti-aliasing fringe depends on it. Counter-clockwise shapes will have "inward" anti-aliasing.
|
|
/// - For rectangular primitives, "p_min" and "p_max" represent the upper-left and lower-right corners.
|
|
/// - For circle primitives, use "num_segments == 0" to automatically calculate tessellation (preferred).
|
|
/// In older versions (until Dear ImGui 1.77) the AddCircle functions defaulted to num_segments == 12.
|
|
/// In future versions we will use textures to provide cheaper and higher-quality circles.
|
|
/// Use AddNgon() and AddNgonFilled() functions if you need to guarantee a specific number of sides.
|
|
/// </code>
|
|
/// </remarks>
|
|
public static unsafe void AddTriangle(
|
|
this ImDrawListPtr target,
|
|
in float2 p1,
|
|
in float2 p2,
|
|
in float2 p3,
|
|
ImColor8 col,
|
|
float thickness = 1f
|
|
)
|
|
{
|
|
fixed (float2* p3_fixed = &p3)
|
|
{
|
|
fixed (float2* p2_fixed = &p2)
|
|
{
|
|
fixed (float2* p1_fixed = &p1)
|
|
{
|
|
PInvoke.ImDrawList_AddTriangle(target, p1_fixed, p2_fixed, p3_fixed, col, thickness);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3391">imgui.h:3391</see>
|
|
/// ,
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui_draw.cpp#L1568">imgui_draw.cpp:1568</see>
|
|
/// <br/>
|
|
/// <c>void AddTriangleFilled(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, ImU32 col)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Primitives
|
|
/// - Filled shapes must always use clockwise winding order. The anti-aliasing fringe depends on it. Counter-clockwise shapes will have "inward" anti-aliasing.
|
|
/// - For rectangular primitives, "p_min" and "p_max" represent the upper-left and lower-right corners.
|
|
/// - For circle primitives, use "num_segments == 0" to automatically calculate tessellation (preferred).
|
|
/// In older versions (until Dear ImGui 1.77) the AddCircle functions defaulted to num_segments == 12.
|
|
/// In future versions we will use textures to provide cheaper and higher-quality circles.
|
|
/// Use AddNgon() and AddNgonFilled() functions if you need to guarantee a specific number of sides.
|
|
/// </code>
|
|
/// </remarks>
|
|
public static unsafe void AddTriangleFilled(
|
|
this ImDrawListPtr target,
|
|
in float2 p1,
|
|
in float2 p2,
|
|
in float2 p3,
|
|
ImColor8 col
|
|
)
|
|
{
|
|
fixed (float2* p3_fixed = &p3)
|
|
{
|
|
fixed (float2* p2_fixed = &p2)
|
|
{
|
|
fixed (float2* p1_fixed = &p1)
|
|
{
|
|
PInvoke.ImDrawList_AddTriangleFilled(target, p1_fixed, p2_fixed, p3_fixed, col);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3392">imgui.h:3392</see>
|
|
/// ,
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui_draw.cpp#L1579">imgui_draw.cpp:1579</see>
|
|
/// <br/>
|
|
/// <c>void AddCircle(const ImVec2& center, float radius, ImU32 col, int num_segments = 0, float thickness = 1.0f)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Primitives
|
|
/// - Filled shapes must always use clockwise winding order. The anti-aliasing fringe depends on it. Counter-clockwise shapes will have "inward" anti-aliasing.
|
|
/// - For rectangular primitives, "p_min" and "p_max" represent the upper-left and lower-right corners.
|
|
/// - For circle primitives, use "num_segments == 0" to automatically calculate tessellation (preferred).
|
|
/// In older versions (until Dear ImGui 1.77) the AddCircle functions defaulted to num_segments == 12.
|
|
/// In future versions we will use textures to provide cheaper and higher-quality circles.
|
|
/// Use AddNgon() and AddNgonFilled() functions if you need to guarantee a specific number of sides.
|
|
/// </code>
|
|
/// </remarks>
|
|
public static unsafe void AddCircle(
|
|
this ImDrawListPtr target,
|
|
in float2 center,
|
|
float radius,
|
|
ImColor8 col,
|
|
int numSegments = 0,
|
|
float thickness = 1f
|
|
)
|
|
{
|
|
fixed (float2* center_fixed = ¢er)
|
|
{
|
|
PInvoke.ImDrawList_AddCircle(target, center_fixed, radius, col, numSegments, thickness);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3393">imgui.h:3393</see>
|
|
/// ,
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui_draw.cpp#L1603">imgui_draw.cpp:1603</see>
|
|
/// <br/>
|
|
/// <c>void AddCircleFilled(const ImVec2& center, float radius, ImU32 col, int num_segments = 0)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Primitives
|
|
/// - Filled shapes must always use clockwise winding order. The anti-aliasing fringe depends on it. Counter-clockwise shapes will have "inward" anti-aliasing.
|
|
/// - For rectangular primitives, "p_min" and "p_max" represent the upper-left and lower-right corners.
|
|
/// - For circle primitives, use "num_segments == 0" to automatically calculate tessellation (preferred).
|
|
/// In older versions (until Dear ImGui 1.77) the AddCircle functions defaulted to num_segments == 12.
|
|
/// In future versions we will use textures to provide cheaper and higher-quality circles.
|
|
/// Use AddNgon() and AddNgonFilled() functions if you need to guarantee a specific number of sides.
|
|
/// </code>
|
|
/// </remarks>
|
|
public static unsafe void AddCircleFilled(
|
|
this ImDrawListPtr target,
|
|
in float2 center,
|
|
float radius,
|
|
ImColor8 col,
|
|
int numSegments = 0
|
|
)
|
|
{
|
|
fixed (float2* center_fixed = ¢er)
|
|
{
|
|
PInvoke.ImDrawList_AddCircleFilled(target, center_fixed, radius, col, numSegments);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3394">imgui.h:3394</see>
|
|
/// ,
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui_draw.cpp#L1628">imgui_draw.cpp:1628</see>
|
|
/// <br/>
|
|
/// <c>void AddNgon(const ImVec2& center, float radius, ImU32 col, int num_segments, float thickness = 1.0f)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Primitives
|
|
/// - Filled shapes must always use clockwise winding order. The anti-aliasing fringe depends on it. Counter-clockwise shapes will have "inward" anti-aliasing.
|
|
/// - For rectangular primitives, "p_min" and "p_max" represent the upper-left and lower-right corners.
|
|
/// - For circle primitives, use "num_segments == 0" to automatically calculate tessellation (preferred).
|
|
/// In older versions (until Dear ImGui 1.77) the AddCircle functions defaulted to num_segments == 12.
|
|
/// In future versions we will use textures to provide cheaper and higher-quality circles.
|
|
/// Use AddNgon() and AddNgonFilled() functions if you need to guarantee a specific number of sides.
|
|
/// </code>
|
|
/// <para>
|
|
/// Guaranteed to honor 'num_segments'
|
|
/// </para>
|
|
/// </remarks>
|
|
public static unsafe void AddNgon(
|
|
this ImDrawListPtr target,
|
|
in float2 center,
|
|
float radius,
|
|
ImColor8 col,
|
|
int numSegments,
|
|
float thickness = 1f
|
|
)
|
|
{
|
|
fixed (float2* center_fixed = ¢er)
|
|
{
|
|
PInvoke.ImDrawList_AddNgon(target, center_fixed, radius, col, numSegments, thickness);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3395">imgui.h:3395</see>
|
|
/// ,
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui_draw.cpp#L1640">imgui_draw.cpp:1640</see>
|
|
/// <br/><c>void AddNgonFilled(const ImVec2& center, float radius, ImU32 col, int num_segments)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Primitives
|
|
/// - Filled shapes must always use clockwise winding order. The anti-aliasing fringe depends on it. Counter-clockwise shapes will have "inward" anti-aliasing.
|
|
/// - For rectangular primitives, "p_min" and "p_max" represent the upper-left and lower-right corners.
|
|
/// - For circle primitives, use "num_segments == 0" to automatically calculate tessellation (preferred).
|
|
/// In older versions (until Dear ImGui 1.77) the AddCircle functions defaulted to num_segments == 12.
|
|
/// In future versions we will use textures to provide cheaper and higher-quality circles.
|
|
/// Use AddNgon() and AddNgonFilled() functions if you need to guarantee a specific number of sides.
|
|
/// </code>
|
|
/// <para>
|
|
/// Guaranteed to honor 'num_segments'
|
|
/// </para>
|
|
/// </remarks>
|
|
public static unsafe void AddNgonFilled(
|
|
this ImDrawListPtr target,
|
|
in float2 center,
|
|
float radius,
|
|
ImColor8 col,
|
|
int numSegments
|
|
)
|
|
{
|
|
fixed (float2* center_fixed = ¢er)
|
|
{
|
|
PInvoke.ImDrawList_AddNgonFilled(target, center_fixed, radius, col, numSegments);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3396">imgui.h:3396</see>
|
|
/// ,
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui_draw.cpp#L1652">imgui_draw.cpp:1652</see>
|
|
/// <br/>
|
|
/// <c>void AddEllipse(const ImVec2& center, const ImVec2& radius, ImU32 col, float rot = 0.0f, int num_segments = 0, float thickness = 1.0f)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Primitives
|
|
/// - Filled shapes must always use clockwise winding order. The anti-aliasing fringe depends on it. Counter-clockwise shapes will have "inward" anti-aliasing.
|
|
/// - For rectangular primitives, "p_min" and "p_max" represent the upper-left and lower-right corners.
|
|
/// - For circle primitives, use "num_segments == 0" to automatically calculate tessellation (preferred).
|
|
/// In older versions (until Dear ImGui 1.77) the AddCircle functions defaulted to num_segments == 12.
|
|
/// In future versions we will use textures to provide cheaper and higher-quality circles.
|
|
/// Use AddNgon() and AddNgonFilled() functions if you need to guarantee a specific number of sides.
|
|
/// </code>
|
|
/// <para>
|
|
/// Ellipse
|
|
/// </para>
|
|
/// </remarks>
|
|
public static unsafe void AddEllipse(
|
|
this ImDrawListPtr target,
|
|
in float2 center,
|
|
in float2 radius,
|
|
ImColor8 col,
|
|
float rot = 0f,
|
|
int numSegments = 0,
|
|
float thickness = 1f
|
|
)
|
|
{
|
|
fixed (float2* radius_fixed = &radius)
|
|
{
|
|
fixed (float2* center_fixed = ¢er)
|
|
{
|
|
PInvoke.ImDrawList_AddEllipse(target, center_fixed, radius_fixed, col, rot, numSegments, thickness);
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3397">imgui.h:3397</see>
|
|
/// ,
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui_draw.cpp#L1666">imgui_draw.cpp:1666</see>
|
|
/// <br/>
|
|
/// <c>void AddEllipseFilled(const ImVec2& center, const ImVec2& radius, ImU32 col, float rot = 0.0f, int num_segments = 0)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Primitives
|
|
/// - Filled shapes must always use clockwise winding order. The anti-aliasing fringe depends on it. Counter-clockwise shapes will have "inward" anti-aliasing.
|
|
/// - For rectangular primitives, "p_min" and "p_max" represent the upper-left and lower-right corners.
|
|
/// - For circle primitives, use "num_segments == 0" to automatically calculate tessellation (preferred).
|
|
/// In older versions (until Dear ImGui 1.77) the AddCircle functions defaulted to num_segments == 12.
|
|
/// In future versions we will use textures to provide cheaper and higher-quality circles.
|
|
/// Use AddNgon() and AddNgonFilled() functions if you need to guarantee a specific number of sides.
|
|
/// </code>
|
|
/// </remarks>
|
|
public static unsafe void AddEllipseFilled(
|
|
this ImDrawListPtr target,
|
|
in float2 center,
|
|
in float2 radius,
|
|
ImColor8 col,
|
|
float rot = 0f,
|
|
int numSegments = 0
|
|
)
|
|
{
|
|
fixed (float2* radius_fixed = &radius)
|
|
{
|
|
fixed (float2* center_fixed = ¢er)
|
|
{
|
|
PInvoke.ImDrawList_AddEllipseFilled(target, center_fixed, radius_fixed, col, rot, numSegments);
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3398">imgui.h:3398</see>
|
|
/// ,
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui_draw.cpp#L1729">imgui_draw.cpp:1729</see>
|
|
/// <br/>
|
|
/// <c>void AddText(const ImVec2& pos, ImU32 col, const char* text_begin, const char* text_end = NULL)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Primitives
|
|
/// - Filled shapes must always use clockwise winding order. The anti-aliasing fringe depends on it. Counter-clockwise shapes will have "inward" anti-aliasing.
|
|
/// - For rectangular primitives, "p_min" and "p_max" represent the upper-left and lower-right corners.
|
|
/// - For circle primitives, use "num_segments == 0" to automatically calculate tessellation (preferred).
|
|
/// In older versions (until Dear ImGui 1.77) the AddCircle functions defaulted to num_segments == 12.
|
|
/// In future versions we will use textures to provide cheaper and higher-quality circles.
|
|
/// Use AddNgon() and AddNgonFilled() functions if you need to guarantee a specific number of sides.
|
|
/// </code>
|
|
/// </remarks>
|
|
public static unsafe void AddText(this ImDrawListPtr target, in float2 pos, ImColor8 col, ImString text)
|
|
{
|
|
fixed (byte* text_fixed = text)
|
|
{
|
|
fixed (float2* pos_fixed = &pos)
|
|
{
|
|
PInvoke.ImDrawList_AddText_0(target, pos_fixed, col, text_fixed, text_fixed + text.Length);
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3399">imgui.h:3399</see>
|
|
/// ,
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui_draw.cpp#L1702">imgui_draw.cpp:1702</see>
|
|
/// <br/>
|
|
/// <c>void AddText(ImFont* font, float font_size, const ImVec2& pos, ImU32 col, const char* text_begin, const char* text_end = NULL, float wrap_width = 0.0f, const ImVec4* cpu_fine_clip_rect = NULL)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Primitives
|
|
/// - Filled shapes must always use clockwise winding order. The anti-aliasing fringe depends on it. Counter-clockwise shapes will have "inward" anti-aliasing.
|
|
/// - For rectangular primitives, "p_min" and "p_max" represent the upper-left and lower-right corners.
|
|
/// - For circle primitives, use "num_segments == 0" to automatically calculate tessellation (preferred).
|
|
/// In older versions (until Dear ImGui 1.77) the AddCircle functions defaulted to num_segments == 12.
|
|
/// In future versions we will use textures to provide cheaper and higher-quality circles.
|
|
/// Use AddNgon() and AddNgonFilled() functions if you need to guarantee a specific number of sides.
|
|
/// </code>
|
|
/// </remarks>
|
|
public static unsafe void AddText(
|
|
this ImDrawListPtr target,
|
|
ImFontPtr font,
|
|
float fontSize,
|
|
in float2 pos,
|
|
ImColor8 col,
|
|
ImString text,
|
|
float wrapWidth = 0f,
|
|
in float4? cpuFineClipRect = null
|
|
)
|
|
{
|
|
var cpuFineClipRect_ptr = cpuFineClipRect is { } cpuFineClipRect_value ? &cpuFineClipRect_value : null;
|
|
fixed (byte* text_fixed = text)
|
|
{
|
|
fixed (float2* pos_fixed = &pos)
|
|
{
|
|
PInvoke.ImDrawList_AddText_1(
|
|
target,
|
|
font,
|
|
fontSize,
|
|
pos_fixed,
|
|
col,
|
|
text_fixed,
|
|
text_fixed + text.Length,
|
|
wrapWidth,
|
|
(float4*)cpuFineClipRect_ptr
|
|
);
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Cubic Bezier (4 control points)
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3400">imgui.h:3400</see>
|
|
/// ,
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui_draw.cpp#L1681">imgui_draw.cpp:1681</see>
|
|
/// <br/>
|
|
/// <c>void AddBezierCubic(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, ImU32 col, float thickness, int num_segments = 0)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Primitives
|
|
/// - Filled shapes must always use clockwise winding order. The anti-aliasing fringe depends on it. Counter-clockwise shapes will have "inward" anti-aliasing.
|
|
/// - For rectangular primitives, "p_min" and "p_max" represent the upper-left and lower-right corners.
|
|
/// - For circle primitives, use "num_segments == 0" to automatically calculate tessellation (preferred).
|
|
/// In older versions (until Dear ImGui 1.77) the AddCircle functions defaulted to num_segments == 12.
|
|
/// In future versions we will use textures to provide cheaper and higher-quality circles.
|
|
/// Use AddNgon() and AddNgonFilled() functions if you need to guarantee a specific number of sides.
|
|
/// </code>
|
|
/// <para>
|
|
/// Cubic Bezier takes 4 controls points
|
|
/// </para>
|
|
/// </remarks>
|
|
public static unsafe void AddBezierCubic(
|
|
this ImDrawListPtr target,
|
|
in float2 p1,
|
|
in float2 p2,
|
|
in float2 p3,
|
|
in float2 p4,
|
|
ImColor8 col,
|
|
float thickness,
|
|
int numSegments = 0
|
|
)
|
|
{
|
|
fixed (float2* p4_fixed = &p4)
|
|
{
|
|
fixed (float2* p3_fixed = &p3)
|
|
{
|
|
fixed (float2* p2_fixed = &p2)
|
|
{
|
|
fixed (float2* p1_fixed = &p1)
|
|
{
|
|
PInvoke.ImDrawList_AddBezierCubic(
|
|
target,
|
|
p1_fixed,
|
|
p2_fixed,
|
|
p3_fixed,
|
|
p4_fixed,
|
|
col,
|
|
thickness,
|
|
numSegments
|
|
);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Quadratic Bezier (3 control points)
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3401">imgui.h:3401</see>
|
|
/// ,
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui_draw.cpp#L1692">imgui_draw.cpp:1692</see>
|
|
/// <br/>
|
|
/// <c>void AddBezierQuadratic(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, ImU32 col, float thickness, int num_segments = 0)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Primitives
|
|
/// - Filled shapes must always use clockwise winding order. The anti-aliasing fringe depends on it. Counter-clockwise shapes will have "inward" anti-aliasing.
|
|
/// - For rectangular primitives, "p_min" and "p_max" represent the upper-left and lower-right corners.
|
|
/// - For circle primitives, use "num_segments == 0" to automatically calculate tessellation (preferred).
|
|
/// In older versions (until Dear ImGui 1.77) the AddCircle functions defaulted to num_segments == 12.
|
|
/// In future versions we will use textures to provide cheaper and higher-quality circles.
|
|
/// Use AddNgon() and AddNgonFilled() functions if you need to guarantee a specific number of sides.
|
|
/// </code>
|
|
/// <para>
|
|
/// Quadratic Bezier takes 3 controls points
|
|
/// </para>
|
|
/// </remarks>
|
|
public static unsafe void AddBezierQuadratic(
|
|
this ImDrawListPtr target,
|
|
in float2 p1,
|
|
in float2 p2,
|
|
in float2 p3,
|
|
ImColor8 col,
|
|
float thickness,
|
|
int numSegments = 0
|
|
)
|
|
{
|
|
fixed (float2* p3_fixed = &p3)
|
|
{
|
|
fixed (float2* p2_fixed = &p2)
|
|
{
|
|
fixed (float2* p1_fixed = &p1)
|
|
{
|
|
PInvoke.ImDrawList_AddBezierQuadratic(
|
|
target,
|
|
p1_fixed,
|
|
p2_fixed,
|
|
p3_fixed,
|
|
col,
|
|
thickness,
|
|
numSegments
|
|
);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3406">imgui.h:3406</see>
|
|
/// ,
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui_draw.cpp#L801">imgui_draw.cpp:801</see>
|
|
/// <br/>
|
|
/// <c>void AddPolyline(const ImVec2* points, int num_points, ImU32 col, ImDrawFlags flags, float thickness)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// General polygon
|
|
/// - Only simple polygons are supported by filling functions (no self-intersections, no holes).
|
|
/// - Concave polygon fill is more expensive than convex one: it has O(N^2) complexity. Provided as a convenience for the user but not used by the main library.
|
|
/// </code>
|
|
/// <code>
|
|
/// TODO: Thickness anti-aliased lines cap are missing their AA fringe.
|
|
/// We avoid using the ImVec2 math operators here to reduce cost to a minimum for debug/non-inlined builds.
|
|
/// </code>
|
|
/// </remarks>
|
|
public static unsafe void AddPolyline(
|
|
this ImDrawListPtr target,
|
|
ReadOnlySpan<float2> points,
|
|
ImColor8 col,
|
|
ImDrawFlags flags,
|
|
float thickness
|
|
)
|
|
{
|
|
fixed (float2* points_fixed = points)
|
|
{
|
|
PInvoke.ImDrawList_AddPolyline(target, points_fixed, points.Length, col, flags, thickness);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3407">imgui.h:3407</see>
|
|
/// ,
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui_draw.cpp#L1059">imgui_draw.cpp:1059</see>
|
|
/// <br/><c>void AddConvexPolyFilled(const ImVec2* points, int num_points, ImU32 col)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// General polygon
|
|
/// - Only simple polygons are supported by filling functions (no self-intersections, no holes).
|
|
/// - Concave polygon fill is more expensive than convex one: it has O(N^2) complexity. Provided as a convenience for the user but not used by the main library.
|
|
/// </code>
|
|
/// <code>
|
|
/// - We intentionally avoid using ImVec2 and its math operators here to reduce cost to a minimum for debug/non-inlined builds.
|
|
/// - Filled shapes must always use clockwise winding order. The anti-aliasing fringe depends on it. Counter-clockwise shapes will have "inward" anti-aliasing.
|
|
/// </code>
|
|
/// </remarks>
|
|
public static unsafe void AddConvexPolyFilled(
|
|
this ImDrawListPtr target,
|
|
ReadOnlySpan<float2> points,
|
|
ImColor8 col
|
|
)
|
|
{
|
|
fixed (float2* points_fixed = points)
|
|
{
|
|
PInvoke.ImDrawList_AddConvexPolyFilled(target, points_fixed, points.Length, col);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3408">imgui.h:3408</see>
|
|
/// ,
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui_draw.cpp#L2013">imgui_draw.cpp:2013</see>
|
|
/// <br/><c>void AddConcavePolyFilled(const ImVec2* points, int num_points, ImU32 col)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// General polygon
|
|
/// - Only simple polygons are supported by filling functions (no self-intersections, no holes).
|
|
/// - Concave polygon fill is more expensive than convex one: it has O(N^2) complexity. Provided as a convenience for the user but not used by the main library.
|
|
/// </code>
|
|
/// <code>
|
|
/// Use ear-clipping algorithm to triangulate a simple polygon (no self-interaction, no holes).
|
|
/// (Reminder: we don't perform any coarse clipping/culling in ImDrawList layer!
|
|
/// It is up to caller to ensure not making costly calls that will be outside of visible area.
|
|
/// As concave fill is noticeably more expensive than other primitives, be mindful of this...
|
|
/// Caller can build AABB of points, and avoid filling if 'draw_list->_CmdHeader.ClipRect.Overlays(points_bb) == false')
|
|
/// </code>
|
|
/// </remarks>
|
|
public static unsafe void AddConcavePolyFilled(
|
|
this ImDrawListPtr target,
|
|
ReadOnlySpan<float2> points,
|
|
ImColor8 col
|
|
)
|
|
{
|
|
fixed (float2* points_fixed = points)
|
|
{
|
|
PInvoke.ImDrawList_AddConcavePolyFilled(target, points_fixed, points.Length, col);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3416">imgui.h:3416</see>
|
|
/// ,
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui_draw.cpp#L1766">imgui_draw.cpp:1766</see>
|
|
/// <br/>
|
|
/// <c>void AddImageRounded(ImTextureRef tex_ref, const ImVec2& p_min, const ImVec2& p_max, const ImVec2& uv_min, const ImVec2& uv_max, ImU32 col, float rounding, ImDrawFlags flags = 0)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Image primitives
|
|
/// - Read FAQ to understand what ImTextureID/ImTextureRef are.
|
|
/// - "p_min" and "p_max" represent the upper-left and lower-right corners of the rectangle.
|
|
/// - "uv_min" and "uv_max" represent the normalized texture coordinates to use for those corners. Using (0,0)->(1,1) texture coordinates will generally display the entire texture.
|
|
/// </code>
|
|
/// </remarks>
|
|
public static unsafe void AddImageRounded(
|
|
this ImDrawListPtr target,
|
|
ImTextureRef texRef,
|
|
in float2 pMin,
|
|
in float2 pMax,
|
|
in float2 uvMin,
|
|
in float2 uvMax,
|
|
ImColor8 col,
|
|
float rounding,
|
|
ImDrawFlags flags = default
|
|
)
|
|
{
|
|
fixed (float2* uvMax_fixed = &uvMax)
|
|
{
|
|
fixed (float2* uvMin_fixed = &uvMin)
|
|
{
|
|
fixed (float2* pMax_fixed = &pMax)
|
|
{
|
|
fixed (float2* pMin_fixed = &pMin)
|
|
{
|
|
PInvoke.ImDrawList_AddImageRounded(
|
|
target,
|
|
texRef,
|
|
pMin_fixed,
|
|
pMax_fixed,
|
|
uvMin_fixed,
|
|
uvMax_fixed,
|
|
col,
|
|
rounding,
|
|
flags
|
|
);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3421">imgui.h:3421</see>
|
|
/// <br/><c>inline void PathClear()</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Stateful path API, add points then finish with PathFillConvex() or PathStroke()
|
|
/// - Important: filled shapes must always use clockwise winding order! The anti-aliasing fringe depends on it. Counter-clockwise shapes will have "inward" anti-aliasing.
|
|
/// so e.g. 'PathArcTo(center, radius, PI * -0.5f, PI)' is ok, whereas 'PathArcTo(center, radius, PI, PI * -0.5f)' won't have correct anti-aliasing when followed by PathFillConvex().
|
|
/// </code>
|
|
/// </remarks>
|
|
public static unsafe void PathClear(this ImDrawListPtr target) => PInvoke.ImDrawList_PathClear(target);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3422">imgui.h:3422</see>
|
|
/// <br/><c>inline void PathLineTo(const ImVec2& pos)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Stateful path API, add points then finish with PathFillConvex() or PathStroke()
|
|
/// - Important: filled shapes must always use clockwise winding order! The anti-aliasing fringe depends on it. Counter-clockwise shapes will have "inward" anti-aliasing.
|
|
/// so e.g. 'PathArcTo(center, radius, PI * -0.5f, PI)' is ok, whereas 'PathArcTo(center, radius, PI, PI * -0.5f)' won't have correct anti-aliasing when followed by PathFillConvex().
|
|
/// </code>
|
|
/// </remarks>
|
|
public static unsafe void PathLineTo(this ImDrawListPtr target, in float2 pos)
|
|
{
|
|
fixed (float2* pos_fixed = &pos)
|
|
{
|
|
PInvoke.ImDrawList_PathLineTo(target, pos_fixed);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3423">imgui.h:3423</see>
|
|
/// <br/><c>inline void PathLineToMergeDuplicate(const ImVec2& pos)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Stateful path API, add points then finish with PathFillConvex() or PathStroke()
|
|
/// - Important: filled shapes must always use clockwise winding order! The anti-aliasing fringe depends on it. Counter-clockwise shapes will have "inward" anti-aliasing.
|
|
/// so e.g. 'PathArcTo(center, radius, PI * -0.5f, PI)' is ok, whereas 'PathArcTo(center, radius, PI, PI * -0.5f)' won't have correct anti-aliasing when followed by PathFillConvex().
|
|
/// </code>
|
|
/// </remarks>
|
|
public static unsafe void PathLineToMergeDuplicate(this ImDrawListPtr target, in float2 pos)
|
|
{
|
|
fixed (float2* pos_fixed = &pos)
|
|
{
|
|
PInvoke.ImDrawList_PathLineToMergeDuplicate(target, pos_fixed);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3424">imgui.h:3424</see>
|
|
/// <br/><c>inline void PathFillConvex(ImU32 col)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Stateful path API, add points then finish with PathFillConvex() or PathStroke()
|
|
/// - Important: filled shapes must always use clockwise winding order! The anti-aliasing fringe depends on it. Counter-clockwise shapes will have "inward" anti-aliasing.
|
|
/// so e.g. 'PathArcTo(center, radius, PI * -0.5f, PI)' is ok, whereas 'PathArcTo(center, radius, PI, PI * -0.5f)' won't have correct anti-aliasing when followed by PathFillConvex().
|
|
/// </code>
|
|
/// </remarks>
|
|
public static unsafe void PathFillConvex(this ImDrawListPtr target, ImColor8 col) =>
|
|
PInvoke.ImDrawList_PathFillConvex(target, col);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3425">imgui.h:3425</see>
|
|
/// <br/><c>inline void PathFillConcave(ImU32 col)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Stateful path API, add points then finish with PathFillConvex() or PathStroke()
|
|
/// - Important: filled shapes must always use clockwise winding order! The anti-aliasing fringe depends on it. Counter-clockwise shapes will have "inward" anti-aliasing.
|
|
/// so e.g. 'PathArcTo(center, radius, PI * -0.5f, PI)' is ok, whereas 'PathArcTo(center, radius, PI, PI * -0.5f)' won't have correct anti-aliasing when followed by PathFillConvex().
|
|
/// </code>
|
|
/// </remarks>
|
|
public static unsafe void PathFillConcave(this ImDrawListPtr target, ImColor8 col) =>
|
|
PInvoke.ImDrawList_PathFillConcave(target, col);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3426">imgui.h:3426</see>
|
|
/// <br/><c>inline void PathStroke(ImU32 col, ImDrawFlags flags = 0, float thickness = 1.0f)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Stateful path API, add points then finish with PathFillConvex() or PathStroke()
|
|
/// - Important: filled shapes must always use clockwise winding order! The anti-aliasing fringe depends on it. Counter-clockwise shapes will have "inward" anti-aliasing.
|
|
/// so e.g. 'PathArcTo(center, radius, PI * -0.5f, PI)' is ok, whereas 'PathArcTo(center, radius, PI, PI * -0.5f)' won't have correct anti-aliasing when followed by PathFillConvex().
|
|
/// </code>
|
|
/// </remarks>
|
|
public static unsafe void PathStroke(
|
|
this ImDrawListPtr target,
|
|
ImColor8 col,
|
|
ImDrawFlags flags = default,
|
|
float thickness = 1f
|
|
) => PInvoke.ImDrawList_PathStroke(target, col, flags, thickness);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3427">imgui.h:3427</see>
|
|
/// ,
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui_draw.cpp#L1262">imgui_draw.cpp:1262</see>
|
|
/// <br/>
|
|
/// <c>void PathArcTo(const ImVec2& center, float radius, float a_min, float a_max, int num_segments = 0)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Stateful path API, add points then finish with PathFillConvex() or PathStroke()
|
|
/// - Important: filled shapes must always use clockwise winding order! The anti-aliasing fringe depends on it. Counter-clockwise shapes will have "inward" anti-aliasing.
|
|
/// so e.g. 'PathArcTo(center, radius, PI * -0.5f, PI)' is ok, whereas 'PathArcTo(center, radius, PI, PI * -0.5f)' won't have correct anti-aliasing when followed by PathFillConvex().
|
|
/// </code>
|
|
/// </remarks>
|
|
public static unsafe void PathArcTo(
|
|
this ImDrawListPtr target,
|
|
in float2 center,
|
|
float radius,
|
|
float aMin,
|
|
float aMax,
|
|
int numSegments = 0
|
|
)
|
|
{
|
|
fixed (float2* center_fixed = ¢er)
|
|
{
|
|
PInvoke.ImDrawList_PathArcTo(target, center_fixed, radius, aMin, aMax, numSegments);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Use precomputed angles for a 12 steps circle
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3428">imgui.h:3428</see>
|
|
/// ,
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui_draw.cpp#L1252">imgui_draw.cpp:1252</see>
|
|
/// <br/><c>void PathArcToFast(const ImVec2& center, float radius, int a_min_of_12, int a_max_of_12)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Stateful path API, add points then finish with PathFillConvex() or PathStroke()
|
|
/// - Important: filled shapes must always use clockwise winding order! The anti-aliasing fringe depends on it. Counter-clockwise shapes will have "inward" anti-aliasing.
|
|
/// so e.g. 'PathArcTo(center, radius, PI * -0.5f, PI)' is ok, whereas 'PathArcTo(center, radius, PI, PI * -0.5f)' won't have correct anti-aliasing when followed by PathFillConvex().
|
|
/// </code>
|
|
/// <para>
|
|
/// 0: East, 3: South, 6: West, 9: North, 12: East
|
|
/// </para>
|
|
/// </remarks>
|
|
public static unsafe void PathArcToFast(
|
|
this ImDrawListPtr target,
|
|
in float2 center,
|
|
float radius,
|
|
int aMinOf12,
|
|
int aMaxOf12
|
|
)
|
|
{
|
|
fixed (float2* center_fixed = ¢er)
|
|
{
|
|
PInvoke.ImDrawList_PathArcToFast(target, center_fixed, radius, aMinOf12, aMaxOf12);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Ellipse
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3429">imgui.h:3429</see>
|
|
/// ,
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui_draw.cpp#L1312">imgui_draw.cpp:1312</see>
|
|
/// <br/>
|
|
/// <c>void PathEllipticalArcTo(const ImVec2& center, const ImVec2& radius, float rot, float a_min, float a_max, int num_segments = 0)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Stateful path API, add points then finish with PathFillConvex() or PathStroke()
|
|
/// - Important: filled shapes must always use clockwise winding order! The anti-aliasing fringe depends on it. Counter-clockwise shapes will have "inward" anti-aliasing.
|
|
/// so e.g. 'PathArcTo(center, radius, PI * -0.5f, PI)' is ok, whereas 'PathArcTo(center, radius, PI, PI * -0.5f)' won't have correct anti-aliasing when followed by PathFillConvex().
|
|
/// </code>
|
|
/// </remarks>
|
|
public static unsafe void PathEllipticalArcTo(
|
|
this ImDrawListPtr target,
|
|
in float2 center,
|
|
in float2 radius,
|
|
float rot,
|
|
float aMin,
|
|
float aMax,
|
|
int numSegments = 0
|
|
)
|
|
{
|
|
fixed (float2* radius_fixed = &radius)
|
|
{
|
|
fixed (float2* center_fixed = ¢er)
|
|
{
|
|
PInvoke.ImDrawList_PathEllipticalArcTo(
|
|
target,
|
|
center_fixed,
|
|
radius_fixed,
|
|
rot,
|
|
aMin,
|
|
aMax,
|
|
numSegments
|
|
);
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Cubic Bezier (4 control points)
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3430">imgui.h:3430</see>
|
|
/// ,
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui_draw.cpp#L1395">imgui_draw.cpp:1395</see>
|
|
/// <br/>
|
|
/// <c>void PathBezierCubicCurveTo(const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, int num_segments = 0)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Stateful path API, add points then finish with PathFillConvex() or PathStroke()
|
|
/// - Important: filled shapes must always use clockwise winding order! The anti-aliasing fringe depends on it. Counter-clockwise shapes will have "inward" anti-aliasing.
|
|
/// so e.g. 'PathArcTo(center, radius, PI * -0.5f, PI)' is ok, whereas 'PathArcTo(center, radius, PI, PI * -0.5f)' won't have correct anti-aliasing when followed by PathFillConvex().
|
|
/// </code>
|
|
/// </remarks>
|
|
public static unsafe void PathBezierCubicCurveTo(
|
|
this ImDrawListPtr target,
|
|
in float2 p2,
|
|
in float2 p3,
|
|
in float2 p4,
|
|
int numSegments = 0
|
|
)
|
|
{
|
|
fixed (float2* p4_fixed = &p4)
|
|
{
|
|
fixed (float2* p3_fixed = &p3)
|
|
{
|
|
fixed (float2* p2_fixed = &p2)
|
|
{
|
|
PInvoke.ImDrawList_PathBezierCubicCurveTo(target, p2_fixed, p3_fixed, p4_fixed, numSegments);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Quadratic Bezier (3 control points)
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3431">imgui.h:3431</see>
|
|
/// ,
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui_draw.cpp#L1411">imgui_draw.cpp:1411</see>
|
|
/// <br/>
|
|
/// <c>void PathBezierQuadraticCurveTo(const ImVec2& p2, const ImVec2& p3, int num_segments = 0)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Stateful path API, add points then finish with PathFillConvex() or PathStroke()
|
|
/// - Important: filled shapes must always use clockwise winding order! The anti-aliasing fringe depends on it. Counter-clockwise shapes will have "inward" anti-aliasing.
|
|
/// so e.g. 'PathArcTo(center, radius, PI * -0.5f, PI)' is ok, whereas 'PathArcTo(center, radius, PI, PI * -0.5f)' won't have correct anti-aliasing when followed by PathFillConvex().
|
|
/// </code>
|
|
/// </remarks>
|
|
public static unsafe void PathBezierQuadraticCurveTo(
|
|
this ImDrawListPtr target,
|
|
in float2 p2,
|
|
in float2 p3,
|
|
int numSegments = 0
|
|
)
|
|
{
|
|
fixed (float2* p3_fixed = &p3)
|
|
{
|
|
fixed (float2* p2_fixed = &p2)
|
|
{
|
|
PInvoke.ImDrawList_PathBezierQuadraticCurveTo(target, p2_fixed, p3_fixed, numSegments);
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3432">imgui.h:3432</see>
|
|
/// ,
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui_draw.cpp#L1451">imgui_draw.cpp:1451</see>
|
|
/// <br/>
|
|
/// <c>void PathRect(const ImVec2& rect_min, const ImVec2& rect_max, float rounding = 0.0f, ImDrawFlags flags = 0)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Stateful path API, add points then finish with PathFillConvex() or PathStroke()
|
|
/// - Important: filled shapes must always use clockwise winding order! The anti-aliasing fringe depends on it. Counter-clockwise shapes will have "inward" anti-aliasing.
|
|
/// so e.g. 'PathArcTo(center, radius, PI * -0.5f, PI)' is ok, whereas 'PathArcTo(center, radius, PI, PI * -0.5f)' won't have correct anti-aliasing when followed by PathFillConvex().
|
|
/// </code>
|
|
/// </remarks>
|
|
public static unsafe void PathRect(
|
|
this ImDrawListPtr target,
|
|
in float2 rectMin,
|
|
in float2 rectMax,
|
|
float rounding = 0f,
|
|
ImDrawFlags flags = default
|
|
)
|
|
{
|
|
fixed (float2* rectMax_fixed = &rectMax)
|
|
{
|
|
fixed (float2* rectMin_fixed = &rectMin)
|
|
{
|
|
PInvoke.ImDrawList_PathRect(target, rectMin_fixed, rectMax_fixed, rounding, flags);
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3443">imgui.h:3443</see>
|
|
/// ,
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui_draw.cpp#L522">imgui_draw.cpp:522</see>
|
|
/// <br/><c>void AddCallback(ImDrawCallback callback, void* userdata, size_t userdata_size = 0)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// 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*.
|
|
/// </code>
|
|
/// </remarks>
|
|
public static unsafe void AddCallback(
|
|
this ImDrawListPtr target,
|
|
ImDrawCallback callback,
|
|
Ptr userdata,
|
|
nuint userdataSize = default
|
|
) =>
|
|
PInvoke.ImDrawList_AddCallback(
|
|
target,
|
|
Marshal.GetFunctionPointerForDelegate(callback),
|
|
userdata,
|
|
userdataSize
|
|
);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3443">imgui.h:3443</see>
|
|
/// ,
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui_draw.cpp#L522">imgui_draw.cpp:522</see>
|
|
/// <br/><c>void AddCallback(ImDrawCallback callback, void* userdata, size_t userdata_size = 0)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// 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*.
|
|
/// </code>
|
|
/// </remarks>
|
|
public static unsafe void AddCallback(
|
|
this ImDrawListPtr target,
|
|
delegate* unmanaged[Cdecl]<ImDrawList*, ImDrawCmd*, void> callback,
|
|
Ptr userdata,
|
|
nuint userdataSize = default
|
|
) => PInvoke.ImDrawList_AddCallback(target, (nint)callback, userdata, userdataSize);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// 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
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3446">imgui.h:3446</see>
|
|
/// ,
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui_draw.cpp#L497">imgui_draw.cpp:497</see>
|
|
/// <br/><c>void AddDrawCmd()</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Advanced: Miscellaneous
|
|
/// </para>
|
|
/// </remarks>
|
|
public static unsafe void AddDrawCmd(this ImDrawListPtr target) => PInvoke.ImDrawList_AddDrawCmd(target);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Create a clone of the CmdBuffer/IdxBuffer/VtxBuffer.
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3447">imgui.h:3447</see>
|
|
/// ,
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui_draw.cpp#L487">imgui_draw.cpp:487</see>
|
|
/// <br/><c>ImDrawList* CloneOutput() const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Advanced: Miscellaneous
|
|
/// </para>
|
|
/// </remarks>
|
|
public static unsafe ImDrawListPtr CloneOutput(this ImDrawListPtr target) =>
|
|
PInvoke.ImDrawList_CloneOutput(target);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3455">imgui.h:3455</see>
|
|
/// <br/><c>inline void ChannelsSplit(int count)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Advanced: Channels
|
|
/// - Use to split render into layers. By switching channels to can render out-of-order (e.g. submit FG primitives before BG primitives)
|
|
/// - Use to minimize draw calls (e.g. if going back-and-forth between multiple clipping rectangles, prefer to append into separate channels then merge at the end)
|
|
/// - This API shouldn't have been in ImDrawList in the first place!
|
|
/// Prefer using your own persistent instance of ImDrawListSplitter as you can stack them.
|
|
/// Using the ImDrawList::ChannelsXXXX you cannot stack a split over another.
|
|
/// </code>
|
|
/// </remarks>
|
|
public static unsafe void ChannelsSplit(this ImDrawListPtr target, int count) =>
|
|
PInvoke.ImDrawList_ChannelsSplit(target, count);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3456">imgui.h:3456</see>
|
|
/// <br/><c>inline void ChannelsMerge()</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Advanced: Channels
|
|
/// - Use to split render into layers. By switching channels to can render out-of-order (e.g. submit FG primitives before BG primitives)
|
|
/// - Use to minimize draw calls (e.g. if going back-and-forth between multiple clipping rectangles, prefer to append into separate channels then merge at the end)
|
|
/// - This API shouldn't have been in ImDrawList in the first place!
|
|
/// Prefer using your own persistent instance of ImDrawListSplitter as you can stack them.
|
|
/// Using the ImDrawList::ChannelsXXXX you cannot stack a split over another.
|
|
/// </code>
|
|
/// </remarks>
|
|
public static unsafe void ChannelsMerge(this ImDrawListPtr target) => PInvoke.ImDrawList_ChannelsMerge(target);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3457">imgui.h:3457</see>
|
|
/// <br/><c>inline void ChannelsSetCurrent(int n)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Advanced: Channels
|
|
/// - Use to split render into layers. By switching channels to can render out-of-order (e.g. submit FG primitives before BG primitives)
|
|
/// - Use to minimize draw calls (e.g. if going back-and-forth between multiple clipping rectangles, prefer to append into separate channels then merge at the end)
|
|
/// - This API shouldn't have been in ImDrawList in the first place!
|
|
/// Prefer using your own persistent instance of ImDrawListSplitter as you can stack them.
|
|
/// Using the ImDrawList::ChannelsXXXX you cannot stack a split over another.
|
|
/// </code>
|
|
/// </remarks>
|
|
public static unsafe void ChannelsSetCurrent(this ImDrawListPtr target, int n) =>
|
|
PInvoke.ImDrawList_ChannelsSetCurrent(target, n);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3462">imgui.h:3462</see>
|
|
/// ,
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui_draw.cpp#L711">imgui_draw.cpp:711</see>
|
|
/// <br/><c>void PrimReserve(int idx_count, int vtx_count)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Advanced: Primitives allocations
|
|
/// - We render triangles (three vertices)
|
|
/// - All primitives needs to be reserved via PrimReserve() beforehand.
|
|
/// </code>
|
|
/// <code>
|
|
/// Reserve space for a number of vertices and indices.
|
|
/// You must finish filling your reserved data before calling PrimReserve() again, as it may reallocate or
|
|
/// submit the intermediate results. PrimUnreserve() can be used to release unused allocations.
|
|
/// </code>
|
|
/// </remarks>
|
|
public static unsafe void PrimReserve(this ImDrawListPtr target, int idxCount, int vtxCount) =>
|
|
PInvoke.ImDrawList_PrimReserve(target, idxCount, vtxCount);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3463">imgui.h:3463</see>
|
|
/// ,
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui_draw.cpp#L737">imgui_draw.cpp:737</see>
|
|
/// <br/><c>void PrimUnreserve(int idx_count, int vtx_count)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Advanced: Primitives allocations
|
|
/// - We render triangles (three vertices)
|
|
/// - All primitives needs to be reserved via PrimReserve() beforehand.
|
|
/// </code>
|
|
/// <para>
|
|
/// Release the number of reserved vertices/indices from the end of the last reservation made with
|
|
/// PrimReserve().
|
|
/// </para>
|
|
/// </remarks>
|
|
public static unsafe void PrimUnreserve(this ImDrawListPtr target, int idxCount, int vtxCount) =>
|
|
PInvoke.ImDrawList_PrimUnreserve(target, idxCount, vtxCount);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Axis aligned rectangle (composed of two triangles)
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3464">imgui.h:3464</see>
|
|
/// ,
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui_draw.cpp#L748">imgui_draw.cpp:748</see>
|
|
/// <br/><c>void PrimRect(const ImVec2& a, const ImVec2& b, ImU32 col)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Advanced: Primitives allocations
|
|
/// - We render triangles (three vertices)
|
|
/// - All primitives needs to be reserved via PrimReserve() beforehand.
|
|
/// </code>
|
|
/// <para>
|
|
/// Fully unrolled with inline call to keep our debug builds decently fast.
|
|
/// </para>
|
|
/// </remarks>
|
|
public static unsafe void PrimRect(this ImDrawListPtr target, in float2 a, in float2 b, ImColor8 col)
|
|
{
|
|
fixed (float2* b_fixed = &b)
|
|
{
|
|
fixed (float2* a_fixed = &a)
|
|
{
|
|
PInvoke.ImDrawList_PrimRect(target, a_fixed, b_fixed, col);
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3465">imgui.h:3465</see>
|
|
/// ,
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui_draw.cpp#L763">imgui_draw.cpp:763</see>
|
|
/// <br/>
|
|
/// <c>void PrimRectUV(const ImVec2& a, const ImVec2& b, const ImVec2& uv_a, const ImVec2& uv_b, ImU32 col)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Advanced: Primitives allocations
|
|
/// - We render triangles (three vertices)
|
|
/// - All primitives needs to be reserved via PrimReserve() beforehand.
|
|
/// </code>
|
|
/// </remarks>
|
|
public static unsafe void PrimRectUV(
|
|
this ImDrawListPtr target,
|
|
in float2 a,
|
|
in float2 b,
|
|
in float2 uvA,
|
|
in float2 uvB,
|
|
ImColor8 col
|
|
)
|
|
{
|
|
fixed (float2* uvB_fixed = &uvB)
|
|
{
|
|
fixed (float2* uvA_fixed = &uvA)
|
|
{
|
|
fixed (float2* b_fixed = &b)
|
|
{
|
|
fixed (float2* a_fixed = &a)
|
|
{
|
|
PInvoke.ImDrawList_PrimRectUV(target, a_fixed, b_fixed, uvA_fixed, uvB_fixed, col);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3466">imgui.h:3466</see>
|
|
/// ,
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui_draw.cpp#L778">imgui_draw.cpp:778</see>
|
|
/// <br/>
|
|
/// <c>void PrimQuadUV(const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& d, const ImVec2& uv_a, const ImVec2& uv_b, const ImVec2& uv_c, const ImVec2& uv_d, ImU32 col)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Advanced: Primitives allocations
|
|
/// - We render triangles (three vertices)
|
|
/// - All primitives needs to be reserved via PrimReserve() beforehand.
|
|
/// </code>
|
|
/// </remarks>
|
|
public static unsafe void PrimQuadUV(
|
|
this ImDrawListPtr target,
|
|
in float2 a,
|
|
in float2 b,
|
|
in float2 c,
|
|
in float2 d,
|
|
in float2 uvA,
|
|
in float2 uvB,
|
|
in float2 uvC,
|
|
in float2 uvD,
|
|
ImColor8 col
|
|
)
|
|
{
|
|
fixed (float2* uvD_fixed = &uvD)
|
|
{
|
|
fixed (float2* uvC_fixed = &uvC)
|
|
{
|
|
fixed (float2* uvB_fixed = &uvB)
|
|
{
|
|
fixed (float2* uvA_fixed = &uvA)
|
|
{
|
|
fixed (float2* d_fixed = &d)
|
|
{
|
|
fixed (float2* c_fixed = &c)
|
|
{
|
|
fixed (float2* b_fixed = &b)
|
|
{
|
|
fixed (float2* a_fixed = &a)
|
|
{
|
|
PInvoke.ImDrawList_PrimQuadUV(
|
|
target,
|
|
a_fixed,
|
|
b_fixed,
|
|
c_fixed,
|
|
d_fixed,
|
|
uvA_fixed,
|
|
uvB_fixed,
|
|
uvC_fixed,
|
|
uvD_fixed,
|
|
col
|
|
);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3467">imgui.h:3467</see>
|
|
/// <br/><c>inline void PrimWriteVtx(const ImVec2& pos, const ImVec2& uv, ImU32 col)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Advanced: Primitives allocations
|
|
/// - We render triangles (three vertices)
|
|
/// - All primitives needs to be reserved via PrimReserve() beforehand.
|
|
/// </code>
|
|
/// </remarks>
|
|
public static unsafe void PrimWriteVtx(this ImDrawListPtr target, in float2 pos, in float2 uv, ImColor8 col)
|
|
{
|
|
fixed (float2* uv_fixed = &uv)
|
|
{
|
|
fixed (float2* pos_fixed = &pos)
|
|
{
|
|
PInvoke.ImDrawList_PrimWriteVtx(target, pos_fixed, uv_fixed, col);
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3468">imgui.h:3468</see>
|
|
/// <br/><c>inline void PrimWriteIdx(ImDrawIdx idx)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Advanced: Primitives allocations
|
|
/// - We render triangles (three vertices)
|
|
/// - All primitives needs to be reserved via PrimReserve() beforehand.
|
|
/// </code>
|
|
/// </remarks>
|
|
public static unsafe void PrimWriteIdx(this ImDrawListPtr target, ushort idx) =>
|
|
PInvoke.ImDrawList_PrimWriteIdx(target, idx);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Write vertex with unique index
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3469">imgui.h:3469</see>
|
|
/// <br/><c>inline void PrimVtx(const ImVec2& pos, const ImVec2& uv, ImU32 col)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Advanced: Primitives allocations
|
|
/// - We render triangles (three vertices)
|
|
/// - All primitives needs to be reserved via PrimReserve() beforehand.
|
|
/// </code>
|
|
/// </remarks>
|
|
public static unsafe void PrimVtx(this ImDrawListPtr target, in float2 pos, in float2 uv, ImColor8 col)
|
|
{
|
|
fixed (float2* uv_fixed = &uv)
|
|
{
|
|
fixed (float2* pos_fixed = &pos)
|
|
{
|
|
PInvoke.ImDrawList_PrimVtx(target, pos_fixed, uv_fixed, col);
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3483">imgui.h:3483</see>
|
|
/// ,
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui_draw.cpp#L434">imgui_draw.cpp:434</see>
|
|
/// <br/><c>void _SetDrawListSharedData(ImDrawListSharedData* data)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// [Internal helpers]
|
|
/// </para>
|
|
/// </remarks>
|
|
public static unsafe void SetDrawListSharedData(this ImDrawListPtr target, ImDrawListSharedDataPtr data) =>
|
|
PInvoke.ImDrawList_SetDrawListSharedData(target, data);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3484">imgui.h:3484</see>
|
|
/// ,
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui_draw.cpp#L445">imgui_draw.cpp:445</see>
|
|
/// <br/><c>void _ResetForNewFrame()</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// [Internal helpers]
|
|
/// </para>
|
|
/// <code>
|
|
/// Initialize before use in a new frame. We always have a command ready in the buffer.
|
|
/// In the majority of cases, you would want to call PushClipRect() and PushTexture() after this.
|
|
/// </code>
|
|
/// </remarks>
|
|
public static unsafe void ResetForNewFrame(this ImDrawListPtr target) =>
|
|
PInvoke.ImDrawList_ResetForNewFrame(target);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3485">imgui.h:3485</see>
|
|
/// ,
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui_draw.cpp#L471">imgui_draw.cpp:471</see>
|
|
/// <br/><c>void _ClearFreeMemory()</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// [Internal helpers]
|
|
/// </para>
|
|
/// </remarks>
|
|
public static unsafe void ClearFreeMemory(this ImDrawListPtr target) =>
|
|
PInvoke.ImDrawList_ClearFreeMemory(target);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3486">imgui.h:3486</see>
|
|
/// ,
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui_draw.cpp#L511">imgui_draw.cpp:511</see>
|
|
/// <br/><c>void _PopUnusedDrawCmd()</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// [Internal helpers]
|
|
/// </para>
|
|
/// <code>
|
|
/// Pop trailing draw command (used before merging or presenting to user)
|
|
/// Note that this leaves the ImDrawList in a state unfit for further commands, as most code assume that CmdBuffer.Size > 0 && CmdBuffer.back().UserCallback == NULL
|
|
/// </code>
|
|
/// </remarks>
|
|
public static unsafe void PopUnusedDrawCmd(this ImDrawListPtr target) =>
|
|
PInvoke.ImDrawList_PopUnusedDrawCmd(target);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3487">imgui.h:3487</see>
|
|
/// ,
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui_draw.cpp#L563">imgui_draw.cpp:563</see>
|
|
/// <br/><c>void _TryMergeDrawCmds()</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// [Internal helpers]
|
|
/// </para>
|
|
/// <para>
|
|
/// Try to merge two last draw commands
|
|
/// </para>
|
|
/// </remarks>
|
|
public static unsafe void TryMergeDrawCmds(this ImDrawListPtr target) =>
|
|
PInvoke.ImDrawList_TryMergeDrawCmds(target);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3488">imgui.h:3488</see>
|
|
/// ,
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui_draw.cpp#L577">imgui_draw.cpp:577</see>
|
|
/// <br/><c>void _OnChangedClipRect()</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// [Internal helpers]
|
|
/// </para>
|
|
/// <code>
|
|
/// Our scheme may appears a bit unusual, basically we want the most-common calls AddLine AddRect etc. to not have to perform any check so we always have a command ready in the stack.
|
|
/// The cost of figuring out if a new command has to be added or if we can merge is paid in those Update** functions only.
|
|
/// </code>
|
|
/// </remarks>
|
|
public static unsafe void OnChangedClipRect(this ImDrawListPtr target) =>
|
|
PInvoke.ImDrawList_OnChangedClipRect(target);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3489">imgui.h:3489</see>
|
|
/// ,
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui_draw.cpp#L599">imgui_draw.cpp:599</see>
|
|
/// <br/><c>void _OnChangedTexture()</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// [Internal helpers]
|
|
/// </para>
|
|
/// </remarks>
|
|
public static unsafe void OnChangedTexture(this ImDrawListPtr target) =>
|
|
PInvoke.ImDrawList_OnChangedTexture(target);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3490">imgui.h:3490</see>
|
|
/// ,
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui_draw.cpp#L624">imgui_draw.cpp:624</see>
|
|
/// <br/><c>void _OnChangedVtxOffset()</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// [Internal helpers]
|
|
/// </para>
|
|
/// </remarks>
|
|
public static unsafe void OnChangedVtxOffset(this ImDrawListPtr target) =>
|
|
PInvoke.ImDrawList_OnChangedVtxOffset(target);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3491">imgui.h:3491</see>
|
|
/// ,
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui_draw.cpp#L699">imgui_draw.cpp:699</see>
|
|
/// <br/><c>void _SetTexture(ImTextureRef tex_ref)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// [Internal helpers]
|
|
/// </para>
|
|
/// <para>
|
|
/// This is used by ImGui::PushFont()/PopFont(). It works because we never use _TextureIdStack[] elsewhere
|
|
/// than in PushTexture()/PopTexture().
|
|
/// </para>
|
|
/// </remarks>
|
|
public static unsafe void SetTexture(this ImDrawListPtr target, ImTextureRef texRef) =>
|
|
PInvoke.ImDrawList_SetTexture(target, texRef);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3492">imgui.h:3492</see>
|
|
/// ,
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui_draw.cpp#L640">imgui_draw.cpp:640</see>
|
|
/// <br/><c>int _CalcCircleAutoSegmentCount(float radius) const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// [Internal helpers]
|
|
/// </para>
|
|
/// </remarks>
|
|
public static unsafe int CalcCircleAutoSegmentCount(this ImDrawListPtr target, float radius) =>
|
|
PInvoke.ImDrawList_CalcCircleAutoSegmentCount(target, radius);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3493">imgui.h:3493</see>
|
|
/// ,
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui_draw.cpp#L1141">imgui_draw.cpp:1141</see>
|
|
/// <br/>
|
|
/// <c>void _PathArcToFastEx(const ImVec2& center, float radius, int a_min_sample, int a_max_sample, int a_step)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// [Internal helpers]
|
|
/// </para>
|
|
/// </remarks>
|
|
public static unsafe void PathArcToFastEx(
|
|
this ImDrawListPtr target,
|
|
in float2 center,
|
|
float radius,
|
|
int aMinSample,
|
|
int aMaxSample,
|
|
int aStep
|
|
)
|
|
{
|
|
fixed (float2* center_fixed = ¢er)
|
|
{
|
|
PInvoke.ImDrawList_PathArcToFastEx(target, center_fixed, radius, aMinSample, aMaxSample, aStep);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3494">imgui.h:3494</see>
|
|
/// ,
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui_draw.cpp#L1233">imgui_draw.cpp:1233</see>
|
|
/// <br/>
|
|
/// <c>void _PathArcToN(const ImVec2& center, float radius, float a_min, float a_max, int num_segments)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// [Internal helpers]
|
|
/// </para>
|
|
/// </remarks>
|
|
public static unsafe void PathArcToN(
|
|
this ImDrawListPtr target,
|
|
in float2 center,
|
|
float radius,
|
|
float aMin,
|
|
float aMax,
|
|
int numSegments
|
|
)
|
|
{
|
|
fixed (float2* center_fixed = ¢er)
|
|
{
|
|
PInvoke.ImDrawList_PathArcToN(target, center_fixed, radius, aMin, aMax, numSegments);
|
|
}
|
|
}
|
|
}
|
|
}
|