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

webgl support? #13

Open
gucio321 opened this issue Sep 22, 2022 · 10 comments
Open

webgl support? #13

gucio321 opened this issue Sep 22, 2022 · 10 comments
Labels
build documentation Improvements or additions to documentation frozen can't make any progress here, because of independent on us reasons

Comments

@gucio321
Copy link
Collaborator

Hi there!
IT IS AWESOME!!!!!!! Finally there is some imgui wrapper that is 100% automatic ;-)

What should be done to support WebGl? for now, the build output looks as follows:

[examples (0) ]$ GOOS="js" GOARCH="wasm" go build -o main.wasm main.go 
# github.com/AllenDang/cimgui-go
../texture.go:18:9: undefined: ImTextureID
../texture.go:24:11: undefined: CreateTextureRgba
../texture.go:43:2: undefined: DeleteTexture
../texture.go:46:24: undefined: ImTextureID

let me know if I can help ;-)

@gucio321
Copy link
Collaborator Author

okey, I forgot to enable CGO, now the error is diffrent:

[examples (2) ]$ CGO_ENABLED=1 GOOS="js" GOARCH="wasm" go build -o main.wasm main.go 
# runtime/cgo
cgo: unknown ptrSize for $GOARCH "wasm"

@gucio321
Copy link
Collaborator Author

well, two years ago it was this way: golang/go#40543

@gucio321
Copy link
Collaborator Author

I found this one; maybe it could be used to compile C code into webgl? https://emscripten.org/docs/introducing_emscripten/about_emscripten.html

@gucio321
Copy link
Collaborator Author

well, so emscripten is able to compile DearImGui. the next step is, to enable this feature in CGO: golang/go#55351

@gucio321
Copy link
Collaborator Author

ok, so I'm done with researches for today 😄 waiting for any feedback

@AllenDang
Copy link
Owner

@gucio321 Hah, WebGL is out of my knowledge scope... But, I will do some research!

@AllenDang
Copy link
Owner

@gucio321 I spent two days but sadly saying I didn't find a way. Sign...

@gucio321
Copy link
Collaborator Author

@AllenDang takie a look on this one: golang/go#55351

This issue needs to wait for a new go release

@gucio321 gucio321 added enhancement New feature or request frozen can't make any progress here, because of independent on us reasons labels Dec 3, 2022
@gucio321 gucio321 added build question Further information is requested documentation Improvements or additions to documentation and removed enhancement New feature or request question Further information is requested labels Sep 14, 2023
@SeyRyuu
Copy link

SeyRyuu commented Sep 29, 2023

Hey @gucio321
do you have any news or alternatives on this?
I'm also interested in using webgl, but I think it is still frozen due to the "cgo and wasm" issue, isn't it?

@gucio321
Copy link
Collaborator Author

Hey @gucio321
do you have any news or alternatives on this?
I'm also interested in using webgl, but I think it is still frozen due to the "cgo and wasm" issue, isn't it?

@SeyRyuu sorry for late reply, but even for today its still frozen because of golang issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build documentation Improvements or additions to documentation frozen can't make any progress here, because of independent on us reasons
Projects
None yet
Development

No branches or pull requests

3 participants