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

Idea: move implot functions to a separate package #25

Closed
eliasdaler opened this issue Oct 31, 2022 · 6 comments · Fixed by #319
Closed

Idea: move implot functions to a separate package #25

eliasdaler opened this issue Oct 31, 2022 · 6 comments · Fixed by #319
Labels
enhancement New feature or request

Comments

@eliasdaler
Copy link
Contributor

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.

@AllenDang
Copy link
Owner

AllenDang commented Oct 31, 2022

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

@eliasdaler
Copy link
Contributor Author

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

@SuperGod
Copy link
Contributor

SuperGod commented Nov 8, 2022

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

@eliasdaler
Copy link
Contributor Author

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

@gucio321 gucio321 added the enhancement New feature or request label Dec 23, 2022
@gucio321
Copy link
Collaborator

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

@gucio321
Copy link
Collaborator

#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

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

Successfully merging a pull request may close this issue.

4 participants