@@ -1901,33 +1901,39 @@ struct ImDrawList
1901
1901
inline ImVec2 GetClipRectMax () const { const ImVec4& cr = _ClipRectStack.back (); return ImVec2 (cr.z , cr.w ); }
1902
1902
1903
1903
// Primitives
1904
- IMGUI_API void AddLine (const ImVec2& a, const ImVec2& b, ImU32 col, float thickness = 1 .0f );
1905
- IMGUI_API void AddRect (const ImVec2& a, const ImVec2& b, ImU32 col, float rounding = 0 .0f , ImDrawCornerFlags rounding_corners = ImDrawCornerFlags_All, float thickness = 1 .0f ); // a: upper-left, b: lower-right (== upper-left + size), rounding_corners_flags: 4-bits corresponding to which corner to round
1906
- IMGUI_API void AddRectFilled (const ImVec2& a, const ImVec2& b, ImU32 col, float rounding = 0 .0f , ImDrawCornerFlags rounding_corners = ImDrawCornerFlags_All); // a: upper-left, b: lower-right (== upper-left + size)
1907
- IMGUI_API void AddRectFilledMultiColor (const ImVec2& a, const ImVec2& b, ImU32 col_upr_left, ImU32 col_upr_right, ImU32 col_bot_right, ImU32 col_bot_left);
1908
- IMGUI_API void AddQuad (const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& d, ImU32 col, float thickness = 1 .0f );
1909
- IMGUI_API void AddQuadFilled (const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& d, ImU32 col);
1910
- IMGUI_API void AddTriangle (const ImVec2& a, const ImVec2& b, const ImVec2& c, ImU32 col, float thickness = 1 .0f );
1911
- IMGUI_API void AddTriangleFilled (const ImVec2& a, const ImVec2& b, const ImVec2& c, ImU32 col);
1912
- IMGUI_API void AddCircle (const ImVec2& centre, float radius, ImU32 col, int num_segments = 12 , float thickness = 1 .0f );
1913
- IMGUI_API void AddCircleFilled (const ImVec2& centre, float radius, ImU32 col, int num_segments = 12 );
1904
+ // - For rectangular primitives, "p_min" and "p_max" represent the upper-left and lower-right corners.
1905
+ IMGUI_API void AddLine (const ImVec2& p1, const ImVec2& p2, ImU32 col, float thickness = 1 .0f );
1906
+ IMGUI_API void AddRect (const ImVec2& p_min, const ImVec2& p_max, ImU32 col, float rounding = 0 .0f , ImDrawCornerFlags rounding_corners = ImDrawCornerFlags_All, float thickness = 1 .0f ); // a: upper-left, b: lower-right (== upper-left + size), rounding_corners_flags: 4-bits corresponding to which corner to round
1907
+ IMGUI_API void AddRectFilled (const ImVec2& p_min, const ImVec2& p_max, ImU32 col, float rounding = 0 .0f , ImDrawCornerFlags rounding_corners = ImDrawCornerFlags_All); // a: upper-left, b: lower-right (== upper-left + size)
1908
+ IMGUI_API 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);
1909
+ IMGUI_API void AddQuad (const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, ImU32 col, float thickness = 1 .0f );
1910
+ IMGUI_API void AddQuadFilled (const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, ImU32 col);
1911
+ IMGUI_API void AddTriangle (const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, ImU32 col, float thickness = 1 .0f );
1912
+ IMGUI_API void AddTriangleFilled (const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, ImU32 col);
1913
+ IMGUI_API void AddCircle (const ImVec2& center, float radius, ImU32 col, int num_segments = 12 , float thickness = 1 .0f );
1914
+ IMGUI_API void AddCircleFilled (const ImVec2& center, float radius, ImU32 col, int num_segments = 12 );
1914
1915
IMGUI_API void AddText (const ImVec2& pos, ImU32 col, const char * text_begin, const char * text_end = NULL );
1915
1916
IMGUI_API void AddText (const 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 );
1916
- IMGUI_API void AddImage (ImTextureID user_texture_id, const ImVec2& a, const ImVec2& b, const ImVec2& uv_a = ImVec2(0 ,0 ), const ImVec2& uv_b = ImVec2(1 ,1 ), ImU32 col = IM_COL32_WHITE);
1917
- IMGUI_API void AddImageQuad (ImTextureID user_texture_id, const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& d, const ImVec2& uv_a = ImVec2(0 ,0 ), const ImVec2& uv_b = ImVec2(1 ,0 ), const ImVec2& uv_c = ImVec2(1 ,1 ), const ImVec2& uv_d = ImVec2(0 ,1 ), ImU32 col = IM_COL32_WHITE);
1918
- IMGUI_API void AddImageRounded (ImTextureID user_texture_id, const ImVec2& a, const ImVec2& b, const ImVec2& uv_a, const ImVec2& uv_b, ImU32 col, float rounding, ImDrawCornerFlags rounding_corners = ImDrawCornerFlags_All);
1919
1917
IMGUI_API void AddPolyline (const ImVec2* points, int num_points, ImU32 col, bool closed, float thickness);
1920
1918
IMGUI_API void AddConvexPolyFilled (const ImVec2* points, int num_points, ImU32 col); // Note: Anti-aliased filling requires points to be in clockwise order.
1921
1919
IMGUI_API void AddBezierCurve (const ImVec2& pos0, const ImVec2& cp0, const ImVec2& cp1, const ImVec2& pos1, ImU32 col, float thickness, int num_segments = 0 );
1922
1920
1921
+ // Image primitives
1922
+ // - Read FAQ to understand what ImTextureID is.
1923
+ // - "p_min" and "p_max" represent the upper-left and lower-right corners of the rectangle.
1924
+ // - "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.
1925
+ IMGUI_API void AddImage (ImTextureID user_texture_id, const ImVec2& p_min, const ImVec2& p_max, const ImVec2& uv_min = ImVec2(0 , 0 ), const ImVec2& uv_max = ImVec2(1 , 1 ), ImU32 col = IM_COL32_WHITE);
1926
+ IMGUI_API void AddImageQuad (ImTextureID user_texture_id, const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, const ImVec2& uv1 = ImVec2(0 , 0 ), const ImVec2& uv2 = ImVec2(1 , 0 ), const ImVec2& uv3 = ImVec2(1 , 1 ), const ImVec2& uv4 = ImVec2(0 , 1 ), ImU32 col = IM_COL32_WHITE);
1927
+ IMGUI_API void AddImageRounded (ImTextureID user_texture_id, const ImVec2& p_min, const ImVec2& p_max, const ImVec2& uv_min, const ImVec2& uv_max, ImU32 col, float rounding, ImDrawCornerFlags rounding_corners = ImDrawCornerFlags_All);
1928
+
1923
1929
// Stateful path API, add points then finish with PathFillConvex() or PathStroke()
1924
1930
inline void PathClear () { _Path.Size = 0 ; }
1925
1931
inline void PathLineTo (const ImVec2& pos) { _Path.push_back (pos); }
1926
1932
inline void PathLineToMergeDuplicate (const ImVec2& pos) { if (_Path.Size == 0 || memcmp (&_Path.Data [_Path.Size -1 ], &pos, 8 ) != 0 ) _Path.push_back (pos); }
1927
1933
inline void PathFillConvex (ImU32 col) { AddConvexPolyFilled (_Path.Data , _Path.Size , col); _Path.Size = 0 ; } // Note: Anti-aliased filling requires points to be in clockwise order.
1928
1934
inline void PathStroke (ImU32 col, bool closed, float thickness = 1 .0f ) { AddPolyline (_Path.Data , _Path.Size , col, closed, thickness); _Path.Size = 0 ; }
1929
- IMGUI_API void PathArcTo (const ImVec2& centre , float radius, float a_min, float a_max, int num_segments = 10 );
1930
- IMGUI_API void PathArcToFast (const ImVec2& centre , float radius, int a_min_of_12, int a_max_of_12); // Use precomputed angles for a 12 steps circle
1935
+ IMGUI_API void PathArcTo (const ImVec2& center , float radius, float a_min, float a_max, int num_segments = 10 );
1936
+ IMGUI_API void PathArcToFast (const ImVec2& center , float radius, int a_min_of_12, int a_max_of_12); // Use precomputed angles for a 12 steps circle
1931
1937
IMGUI_API void PathBezierCurveTo (const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, int num_segments = 0 );
1932
1938
IMGUI_API void PathRect (const ImVec2& rect_min, const ImVec2& rect_max, float rounding = 0 .0f , ImDrawCornerFlags rounding_corners = ImDrawCornerFlags_All);
1933
1939
0 commit comments