cimgui-go icon indicating copy to clipboard operation
cimgui-go copied to clipboard

Idea: move implot functions to a separate package

Open eliasdaler opened this issue 3 years ago • 6 comments

Hello. When working on #20, I've noticed that some enum names can clash if we remove prefixes, e.g. ImAxis from implot and ImGuiAxis from Dear ImGui.

This got me thinking... what if we move all implot things to a directory called "implot" and call this package "implot as well"? This way, people would be able to do this:

import "github.com/AllenDang/cimgui-go/implot"

// later in code
implot.SomeFunc()

and people who don't use implot won't get their autocomplete suggestions polluted by implot funcs/enums/structs if they don't want to use them.

eliasdaler avatar Oct 31 '22 10:10 eliasdaler

Agree. This will be a better way to integrate 3rd party libs.

AllenDang avatar Oct 31 '22 10:10 AllenDang

Okay, I'll do it when I'll rename "cimgui" package to "imgui" package

eliasdaler avatar Oct 31 '22 10:10 eliasdaler

I think cgo will be a troublesome problem。 As far as I know, there will be problems when two packages using cgo link to the same static library

SuperGod avatar Nov 08 '22 01:11 SuperGod

I'll need to try this. But if that's a case, I'm a bit shocked that Go has this problem unresolved.

eliasdaler avatar Nov 08 '22 09:11 eliasdaler

Funfact about this: C.int in one package isn't equal to C.int in the other...

gucio321 avatar Nov 21 '23 22:11 gucio321

#232 moved C backends away from cimgui-go main package. I think I'll try this for other things but at current moment can't promise anything https://github.com/gucio321/cimgui-go/tree/split-packages

gucio321 avatar Sep 13 '24 17:09 gucio321