AllenDang / cimgui-go

Auto generated Go wrapper for Dear ImGui via cimgui
MIT License
298 stars 42 forks source link

GLFW Backend and it’s place within the library #41

Open eliasdaler opened 1 year ago

eliasdaler commented 1 year ago

Currently, we have a GLFW backend as a part of "main" repo, but should it stay that way?

I think it might be better to move it to "examples" directory, because you can use cimgui-go without it by implementing another backend with a lib of your choice.

For example, I managed to get cimgui-go working with Ebitengine. I even believe it might be a "better" example, because it’s (almost) a pure Go library, plays better with Go ecosystem, and doesn’t require you to use CGo (so the only CGo code left is between your program and Dear ImGui itself).

So, my proposal is this:

A. Move glfw backend to "example/glfw" directory.

OR

B. If you want to make glfw backend a reusable package, I believe that making it a separate repo might be better (kinda like imgui-go did with [this repo](https://github.com/inkyblackness/imgui-go-examples, but don’t make backend impl "internal")

AllenDang commented 1 year ago

@eliasdaler The reason why I start all this is, neither imgui nor imgui-go provides a ready-to-use library, they all need me to find or implement a backend to get everything work. This repo and giu should provide a gui framework which could be used immediately without extra work. That's why I added a default backend implementation inside with a build flag to remove it.

The question behind actually is, who is the target user of this lib, tool creator wants a UI or game engine engineer? I prefer the first.

BTW, all implementation of the backends provides by imgui are immature just as their name implies "example".

eliasdaler commented 1 year ago

Can't the backend be moved to a separate repo/package or inside giu itself? cimgui-go should be usable in other contexts (in Ebitengine, for example or with SDL-go wrapper lib), and I'd prefer if I didn't have to do anything to remove the things I don't need (like implot which I don't need... but that's another issue.).

If the user wants to have a GLFW backend, they can import "glfwbackend" package. It the user wants pure cimgui-go binding, they can import "cimgui".

Ideally, the output of cimgui-go should be treated as a simple Go package which can function without any other things. And currently, Go module system doesn't allow you to "remove" features it they're a part of the package. It only allows you to separate one big package into several, which is what I'd prefer.

gucio321 commented 1 year ago

In my opinion the perfect scenario would be that cimgui-go should have a backend implementation set by default, for people who wants just "plug-and-play" this package. but it should be a method "SetBackend(backend Backend)" that allows to change the default implementation. This way, we just need an interface Backend that exposes the necessary methods (just like the old AllenDang/imgui-go had)

eliasdaler commented 1 year ago

I think that cimgui-go might have the following structure:

./
    glfwbackend/
        backend.go
        // and other files of backend impl
    funcs.go
    types.go // and the rest of "wrapper" stuff

This way, if people want to use the backend, they can do this:

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

...

glfwbackend.Start()

And at this point it's not much different to moving a backend to another repo, so people would just do:

import (
    "github.com/AllenDang/glfwbackend"
    "github.com/AllenDang/cimgui-go"
)
...

glfwbackend.Start()
...
cimgui.Text("...")

It is "plug-and-play", but it makes cimgui-go not grab GLFW for me if I don't ever need it. I only need cimgui bindings.

gucio321 commented 1 year ago

or even better:

.
└── pkg
    ├── backend
    │   └── glfw
    └── cimgui

This way, go will not grab (iirc) glfw if it is not imported, it will just use cimgui

eliasdaler commented 1 year ago

I don't like "pkg" directory too much. Most good packages don't require you to import them like this:

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

You just import them like this:

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

And I think that it would still import GLFW unless "backend" package has a separate go.mod, so at this point it's better to move backend implementation to a separate repo or make a separate "go.mod" for it.

eliasdaler commented 1 year ago

@AllenDang now that we've decided to remove GLFW backend, how should I do it? I think cimgui-go might contain ebiten-imgui inside of it until its ported to cimgui-go in upstream (should be quick), but what do we do after?

Do we leave the example/main.go which shows how to use cimgui-go and ebiten-imgui? I don't think we need to store the backend itself inside this repo, it will be redundant.

AllenDang commented 1 year ago

@eliasdaler I prefer to store the backend into this repo and use a build flag to remove it, like what it is for GLFW backend.

eliasdaler commented 1 year ago

I wouldn't be comfortable with taking someone's code and putting it into another repo, essentially making a hard fork of it. Guess I'll try to rewrite a GLFW backend to live in another package so that users who go get cimgui-go don't have to depend on GLFW or this backend...

AllenDang commented 1 year ago

So you suggest we create a new repo say it's named "cimgui-go-backend-ebiten", and add a example code inside cimgui-go to demonstrate the usage, and add a section to readme like "backend"?

I'm ok with it.

eliasdaler commented 1 year ago

No, I suggest to add "examples" directory here and demonstrate the usage there. Importing "ebiten-imgui" would be enough to make it work so we don't need "cimgui-go-backend-ebiten" to not duplicate code of "ebiten-imgui" repo.

I would be okay with making "cimgui-go-backend-glfw" repo, though.

AllenDang commented 1 year ago

I think we will eventually need to modify the backend, let me create the repo now.

eliasdaler commented 1 year ago

If we need to modify it, we can just send PRs to ebiten-imgui repo...

gucio321 commented 1 year ago

yah, and (if something unexpected happens) can fork the upstream and use it with go mod edit -replace

AllenDang commented 1 year ago

Ok, let use ebiten-imgui.

AllenDang commented 1 year ago

ebiten backend provides a chance to solve two major issues which comes with imgui's GLFW backend:

  1. LoadTexture in a coroutine. Since imgui's GLFW backend launch opengl in main thread, it is very hard to implement loading texture in a coroutine.
  2. A proper video player.
Chillance commented 1 year ago

So, I'm getting this now currently:

backend.cpp:9:10: fatal error: thirdparty/glfw/include/GLFW/glfw3.h: No such file or directory
    9 | #include "thirdparty/glfw/include/GLFW/glfw3.h" // Will drag system OpenGL headers

I'm guessing it's because it's a submodule and not not included when building this as a library.

gucio321 commented 1 year ago

oh no, so we need to revert the other PR as well?!

EDIT I mean #40

eliasdaler commented 1 year ago

@gucio321 yes

@Chillance note that GLFW backend will soon be replaced in favor of ebiten-imgui.

gucio321 commented 1 year ago

@gucio321 yes

well... let's go ahead and do it

GoWeasel commented 1 year ago

Interesting discussion here

Who is the lib user? on long term i would suggest, both,

Backend flexibility ?

About Ebiten: nice for 2D thinks, but i need 3D on div parts, so not my choice,

just replacing it as Eliasdaler announced to Chillance is a really bad idea, better do such thing on a seperate repro, and make cimgui-go flexibel to use different backends

at today nobody knows which backends will fit as best in feature, so a flex base would be great, as example: think about perhaps future easier vulkan ways?

GoWeasel commented 1 year ago

ebiten backend provides a chance to solve two major issues which comes with imgui's GLFW backend:

LoadTexture in a coroutine. Since imgui's GLFW backend launch opengl in main thread, it is very hard to implement loading texture in a coroutine.

is that not more a general opengl single thread problem than a glfw problem?, prop. take vulkan

image

gucio321 commented 1 year ago

Who is the lib user? on long term i would suggest, both,

(A) the one who just need to create a quick simple tool for easy tasks, (B) the one who builds up a bigger project.

Don't forget about giu In my opinion this framework should be for these users, who REALLY need greate customization abilities. These one, who just want to create a simple UI should use giu rather than cimgui-go

Backend flexibility ?

should be a must have, like in imgui of course for the (A) User just take 1 default backend, and all other optional like custom backend.

technically, we should have an interface with all the metods backend needs to expose. Over that, the default backend is (just like you said) "must have". I suppose that most users would like to have such a basic thing already implemented so that they don't need to play 20 hours to implement them.

gucio321 commented 1 year ago

also, I'm just looking at this and I'm not sure if cimgui-go actually uses backend somehow. As far as I see it is only used by examples and is mostly encapsulated in backend.go IMO in order to solve this somehow, the first thing we're supposed to do is extract current backend implementation into a separated package

GoWeasel commented 1 year ago

Don't forget about giu In my opinion this framework should be for these users, who REALLY need greate customization abilities. These one, who just want to create a simple UI should use giu rather than cimgui-go

The biggest problem on giu is the different syntax, when u see an example code off imgui code, than u first need to refactor to giu code (latest on this point, you wished directly to started with cimgui-go instead of giu), concerning this point, the project is just an archive in my eyes.

Therefore the new way (cimgui-go) with more compareable syntax to imgui, with less differences, is much better. Of course there are still some points, concerning languages diffs, but mostly u can just write down and copy parts (right window = c++ imgui / left window = golang imgui project) :-)

GoWeasel commented 1 year ago

also, I'm just looking at this and I'm not sure if cimgui-go actually uses backend somehow. As far as I see it is only used by examples and is mostly encapsulated in backend.go IMO in order to solve this somehow, the first thing we're supposed to do is extract current backend implementation into a separated package

as more interoperability or flexibilty (backend choice etc) is build in cimgui-go (as long term), as more users could use it, for many different usecases, take a look at the matrix messenger project as example.

one messenger -> Whatsapp, Signal, Threma, Slack, etc..... new one... okay just code a new bridge .... fine works of course it can happens, that u then perhaps did not have 100% feature of the single app, but when u reach 80% that is more worth than to have 5 apps for messaging. (greetings from pareto principle) :yum:

eliasdaler commented 1 year ago

Backend is encapsulated, but it would be better if it lived in another repo so that cimgui-go remains compact and users who don't use GLFW won't need to clone glfw dir.

gucio321 commented 10 months ago

@AllenDang we should deffinitely switch to go-gl/glfw because:

AllenDang commented 10 months ago

@gucio321 I just recalled a bad memory back days, when Imgui released a new version, I need to go through the change logs line by line to check whether any backend stuff is changed, sometime I might just miss a single sentence about that, the backend implemented via go-gl/glfw will be broken.

As Imgui is keep evolving, these things could happen time to time.

That's why I intend to reuse the backend and extend from it in cimgui-go, as the description says, this should be a auto-generated wrapper, if we need to implement a custom backend, I prefer to do it in giu, you think?

gucio321 commented 10 months ago

Yes and no. Currently we our custom glfw wrapper. Can't we just use this one from go-gl? An use imgui_impl_glfw to go imgui things... (Ifk if its gonna eork, what do u think?) Problem with current implementation is that it is bugged as hell and generally if there is any chance to stitch to qualified version of this wrapper I'd definitely recommend to use it

gucio321 commented 10 months ago

@AllenDang We can take this C++ code and try to write equivalent using go-gl/glfw and wrapped imgui funcs, can't we?

```c++ GLFWwindow *igCreateGLFWWindow(const char *title, int width, int height, GLFWWindowFlags flags, VoidCallback afterCreateContext) { // Setup window glfwSetErrorCallback(glfw_error_callback); if (!glfwInit()) return NULL; // Decide GL+GLSL versions #if defined(IMGUI_IMPL_OPENGL_ES2) // GL ES 2.0 + GLSL 100 const char *glsl_version = "#version 100"; glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 2); glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0); glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_ES_API); #elif defined(__APPLE__) // GL 3.2 + GLSL 150 const char *glsl_version = "#version 150"; glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2); glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); // 3.2+ only glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); // Required on Mac #else // GL 3.0 + GLSL 130 const char *glsl_version = "#version 130"; glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0); // glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); // 3.2+ // only glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); // 3.0+ only #endif if ((flags & GLFWWindowFlagsNotResizable) != 0) { glfwWindowHint(GLFW_RESIZABLE, GLFW_FALSE); } if ((flags & GLFWWindowFlagsMaximized) != 0) { glfwWindowHint(GLFW_MAXIMIZED, GLFW_TRUE); } if ((flags & GLFWWindowFlagsFloating) != 0) { glfwWindowHint(GLFW_FLOATING, GLFW_TRUE); } if ((flags & GLFWWindowFlagsFrameless) != 0) { glfwWindowHint(GLFW_FLOATING, GLFW_TRUE); } if ((flags & GLFWWindowFlagsTransparent) != 0) { glfwWindowHint(GLFW_TRANSPARENT_FRAMEBUFFER, GLFW_TRUE); } // Create window with graphics context GLFWwindow *window = glfwCreateWindow(width, height, title, NULL, NULL); if (window == NULL) return NULL; glfwMakeContextCurrent(window); glfwSwapInterval(1); // Enable vsync // Setup Dear ImGui context igCreateContext(0); if (afterCreateContext != NULL) { afterCreateContext(); } ImGuiIO *io = igGetIO(); io->ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; // Enable Keyboard Controls // io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad; // Enable Gamepad // Controls io->ConfigFlags |= ImGuiConfigFlags_DockingEnable; // Enable Docking io->ConfigFlags |= ImGuiConfigFlags_ViewportsEnable; // Enable Multi-Viewport // / Platform Windows // io.ConfigViewportsNoAutoMerge = true; // io.ConfigViewportsNoTaskBarIcon = true; io->IniFilename = ""; // Setup Dear ImGui style igStyleColorsDark(0); // igStyleColorsLight(); // When viewports are enabled we tweak WindowRounding/WindowBg so platform // windows can look identical to regular ones. ImGuiStyle *style = igGetStyle(); if (io->ConfigFlags & ImGuiConfigFlags_ViewportsEnable) { style->WindowRounding = 0.0f; style->Colors[ImGuiCol_WindowBg].w = 1.0f; } // Setup Platform/Renderer backends ImGui_ImplGlfw_InitForOpenGL(window, true); ImGui_ImplOpenGL3_Init(glsl_version); // Install extra callback glfwSetWindowRefreshCallback(window, glfw_window_refresh_callback); glfwMakeContextCurrent(NULL); return window; } void glfw_render(GLFWwindow *window, VoidCallback renderLoop) { // Start the Dear ImGui frame ImGui_ImplOpenGL3_NewFrame(); ImGui_ImplGlfw_NewFrame(); igNewFrame(); glfwSetWindowUserPointer(window, (void *)renderLoop); // Do ui stuff here if (renderLoop != NULL) { renderLoop(); } // Rendering igRender(); int display_w, display_h; glfwGetFramebufferSize(window, &display_w, &display_h); glViewport(0, 0, display_w, display_h); glClearColor(clear_color.x * clear_color.w, clear_color.y * clear_color.w, clear_color.z * clear_color.w, clear_color.w); glClear(GL_COLOR_BUFFER_BIT); ImGui_ImplOpenGL3_RenderDrawData(igGetDrawData()); ImGuiIO *io = igGetIO(); // Update and Render additional Platform Windows // (Platform functions may change the current OpenGL context, so we // save/restore it to make it easier to paste this code elsewhere. // For this specific demo app we could also call // glfwMakeContextCurrent(window) directly) if (io->ConfigFlags & ImGuiConfigFlags_ViewportsEnable) { GLFWwindow *backup_current_context = glfwGetCurrentContext(); igUpdatePlatformWindows(); igRenderPlatformWindowsDefault(NULL, NULL); glfwMakeContextCurrent(backup_current_context); } glfwSwapBuffers(window); } void igRunLoop(GLFWwindow *window, VoidCallback loop, VoidCallback beforeRender, VoidCallback afterRender, VoidCallback beforeDestroyContext) { glfwMakeContextCurrent(window); ImGuiIO *io = igGetIO(); // Load Fonts // - If no fonts are loaded, dear imgui will use the default font. You can // also load multiple fonts and use igPushFont()/PopFont() to select them. // - AddFontFromFileTTF() will return the ImFont* so you can store it if you // need to select the font among multiple. // - If the file cannot be loaded, the function will return NULL. Please // handle those errors in your application (e.g. use an assertion, or display // an error and quit). // - The fonts will be rasterized at a given size (w/ oversampling) and stored // into a texture when calling ImFontAtlas::Build()/GetTexDataAsXXXX(), which // ImGui_ImplXXXX_NewFrame below will call. // - Read 'docs/FONTS.md' for more instructions and details. // - Remember that in C/C++ if you want to include a backslash \ in a string // literal you need to write a double backslash \\ ! // io.Fonts->AddFontDefault(); // io.Fonts->AddFontFromFileTTF("../../misc/fonts/Roboto-Medium.ttf", 16.0f); // io.Fonts->AddFontFromFileTTF("../../misc/fonts/Cousine-Regular.ttf", 15.0f); // io.Fonts->AddFontFromFileTTF("../../misc/fonts/DroidSans.ttf", 16.0f); // io.Fonts->AddFontFromFileTTF("../../misc/fonts/ProggyTiny.ttf", 10.0f); // ImFont* font = // io.Fonts->AddFontFromFileTTF("c:\\Windows\\Fonts\\ArialUni.ttf", 18.0f, // NULL, io.Fonts->GetGlyphRangesJapanese()); IM_ASSERT(font != NULL); // Main loop double lasttime = glfwGetTime(); while (!glfwWindowShouldClose(window)) { if (beforeRender != NULL) { beforeRender(); } glfw_render(window, loop); while (glfwGetTime() < lasttime + 1.0 / glfw_target_fps) { // do nothing here } lasttime += 1.0 / glfw_target_fps; if (extra_frame_count > 0) { extra_frame_count--; } else { glfwWaitEvents(); extra_frame_count = MAX_EXTRA_FRAME_COUNT; } glfwPollEvents(); if (afterRender != NULL) { afterRender(); } } // Cleanup ImGui_ImplOpenGL3_Shutdown(); ImGui_ImplGlfw_Shutdown(); if (beforeDestroyContext != NULL) { beforeDestroyContext(); } igDestroyContext(0); glfwDestroyWindow(window); glfwTerminate(); return; } ```
gucio321 commented 10 months ago

@AllenDang the longer I look at it, the more am I convinced of this refactor being possible. I did a dev branch on https://github.com/gucio321/cimgui-go/tree/backend-refactor It fails builds yet, but should be possible to fix...

AllenDang commented 10 months ago

@AllenDang We can take this C++ code and try to write equivalent using go-gl/glfw and wrapped imgui funcs, can't we?

That's what I did in giu, translate line by line. I'm ok to do it, using giu's solution, define an interface of backend abstract platform and render, and implement a glfw backend entirely in go.

gucio321 commented 10 months ago

meh, I think I understand. So in current impl, if something doesn't work you can just copy code from imgui example right?

eliasdaler commented 10 months ago

I feel like this discussion got sidetracked. My issue was only the placement of glfw backend which should be in a separate package and not required for import for everyone, since you can probably use cimgui-go with different backends.

gucio321 commented 10 months ago

I feel like this discussion got sidetracked. My issue was only the placement of glfw backend which should be in a separate package and not required for import for everyone, since you can probably use cimgui-go with different backends.

This is already implemented - There is backend.go with a kind of abstraction layer from glfw_backend.go that can be excluded by applying appropiate build tag. Now you can implement imgui.Backend interface and it should render

gucio321 commented 10 months ago

@AllenDang so could you please try to address #209 and #194

damntourists commented 4 months ago

Hey there, sorry to dig up an old post --

I'm currently writing an experimental backend that allows for the use of ebitengine and imgui concurrently, basically what ebiten-imgui allowed users to do (see the above closed thread on gabstv's repo) however I am facing compilation issues. Right now, if I try to include https://github.com/hajimehoshi/ebiten in my project when also including this repository, I get the following error:

