Support WebGL and Android
zurgeg opened this issue · 11 comments
Currently, Engo uses github.com/go-gl/gl
, which limits us to darwin
, windows
, and linux
(and freebsd
iirc). Engo should switch to a more cross-platform GL port. I propose the usage of https://github.com/goxjs/gl.
Actually, engo uses github.com/EngoEngine/gl
which has support for mobile and web!
Actually, engo uses
github.com/EngoEngine/gl
which has support for mobile and web!
Huh, I tried to build for Web and it failed
I currently use https://github.com/Noofbiz/engoWasmServer as an automated tool for testing myself, but all it uses is the normal go tools with goos=js and goarch=wasm to build. If you need more help building for us let me know, I’ll keep this open.
I currently use https://github.com/Noofbiz/engoWasmServer as an automated tool for testing myself, but all it uses is the normal go tools with goos=js and goarch=wasm to build. If you need more help building for us let me know, I’ll keep this open.
Alright, I will grab the error later.
@Noofbiz After further research, I get src/github.com/EngoEngine/gl/gl_webgl.go:1541:2: undefined: log.Error
when attempting to build EngoEngine/gl, rather then a constraint related error like I got before, but still an error. Any idea why this happens?
I updated to use the latest gl, should take care of that error message
I updated to use the latest gl, should take care of that error message
Great, I will try building, glad I could help ^^)
@Noofbiz Now it fails with:
/home/redacted/go/src/github.com/EngoEngine/engo/engo_js.go:46:25: document.Get("body").IsNull undefined (type js.Value has no field or method IsNull)
/home/redacted/go/src/github.com/EngoEngine/engo/engo_js.go:172:9: joy.IsNull undefined (type js.Value has no field or method IsNull)
/home/redacted/go/src/github.com/EngoEngine/engo/engo_js.go:188:9: joy.IsNull undefined (type js.Value has no field or method IsNull)
/home/redacted/go/src/github.com/EngoEngine/engo/gamepads_js.go:32:19: gpds.Index(i).IsNull undefined (type js.Value has no field or method IsNull)
/home/redacted/go/src/github.com/EngoEngine/engo/gamepads_js.go:54:11: window.IsUndefined undefined (type js.Value has no field or method IsUndefined)
/home/redacted/go/src/github.com/EngoEngine/engo/gamepads_js.go:54:52: window.Get("navigator").IsUndefined undefined (type js.Value has no field or method IsUndefined)
/home/redacted/go/src/github.com/EngoEngine/engo/gamepads_js.go:66:20: gpds.Index(i).IsNull undefined (type js.Value has no field or method IsNull)
EDIT: Turns out it was an outdated version of Go
@Noofbiz Turns out that on some versions of Go, you need to use ValueEqual
. Build fails with this error for reference:
engo_js.go:45:26: invalid operation: document.Get("body") == js.Null() (struct containing [0]func() cannot be compared)
Oh wait, turns out my version of Engo was outdated haha, will try building once I fix that
Can confirm, it works now