AllenDang / cimgui-go

Auto generated Go wrapper for Dear ImGui via cimgui
MIT License
340 stars 53 forks source link

Style Getters require pointer, but setters don't #351

Open Wieku opened 3 days ago

Wieku commented 3 days ago

I've just noticed that imgui.CurrentContext().Style() returns a struct, not pointer, but style getters require a pointer, but setters don't:

https://github.com/AllenDang/cimgui-go/blob/c39c7e5756aed4af83b92429ffbc7e4390227f1a/imgui/cimgui_funcs.go#L29328-L29341

It works fine if I do this:

cStyle := imgui.CurrentContext().Style()
bSize := (&cStyle).WindowBorderSize()

But given that Style struct already holds a pointer I don't think there's a need for getter receivers to require a pointer as well. Unless I'm missing something :p

gucio321 commented 2 days ago

@Wieku I think you should use imgui.CurrentStyle instead as it returns pointr