/home/brett/sdk/go1.22.0/pkg/tool/linux_amd64/link: running g++ failed: exit status 1
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(input.c.o): in function `_glfwInputKey':
input.c:(.text+0xaf3): multiple definition of `_glfwInputKey'; /tmp/go-link-3168664362/000064.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/input.c:27: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(input.c.o): in function `_glfwInputChar':
input.c:(.text+0xbfd): multiple definition of `_glfwInputChar'; /tmp/go-link-3168664362/000064.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/input.c:58: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(input.c.o): in function `_glfwInputScroll':
input.c:(.text+0xc9b): multiple definition of `_glfwInputScroll'; /tmp/go-link-3168664362/000064.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/input.c:78: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(input.c.o): in function `_glfwInputMouseClick':
input.c:(.text+0xcee): multiple definition of `_glfwInputMouseClick'; /tmp/go-link-3168664362/000064.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/input.c:86: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(input.c.o): in function `_glfwInputCursorPos':
input.c:(.text+0xd8e): multiple definition of `_glfwInputCursorPos'; /tmp/go-link-3168664362/000064.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/input.c:106: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(input.c.o): in function `_glfwInputCursorEnter':
input.c:(.text+0xe39): multiple definition of `_glfwInputCursorEnter'; /tmp/go-link-3168664362/000064.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/input.c:120: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(input.c.o): in function `_glfwInputDrop':
input.c:(.text+0xe78): multiple definition of `_glfwInputDrop'; /tmp/go-link-3168664362/000064.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/input.c:128: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(input.c.o): in function `_glfwCenterCursorInContentArea':
input.c:(.text+0x134e): multiple definition of `_glfwCenterCursorInContentArea'; /tmp/go-link-3168664362/000064.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/input.c:141: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(input.c.o): in function `glfwGetInputMode':
input.c:(.text+0x13e7): multiple definition of `glfwGetInputMode'; /tmp/go-link-3168664362/000064.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/input.c:154: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(input.c.o): in function `glfwSetInputMode':
input.c:(.text+0x14e1): multiple definition of `glfwSetInputMode'; /tmp/go-link-3168664362/000064.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/input.c:179: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(input.c.o): in function `glfwRawMouseMotionSupported':
input.c:(.text+0x1793): multiple definition of `glfwRawMouseMotionSupported'; /tmp/go-link-3168664362/000064.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/input.c:272: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(input.c.o): in function `glfwGetKeyName':
input.c:(.text+0x17ca): multiple definition of `glfwGetKeyName'; /tmp/go-link-3168664362/000064.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/input.c:278: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(input.c.o): in function `glfwGetKeyScancode':
input.c:(.text+0x1854): multiple definition of `glfwGetKeyScancode'; /tmp/go-link-3168664362/000064.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/input.c:297: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(input.c.o): in function `glfwGetKey':
input.c:(.text+0x18cb): multiple definition of `glfwGetKey'; /tmp/go-link-3168664362/000064.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/input.c:310: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(input.c.o): in function `glfwGetMouseButton':
input.c:(.text+0x19b4): multiple definition of `glfwGetMouseButton'; /tmp/go-link-3168664362/000064.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/input.c:333: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(input.c.o): in function `glfwGetCursorPos':
input.c:(.text+0x1a9a): multiple definition of `glfwGetCursorPos'; /tmp/go-link-3168664362/000064.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/input.c:356: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(input.c.o): in function `glfwSetCursorPos':
input.c:(.text+0x1b91): multiple definition of `glfwSetCursorPos'; /tmp/go-link-3168664362/000064.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/input.c:379: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(input.c.o): in function `glfwCreateCursor':
input.c:(.text+0x1cee): multiple definition of `glfwCreateCursor'; /tmp/go-link-3168664362/000064.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/input.c:411: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(input.c.o): in function `glfwDestroyCursor':
input.c:(.text+0x1f32): multiple definition of `glfwDestroyCursor'; /tmp/go-link-3168664362/000064.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/input.c:473: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(input.c.o): in function `glfwCreateStandardCursor':
input.c:(.text+0x1e35): multiple definition of `glfwCreateStandardCursor'; /tmp/go-link-3168664362/000064.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/input.c:439: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(input.c.o): in function `glfwSetCursor':
input.c:(.text+0x2017): multiple definition of `glfwSetCursor'; /tmp/go-link-3168664362/000064.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/input.c:508: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(input.c.o): in function `glfwSetKeyCallback':
input.c:(.text+0x20ae): multiple definition of `glfwSetKeyCallback'; /tmp/go-link-3168664362/000064.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/input.c:521: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(input.c.o): in function `glfwSetCharCallback':
input.c:(.text+0x214d): multiple definition of `glfwSetCharCallback'; /tmp/go-link-3168664362/000064.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/input.c:531: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(input.c.o): in function `glfwSetCharModsCallback':
input.c:(.text+0x21ec): multiple definition of `glfwSetCharModsCallback'; /tmp/go-link-3168664362/000064.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/input.c:541: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(input.c.o): in function `glfwSetMouseButtonCallback':
input.c:(.text+0x228b): multiple definition of `glfwSetMouseButtonCallback'; /tmp/go-link-3168664362/000064.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/input.c:552: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(input.c.o): in function `glfwSetCursorPosCallback':
input.c:(.text+0x232a): multiple definition of `glfwSetCursorPosCallback'; /tmp/go-link-3168664362/000064.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/input.c:563: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(input.c.o): in function `glfwSetCursorEnterCallback':
input.c:(.text+0x23c9): multiple definition of `glfwSetCursorEnterCallback'; /tmp/go-link-3168664362/000064.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/input.c:574: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(input.c.o): in function `glfwSetScrollCallback':
input.c:(.text+0x2468): multiple definition of `glfwSetScrollCallback'; /tmp/go-link-3168664362/000064.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/input.c:585: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(input.c.o): in function `glfwSetDropCallback':
input.c:(.text+0x2507): multiple definition of `glfwSetDropCallback'; /tmp/go-link-3168664362/000064.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/input.c:595: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(input.c.o): in function `glfwSetClipboardString':
input.c:(.text+0x3a78): multiple definition of `glfwSetClipboardString'; /tmp/go-link-3168664362/000064.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/input.c:605: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(input.c.o): in function `glfwGetClipboardString':
input.c:(.text+0x3aec): multiple definition of `glfwGetClipboardString'; /tmp/go-link-3168664362/000064.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/input.c:613: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(x11_window.c.o): in function `_glfwGetWindowPropertyX11':
x11_window.c:(.text+0x4444): multiple definition of `_glfwGetWindowPropertyX11'; /tmp/go-link-3168664362/000072.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/x11_window_linbsd.c:1918: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(x11_window.c.o): in function `_glfwPlatformGetCursorPos':
x11_window.c:(.text+0x6944): multiple definition of `_glfwPlatformGetCursorPos'; /tmp/go-link-3168664362/000072.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/x11_window_linbsd.c:2865: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(x11_window.c.o): in function `_glfwPlatformSetCursorPos':
x11_window.c:(.text+0x69fe): multiple definition of `_glfwPlatformSetCursorPos'; /tmp/go-link-3168664362/000072.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/x11_window_linbsd.c:2882: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(x11_window.c.o): in function `_glfwIsVisualTransparentX11':
x11_window.c:(.text+0x44da): multiple definition of `_glfwIsVisualTransparentX11'; /tmp/go-link-3168664362/000072.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/x11_window_linbsd.c:1940: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(x11_window.c.o): in function `_glfwPlatformSetWindowDecorated':
x11_window.c:(.text+0x61c3): multiple definition of `_glfwPlatformSetWindowDecorated'; /tmp/go-link-3168664362/000072.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/x11_window_linbsd.c:2673: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(x11_window.c.o): in function `_glfwPlatformSetWindowTitle':
x11_window.c:(.text+0x4aea): multiple definition of `_glfwPlatformSetWindowTitle'; /tmp/go-link-3168664362/000072.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/x11_window_linbsd.c:2120: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(x11_window.c.o): in function `_glfwPlatformGetWindowPos':
x11_window.c:(.text+0x4ed9): multiple definition of `_glfwPlatformGetWindowPos'; /tmp/go-link-3168664362/000072.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/x11_window_linbsd.c:2202: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(x11_window.c.o): in function `_glfwPlatformGetWindowSize':
x11_window.c:(.text+0x50ab): multiple definition of `_glfwPlatformGetWindowSize'; /tmp/go-link-3168664362/000072.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/x11_window_linbsd.c:2240: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(x11_window.c.o): in function `_glfwPlatformIconifyWindow':
x11_window.c:(.text+0x55e5): multiple definition of `_glfwPlatformIconifyWindow'; /tmp/go-link-3168664362/000072.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/x11_window_linbsd.c:2362: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(x11_window.c.o): in function `_glfwPlatformWindowMaximized':
x11_window.c:(.text+0x5edc): multiple definition of `_glfwPlatformWindowMaximized'; /tmp/go-link-3168664362/000072.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/x11_window_linbsd.c:2595: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(x11_window.c.o): in function `_glfwPushSelectionToManagerX11':
x11_window.c:(.text+0x4550): multiple definition of `_glfwPushSelectionToManagerX11'; /tmp/go-link-3168664362/000072.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/x11_window_linbsd.c:1951: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(x11_window.c.o): in function `_glfwPlatformCreateWindow':
x11_window.c:(.text+0x464c): multiple definition of `_glfwPlatformCreateWindow'; /tmp/go-link-3168664362/000072.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/x11_window_linbsd.c:2001: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(x11_window.c.o): in function `_glfwPlatformShowWindow':
x11_window.c:(.text+0x59e4): multiple definition of `_glfwPlatformShowWindow'; /tmp/go-link-3168664362/000072.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/x11_window_linbsd.c:2476: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(x11_window.c.o): in function `_glfwPlatformFocusWindow':
x11_window.c:(.text+0x5b0a): multiple definition of `_glfwPlatformFocusWindow'; /tmp/go-link-3168664362/000072.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/x11_window_linbsd.c:2503: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(x11_window.c.o): in function `_glfwPlatformDestroyWindow':
x11_window.c:(.text+0x494d): multiple definition of `_glfwPlatformDestroyWindow'; /tmp/go-link-3168664362/000072.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/x11_window_linbsd.c:2086: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(x11_window.c.o): in function `_glfwPlatformSetWindowIcon':
x11_window.c:(.text+0x4c18): multiple definition of `_glfwPlatformSetWindowIcon'; /tmp/go-link-3168664362/000072.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/x11_window_linbsd.c:2152: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(x11_window.c.o): in function `_glfwPlatformSetWindowPos':
x11_window.c:(.text+0x4f86): multiple definition of `_glfwPlatformSetWindowPos'; /tmp/go-link-3168664362/000072.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/x11_window_linbsd.c:2216: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(x11_window.c.o): in function `_glfwPlatformWindowVisible':
x11_window.c:(.text+0x5e67): multiple definition of `_glfwPlatformWindowVisible'; /tmp/go-link-3168664362/000072.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/x11_window_linbsd.c:2588: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(x11_window.c.o): in function `_glfwPlatformSetWindowSize':
x11_window.c:(.text+0x5155): multiple definition of `_glfwPlatformSetWindowSize'; /tmp/go-link-3168664362/000072.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/x11_window_linbsd.c:2251: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(x11_window.c.o): in function `_glfwPlatformSetWindowSizeLimits':
x11_window.c:(.text+0x51fa): multiple definition of `_glfwPlatformSetWindowSizeLimits'; /tmp/go-link-3168664362/000072.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/x11_window_linbsd.c:2271: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(x11_window.c.o): in function `_glfwPlatformSetWindowAspectRatio':
x11_window.c:(.text+0x527e): multiple definition of `_glfwPlatformSetWindowAspectRatio'; /tmp/go-link-3168664362/000072.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/x11_window_linbsd.c:2279: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(x11_window.c.o): in function `_glfwPlatformGetFramebufferSize':
x11_window.c:(.text+0x52fb): multiple definition of `_glfwPlatformGetFramebufferSize'; /tmp/go-link-3168664362/000072.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/x11_window_linbsd.c:2287: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(x11_window.c.o): in function `_glfwPlatformGetWindowFrameSize':
x11_window.c:(.text+0x532d): multiple definition of `_glfwPlatformGetWindowFrameSize'; /tmp/go-link-3168664362/000072.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/x11_window_linbsd.c:2294: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(x11_window.c.o): in function `_glfwPlatformGetWindowContentScale':
x11_window.c:(.text+0x5592): multiple definition of `_glfwPlatformGetWindowContentScale'; /tmp/go-link-3168664362/000072.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/x11_window_linbsd.c:2354: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(x11_window.c.o): in function `_glfwPlatformRestoreWindow':
x11_window.c:(.text+0x5667): multiple definition of `_glfwPlatformRestoreWindow'; /tmp/go-link-3168664362/000072.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/x11_window_linbsd.c:2377: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(x11_window.c.o): in function `_glfwPlatformWindowIconified':
x11_window.c:(.text+0x5e40): multiple definition of `_glfwPlatformWindowIconified'; /tmp/go-link-3168664362/000072.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/x11_window_linbsd.c:2583: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(x11_window.c.o): in function `_glfwPlatformMaximizeWindow':
x11_window.c:(.text+0x57a4): multiple definition of `_glfwPlatformMaximizeWindow'; /tmp/go-link-3168664362/000072.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/x11_window_linbsd.c:2411: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(x11_window.c.o): in function `_glfwPlatformHideWindow':
x11_window.c:(.text+0x5a39): multiple definition of `_glfwPlatformHideWindow'; /tmp/go-link-3168664362/000072.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/x11_window_linbsd.c:2485: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(x11_window.c.o): in function `_glfwPlatformRequestWindowAttention':
x11_window.c:(.text+0x5a86): multiple definition of `_glfwPlatformRequestWindowAttention'; /tmp/go-link-3168664362/000072.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/x11_window_linbsd.c:2491: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(x11_window.c.o): in function `_glfwPlatformSetWindowMonitor':
x11_window.c:(.text+0x5be1): multiple definition of `_glfwPlatformSetWindowMonitor'; /tmp/go-link-3168664362/000072.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/x11_window_linbsd.c:2521: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(x11_window.c.o): in function `_glfwPlatformSetWindowFloating':
x11_window.c:(.text+0x628e): multiple definition of `_glfwPlatformSetWindowFloating'; /tmp/go-link-3168664362/000072.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/x11_window_linbsd.c:2678: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(x11_window.c.o): in function `_glfwPlatformWindowFocused':
x11_window.c:(.text+0x5dd2): multiple definition of `_glfwPlatformWindowFocused'; /tmp/go-link-3168664362/000072.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/x11_window_linbsd.c:2574: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(x11_window.c.o): in function `_glfwPlatformWindowHovered':
x11_window.c:(.text+0x600e): multiple definition of `_glfwPlatformWindowHovered'; /tmp/go-link-3168664362/000072.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/x11_window_linbsd.c:2630: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(x11_window.c.o): in function `_glfwPlatformFramebufferTransparent':
x11_window.c:(.text+0x6108): multiple definition of `_glfwPlatformFramebufferTransparent'; /tmp/go-link-3168664362/000072.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/x11_window_linbsd.c:2658: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(x11_window.c.o): in function `_glfwPlatformSetWindowResizable':
x11_window.c:(.text+0x615f): multiple definition of `_glfwPlatformSetWindowResizable'; /tmp/go-link-3168664362/000072.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/x11_window_linbsd.c:2666: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(x11_window.c.o): in function `_glfwPlatformGetWindowOpacity':
x11_window.c:(.text+0x654b): multiple definition of `_glfwPlatformGetWindowOpacity'; /tmp/go-link-3168664362/000072.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/x11_window_linbsd.c:2767: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(x11_window.c.o): in function `_glfwPlatformSetWindowOpacity':
x11_window.c:(.text+0x6657): multiple definition of `_glfwPlatformSetWindowOpacity'; /tmp/go-link-3168664362/000072.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/x11_window_linbsd.c:2790: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(x11_window.c.o): in function `_glfwPlatformSetRawMouseMotion':
x11_window.c:(.text+0x66fa): multiple definition of `_glfwPlatformSetRawMouseMotion'; /tmp/go-link-3168664362/000072.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/x11_window_linbsd.c:2798: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(x11_window.c.o): in function `_glfwPlatformRawMouseMotionSupported':
x11_window.c:(.text+0x675a): multiple definition of `_glfwPlatformRawMouseMotionSupported'; /tmp/go-link-3168664362/000072.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/x11_window_linbsd.c:2812: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(x11_window.c.o): in function `_glfwPlatformPollEvents':
x11_window.c:(.text+0x6771): multiple definition of `_glfwPlatformPollEvents'; /tmp/go-link-3168664362/000072.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/x11_window_linbsd.c:2817: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(x11_window.c.o): in function `_glfwPlatformWaitEvents':
x11_window.c:(.text+0x68f5): multiple definition of `_glfwPlatformWaitEvents'; /tmp/go-link-3168664362/000072.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/x11_window_linbsd.c:2848: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(x11_window.c.o): in function `_glfwPlatformWaitEventsTimeout':
x11_window.c:(.text+0x690f): multiple definition of `_glfwPlatformWaitEventsTimeout'; /tmp/go-link-3168664362/000072.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/x11_window_linbsd.c:2854: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(x11_window.c.o): in function `_glfwPlatformPostEmptyEvent':
x11_window.c:(.text+0x6934): multiple definition of `_glfwPlatformPostEmptyEvent'; /tmp/go-link-3168664362/000072.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/x11_window_linbsd.c:2860: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(x11_window.c.o): in function `_glfwPlatformSetCursorMode':
x11_window.c:(.text+0x6aac): multiple definition of `_glfwPlatformSetCursorMode'; /tmp/go-link-3168664362/000072.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/x11_window_linbsd.c:2893: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(x11_window.c.o): in function `_glfwPlatformGetScancodeName':
x11_window.c:(.text+0x6b2d): multiple definition of `_glfwPlatformGetScancodeName'; /tmp/go-link-3168664362/000072.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/x11_window_linbsd.c:2908: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(x11_window.c.o): in function `_glfwPlatformGetKeyScancode':
x11_window.c:(.text+0x6cbb): multiple definition of `_glfwPlatformGetKeyScancode'; /tmp/go-link-3168664362/000072.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/x11_window_linbsd.c:2938: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(x11_window.c.o): in function `_glfwPlatformCreateCursor':
x11_window.c:(.text+0x6ce2): multiple definition of `_glfwPlatformCreateCursor'; /tmp/go-link-3168664362/000072.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/x11_window_linbsd.c:2945: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(x11_window.c.o): in function `_glfwPlatformCreateStandardCursor':
x11_window.c:(.text+0x6d33): multiple definition of `_glfwPlatformCreateStandardCursor'; /tmp/go-link-3168664362/000072.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/x11_window_linbsd.c:2954: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(x11_window.c.o): in function `_glfwPlatformDestroyCursor':
x11_window.c:(.text+0x6e17): multiple definition of `_glfwPlatformDestroyCursor'; /tmp/go-link-3168664362/000072.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/x11_window_linbsd.c:3053: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(x11_window.c.o): in function `_glfwPlatformSetCursor':
x11_window.c:(.text+0x6e58): multiple definition of `_glfwPlatformSetCursor'; /tmp/go-link-3168664362/000072.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/x11_window_linbsd.c:3059: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(x11_window.c.o): in function `_glfwPlatformSetClipboardString':
x11_window.c:(.text+0x6e9f): multiple definition of `_glfwPlatformSetClipboardString'; /tmp/go-link-3168664362/000072.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/x11_window_linbsd.c:3068: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(x11_window.c.o): in function `_glfwPlatformGetClipboardString':
x11_window.c:(.text+0x6f74): multiple definition of `_glfwPlatformGetClipboardString'; /tmp/go-link-3168664362/000072.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/x11_window_linbsd.c:3087: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(x11_window.c.o): in function `glfwGetX11Display':
x11_window.c:(.text+0x745b): multiple definition of `glfwGetX11Display'; /tmp/go-link-3168664362/000072.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/x11_window_linbsd.c:3097: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(x11_window.c.o): in function `glfwGetX11Window':
x11_window.c:(.text+0x749b): multiple definition of `glfwGetX11Window'; /tmp/go-link-3168664362/000072.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/x11_window_linbsd.c:3103: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(x11_window.c.o): in function `glfwSetX11SelectionString':
x11_window.c:(.text+0x74e8): multiple definition of `glfwSetX11SelectionString'; /tmp/go-link-3168664362/000072.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/x11_window_linbsd.c:3110: first defined here
/usr/bin/ld: /home/brett/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240219164318-ef715f47b06e/lib/linux/x64/libglfw3.a(x11_window.c.o): in function `glfwGetX11SelectionString':
x11_window.c:(.text+0x75da): multiple definition of `glfwGetX11SelectionString'; /tmp/go-link-3168664362/000072.o:/home/brett/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.6.6/internal/cglfw/x11_window_linbsd.c:3130: first defined here
collect2: error: ld returned 1 exit status

Compilation finished with exit code 1

This is happening because apparently CGo shares namespaces across go packages. I tried with the exclude_cimgui_glfw build tag, but now i've lost access to imgui.Texture. Is glfw required to create a texture instance?

damntourists commented 4 months ago

Thought I should mention that when I removed glfw, it produced these ld errors:

/home/brett/projects/sdk/go1.22.0/pkg/tool/linux_amd64/link: running g++ failed: exit status 1
/usr/bin/ld: /tmp/go-link-161865402/000014.o: in function `_cgo_cdf43a2df1d5_Cfunc_igCreateTexture':
/tmp/go-build/sdl_backend.cgo2.c:77:(.text+0x5d): undefined reference to `igCreateTexture'
/usr/bin/ld: /tmp/go-link-161865402/000014.o: in function `_cgo_cdf43a2df1d5_Cfunc_igDeleteTexture':
/tmp/go-build/sdl_backend.cgo2.c:92:(.text+0x88): undefined reference to `igDeleteTexture'
/usr/bin/ld: /tmp/go-link-161865402/000014.o: in function `_cgo_cdf43a2df1d5_Cfunc_igRefresh':
/tmp/go-build/sdl_backend.cgo2.c:122:(.text+0xc7): undefined reference to `igRefresh'
/usr/bin/ld: /tmp/go-link-161865402/000014.o: in function `_cgo_cdf43a2df1d5_Cfunc_igSetBgColor':
/tmp/go-build/sdl_backend.cgo2.c:249:(.text+0x1ce): undefined reference to `igSetBgColor'
/usr/bin/ld: /tmp/go-link-161865402/000014.o: in function `_cgo_cdf43a2df1d5_Cfunc_igSetTargetFPS':
/tmp/go-build/sdl_backend.cgo2.c:262:(.text+0x1e7): undefined reference to `igSetTargetFPS'
collect2: error: ld returned 1 exit status
damntourists commented 4 months ago

I started a fork at https://github.com/damntourists/cimgui-go-lite which now compiles with the ebiten golang library. all contents of the third party directory and the *_backend.* files have been removed. If you prefer, I can just keep this fork around as an alternative if you would still like to include the example backends + thirdparty code that goes with them. Personally I think it would be nice to offer them as like, addon packages and name the repos like cimgui-go-glfw-backend, cimgui-go-sdl-backend or something and have them not included with the main cimgui-go repo by default. or perhaps they could be added on to the main cimgui-go repo like git submodules, enabled by default and if the user wants to disable them, just disable the submodule? :shrug:

gucio321 commented 4 months ago

Sounds great. I would be awesome to have imgui working on ebitengine. In case of your problem: you need to disable glfw. In glfw_backend.go on the top of the file is a special go: build directive that allows to exclude this time of a special go tag is set.

damntourists commented 4 months ago

I tried using the directive, however it caused cimgui-go's Texture struct to go missing (https://github.com/AllenDang/cimgui-go/blob/main/texture.go#L1). Not sure if this was intentional or not, but it still works for me without SDL and GLFW in the repository.

gucio321 commented 4 months ago

Ok, I'll check

gucio321 commented 4 months ago

ok, I see, In my opinion texture.go should not depend on any backend - its completely unrelated wrapper.

gucio321 commented 4 months ago

Thank you for this! I've opened a PR - should be merged soon.

damntourists commented 4 months ago

Nice! Thanks for applying that fix! Now I can point back to this repository :D

gucio321 commented 4 months ago

awesome! let me know if you have some more questions. Also, we'd be interessted in putting your solution in this repository/link in our readme as I hope that ebiten compilation will be much faster than our current backend. :smile: