Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple return values ordering #5

Open
ocornut opened this issue Feb 13, 2018 · 2 comments
Open

Multiple return values ordering #5

ocornut opened this issue Feb 13, 2018 · 2 comments
Assignees

Comments

@ocornut
Copy link

ocornut commented Feb 13, 2018

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 ocornut changed the title Return values ordering Multiple return values ordering Feb 13, 2018
@casssoft casssoft self-assigned this Apr 15, 2018
@casssoft
Copy link
Owner

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

@ocornut
Copy link
Author

ocornut commented Apr 16, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants