dearimgui / dear_bindings

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

Configurable way to select which parameters can be included in non-Ex() function #24

Open ocornut opened 1 year ago

ocornut commented 1 year ago

I guess this is a followup to #10 and code in https://github.com/dearimgui/dear_bindings/commit/e2f03ea31a8f8e091bccdbdb13a363d01437a3c8#diff-bfeeec74b4af24dba625d3a2772df9610c7d430c2ba12919dde04bf652619138R46

From reviewing cimgui.h it feels like in many occurrence, some parameters would better be moved from the Ex() function into the non-Ex() function. Namely, the generally idea behind removing the number of Ex() functions what that parameters that are trivial to fill (e.g. with 0).

An example would be that this:

CIMGUI_API void ImGui_TableSetupColumnEx(const char* label, ImGuiTableColumnFlags flags /* = 0 */, float init_width_or_weight /* = 0.0f */, ImGuiID user_id /* = 0 */);
CIMGUI_API void ImGui_TableSetupColumn(const char* label);         // Implied flags = 0, init_width_or_weight = 0.0f, user_id = 0

IHMO should be output as:

CIMGUI_API void ImGui_TableSetupColumnEx(const char* label, ImGuiTableColumnFlags flags, float init_width_or_weight /* = 0.0f */, ImGuiID user_id /* = 0 */);
CIMGUI_API void ImGui_TableSetupColumn(const char* label, ImGuiTableColumnFlags flags /* = 0 */);         // Implied init_width_or_weight = 0.0f, user_id = 0

Maybe not best example because this one might be automated, but it seems it would make some sense if we could specify in the script that in this case flags should always be in the simplified function.