Open shellohunter opened 3 days ago
you can deffinitly integrate cimgui-go with go-sdl if you want (however idk why would you need this as ther is an sdl backend already - I'm not a big fan of it but iirc @AllenDang had some reasons to do this with CGO for glfw and I did similar thing for sdl).
In case of giu - Technically its 100% possible to make giu use sdl instead of glfw, but it wan't tested yet :smile:. You can be the first one who tries.
(I think laud here): Technically you need to override giu.Context.backend with sdlbackend from cimgui-go. The problem is that backdne.Backend is a generic type so this might be difficult to write this variable in giu :thinking: if you change
// before
type GIUContext struct {
backend backend.Backend[glfwbackend.GLFWWindowFlags]
// after
type GIUContext[FLAGST ~int] struct {
backend backend.Backend[FLAGST]
Now it will be difficutl to define giu.Context
variable's type
This might require some cimgui-go refactor as well
Here's my scenario: I've been working on a go-sdl2 project for a couple of days, it goes well, then I want to add a gui toolset for it, so I found giu. the demo was pretty cute, exactly what I'm looking for. I think there should be more gl-sdl2 users thinking about the same thing.
unfortunately, once I introduce giu into the project, my go-sdl2 program keeps throwing unknown errors. I mean, some of the go-sdl2 api stop working and give me an empty error. those errors are all gone if I eliminate giu code.
After some debugging, I realized that the two projects were not working the way I expected.
Thanks for you suggestion. giu is quite a new thing to me, I'll dig for a while see if I can make it~
@shellohunter as far as I see, the thing you're looking for is rather cimgui-go, not giu. We try to keep giu as simple as possible. Especially we want users don't need to care about so called backend (opengl/glfw/sdl things) so giu is really top-level. We can ofc consider adding some features to change backend (as long as it is fully optional)
Generally first of all you need to implement your use-case with cimgui-go
yes, you would be right. I thought cimgui-go was a auto-generated binding, so i post it here since giu is more active, :-) actually I also tried cimgui-go with go-sdl2, and I got the same errors. so, the situation is pretty much the same. hopefully replacing the backend could be the way out.
Related problem
No response
Your request
I know that giu can work with sdl2 backend, but it goes with sdl2 cgo, right? Is it possible to integrate giu with go-sdl2 ((https://github.com/veandco/go-sdl2) ? I mean, seamlessly. yesterday I gave it a try and it seems they two have their owen deps, and work independently.
Alternative solution
No response
Additional context
No response