giu icon indicating copy to clipboard operation
giu copied to clipboard

WebGL?

Open phorcys420 opened this issue 3 years ago • 11 comments

I've used imgui-js by flyover before but it really doesn't suit my needs anymore, as I know you can compile go to wasm, would that be somehow possible with giu ?

phorcys420 avatar Jan 08 '22 17:01 phorcys420

~~doesn't wasm build work?~~ well, it may make some problems. As far as I know there is go framework that works with wasm but it is much more complicated than giu (I mean ebiten ofc) Idk what should be done to make giu able to build for webgl. Also is it even possible with C++ imgui?

gucio321 avatar Jan 09 '22 12:01 gucio321

okey, imgui builds with webgl are even possible (https://github.com/ocornut/imgui/issues/1269#issuecomment-362913787) however, to do so here we must use another backend (https://github.com/ocornut/imgui/tree/master/examples/example_emscripten_opengl3) @AllenDang is it even possible to do so in golang?

gucio321 avatar Jan 09 '22 12:01 gucio321

@gucio321 Theoretically, it's possible. Any opengl backend which supports webgl could be easily intergrated with imgui.

AllenDang avatar Jan 10 '22 13:01 AllenDang

maybe this one? https://github.com/nuberu/webgl

gucio321 avatar Jan 11 '22 10:01 gucio321

@phorcys420 Take a look at this one?, it ist possible

https://magnum.graphics/showcase/imgui/

image

Rusty-Weasel avatar Apr 06 '22 11:04 Rusty-Weasel

What do you mean? That's what we want to achieve, yes. ImGUI on the web has always been possible. But I have switched to Flutter for my UIs now so I don't think I'll look more into that issue.

phorcys420 avatar Apr 06 '22 11:04 phorcys420

As you mentioned, i mean exactly that, what you want to achieve. As you further switched to Flutty, then u can close this issue? or not?

Rusty-Weasel avatar Apr 06 '22 12:04 Rusty-Weasel

IMO this should stay open because we may deffinitly want to add webgl support for giu

gucio321 avatar Apr 06 '22 14:04 gucio321

Is this even possible? both GLFW and ImGui are using cgo. A glance test:

# runtime/cgo
cgo: unknown ptrSize for $GOARCH "wasm"

See also cgo/main.go

ii64 avatar Jul 16 '22 19:07 ii64

@AllenDang how is it going? I gonna start some project and would want to write UI using this awesome framework, but I suppose It'll need to be a webgl app. Is there any chance the feature'll be ready soon? Is it related with cimgui-go? Let me know if I can help some way

gucio321 avatar Sep 22 '22 17:09 gucio321

upstream issue in GO: https://github.com/golang/go/issues/55351 ref: https://github.com/AllenDang/cimgui-go/issues/13 Marking as external issue.

gucio321 avatar May 09 '23 15:05 gucio321