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

float32 array arguments #84

Closed
neclepsio opened this issue Jan 12, 2023 · 5 comments
Closed

float32 array arguments #84

neclepsio opened this issue Jan 12, 2023 · 5 comments
Labels
enhancement New feature or request

Comments

@neclepsio
Copy link
Contributor

ColorPicker?V functions take a [?]*float32 arguments. I think a *[?]float32 would be a more practical choice. Compare:

color := [3]float32{}
col := [3]*float32{&color[0], &color[1], &color[2]}
imgui.ColorPicker3V(id, col, cpFlags)

With:

color := [3]float32{}
imgui.ColorPicker3V(id, &color, cpFlags)
@neclepsio
Copy link
Contributor Author

Same for Slider and DragFloat.

@neclepsio neclepsio changed the title ColorPicker color arguments float32 array arguments Jan 12, 2023
@gucio321 gucio321 added the enhancement New feature or request label Jan 12, 2023
@gucio321

This comment was marked as outdated.

@gucio321
Copy link
Collaborator

gucio321 commented Jan 12, 2023

Why not.
Need to edit arguments_wrapper.go.simplePtrArrayW(...)

@gucio321
Copy link
Collaborator

@neclepsio what do you think about doing the same for slices?
currently, it is []*type, can we change it to *[]type or even []type? (I mean, if it wouldn't break "pointing ability of pointers", also, iirc slice is pointer itself so we don't need to make it pointer twice)

gucio321 added a commit to gucio321/cimgui-go that referenced this issue Jan 12, 2023
imo it is more logical for programmers to say just &myArray than creating a new array with pointers to each element of our array

reffer AllenDang#84
@gucio321
Copy link
Collaborator

I think, it is fixed, closing.

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

No branches or pull requests

2 participants