dearimgui / dear_bindings

C header (and language binding metadata) generator for Dear ImGui
MIT License
221 stars 12 forks source link

Order of *Ex() functions #23

Open ocornut opened 1 year ago

ocornut commented 1 year ago

I feel the cimgui.h file would be easier to consume if non-Ex function where placed before the Ex functions.

In mod_generate_default_argument_functions.py I tried to replace the final statement function.parent.insert_after_child(function, [new_function]) with function.parent.insert_before_child(function, [new_function]) but comments above the function ends up in the wrong location:

CIMGUI_API bool ImGui_Button(const char* label);                                                              // Implied size = ImVec2(0, 0)
// Widgets: Main
// - Most widgets return true when the value has been changed or when pressed/selected
// - You may also use one of the many IsItemXXX functions (e.g. IsItemActive, IsItemHovered, etc.) to query widget state.
CIMGUI_API bool ImGui_ButtonEx(const char* label, ImVec2 size /* = ImVec2(0, 0) */);                          // button

May be simple to fix, creating an issue so we don't forget.

ShironekoBen commented 1 year ago

I've changed the ordering so that it puts non-Ex functions first - you change was entirely correct but just needed a couple more lines to move the attached comments onto the "other" function so that they stayed at the top of the block.