Closed ocornut closed 1 year ago
e2f03ea31a8f8e091bccdbdb13a363d01437a3c8 adds selective suppression of default argument helpers, with a few more additions to the list I found whilst scanning through the headers.
NEVER MIND my post was looking at wrong copy of cimgui.h (download from Actions but may be opened wrong one?) Adding new functions now :)
~~Thanks. I can see the block:~~
mod_generate_default_argument_functions.apply(dom_root,
# We ignore functions that don't get called often because in those
# cases the default helper doesn't add much value but does clutter
# up the header file
functions_to_ignore=[
'ImGui_LoadIniSettingsFromDisk',
'ImGui_LoadIniSettingsFromMemory',
'ImGui_SaveIniSettingsToMemory',
'ImGui_SaveIniSettingsToMemory',
'ImGui_SetAllocatorFunctions',
'ImGui_CreateContext',
'ImGui_DestroyContext',
'ImGui_ShowDemoWindow',
'ImGui_ShowMetricsWindow',
'ImGui_ShowAboutWindow',
'ImGui_ShowStyleEditor',
'ImGui_StyleColorsDark',
'ImGui_StyleColorsLight',
'ImGui_StyleColorsClassic',
[...]
But they seem to still appear in cimgui.h ?
CIMGUI_API void ImGui_StyleColorsDarkEx(ImGuiStyle* dst /* = NULL */); // new, recommended style (default)
CIMGUI_API void ImGui_StyleColorsDark(); // Implied dst = NULL
So maybe something doesn't work with it currently?
I have done a pass on cimgui.h and removed a few more Ex functions: a3c59ed There are probably other tweaks needed but for now it seems reasonable to close this. Thank you!
I believe this is a great idea but it'll require a few passes of tweaking.
would become
Seems like a good tradeoff to reduce noise of api surface, since passing a 0 flag is simple. Further parameters would still get included in the Ex() function. ImGui_TableSetupColumn() would include the flags but following parameters go in ImGui_TableSetupColumnEx().
ImGuiCond cond = 0
would become
And it is also preferable for functions that are not frequently written in user's sources e.g
(many others)
I would go as far as suggesting to consider including functions which are semi-frequently called but also frequently expanded on and easy to call with default parameters (no non-trivial types):
But we can iterate on the specific functions once we've done a first pass.