Skip to content

Commit

Permalink
imgui: add specific bindings for AddPolyline / AddConvexPolyFilled
Browse files Browse the repository at this point in the history
  • Loading branch information
pthom committed Dec 6, 2023
1 parent ae69e91 commit 03501e4
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 14 deletions.
20 changes: 9 additions & 11 deletions bindings/imgui_bundle/imgui/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -9253,21 +9253,19 @@ class ImDrawList:
cpu_fine_clip_rect: Optional[ImVec4] = None,
) -> None:
pass
# IMGUI_API void AddPolyline(const ImVec2* points, int num_points, ImU32 col, ImDrawFlags flags, float thickness); /* original C++ signature */
# #ifdef IMGUI_BUNDLE_PYTHON_API
#
# IMGUI_API void AddPolyline(const std::vector<ImVec2>& points, ImU32 col, ImDrawFlags flags, float thickness); /* original C++ signature */
def add_polyline(
self,
points: ImVec2,
num_points: int,
col: ImU32,
flags: ImDrawFlags,
thickness: float,
self, points: List[ImVec2], col: ImU32, flags: ImDrawFlags, thickness: float
) -> None:
pass
# IMGUI_API void AddConvexPolyFilled(const ImVec2* points, int num_points, ImU32 col); /* original C++ signature */
def add_convex_poly_filled(
self, points: ImVec2, num_points: int, col: ImU32
) -> None:
# IMGUI_API void AddConvexPolyFilled(const std::vector<ImVec2>& points, ImU32 col); /* original C++ signature */
def add_convex_poly_filled(self, points: List[ImVec2], col: ImU32) -> None:
pass
# #endif
#

# IMGUI_API void AddBezierCubic(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, ImU32 col, float thickness, int num_segments = 0); /* original C++ signature */
def add_bezier_cubic(
self,
Expand Down
2 changes: 2 additions & 0 deletions external/imgui/bindings/litgen_options_imgui.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,8 @@ def litgen_options_imgui(
r"^ImageButton$",
r"^IsKey",
r"^IsMouse",
r"^AddPolyline",
r"^AddConvexPolyFilled",
]
)
options.fn_force_lambda__regex = join_string_by_pipe_char(
Expand Down
8 changes: 6 additions & 2 deletions external/imgui/bindings/pybind_imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5770,10 +5770,14 @@ void py_init_module_imgui_main(py::module& m)
py::overload_cast<const ImVec2 &, ImU32, const char *, const char *>(&ImDrawList::AddText), py::arg("pos"), py::arg("col"), py::arg("text_begin"), py::arg("text_end") = py::none())
.def("add_text",
py::overload_cast<const ImFont *, float, const ImVec2 &, ImU32, const char *, const char *, float, const ImVec4 *>(&ImDrawList::AddText), py::arg("font"), py::arg("font_size"), py::arg("pos"), py::arg("col"), py::arg("text_begin"), py::arg("text_end") = py::none(), py::arg("wrap_width") = 0.0f, py::arg("cpu_fine_clip_rect") = py::none())
// #ifdef IMGUI_BUNDLE_PYTHON_API
//
.def("add_polyline",
&ImDrawList::AddPolyline, py::arg("points"), py::arg("num_points"), py::arg("col"), py::arg("flags"), py::arg("thickness"))
py::overload_cast<const std::vector<ImVec2> &, ImU32, ImDrawFlags, float>(&ImDrawList::AddPolyline), py::arg("points"), py::arg("col"), py::arg("flags"), py::arg("thickness"))
.def("add_convex_poly_filled",
&ImDrawList::AddConvexPolyFilled, py::arg("points"), py::arg("num_points"), py::arg("col"))
py::overload_cast<const std::vector<ImVec2> &, ImU32>(&ImDrawList::AddConvexPolyFilled), py::arg("points"), py::arg("col"))
// #endif
//
.def("add_bezier_cubic",
&ImDrawList::AddBezierCubic,
py::arg("p1"), py::arg("p2"), py::arg("p3"), py::arg("p4"), py::arg("col"), py::arg("thickness"), py::arg("num_segments") = 0,
Expand Down
2 changes: 1 addition & 1 deletion external/imgui/imgui
Submodule imgui updated 2 files
+8 −0 imgui.h
+11 −0 imgui_draw.cpp

0 comments on commit 03501e4

Please sign in to comment.