imgui_lua_bindings icon indicating copy to clipboard operation
imgui_lua_bindings copied to clipboard

Multiple return values ordering

Open ocornut opened this issue 7 years ago • 2 comments

Hello,

I believe return values should be inverted, cases like: status, floatValue = imgui.SliderFloat("SliderFloat", floatValue, 0.0, 1.0); Would be much more efficient as: floatValue, status = imgui.SliderFloat("SliderFloat", floatValue, 0.0, 1.0); Since status (= was the field modified) is rarely used. So in the vast majority of use people would just do: floatValue = imgui.SliderFloat("SliderFloat", floatValue, 0.0, 1.0);

It would be faster and easier for users. Perhaps add an option in the generator for retro-compatibility and make both available?

(Extra: Curious if the default bindings will be regenerated for latest?)

Thanks, Omar

ocornut avatar Feb 13 '18 16:02 ocornut

bindings regenerated for 1.60. Next up is changing my game to work with 1.60, then I'll try switching up the order

casssoft avatar Apr 16 '18 00:04 casssoft

Amazing work, Patrick, thanks a lot!

I was talking to @slages recently who worked on a way of switching order there: https://github.com/slages/love-imgui/commits/master But his commit is combined with a couple of other things so it's not easy to cherry-pick as is.

ocornut avatar Apr 16 '18 07:04 ocornut