webgl icon indicating copy to clipboard operation
webgl copied to clipboard

Wasm support and some cleanup.

Open dbriemann opened this issue 7 years ago • 2 comments

Hi,

first of all I don't expect this to get merged already!

This PR adds wasm support via github.com/gopherjs/gopherwasm/js to this package but js via gopherjs should also still work. I also removed a few gl constants that are undefined in webgl. And last I changed TexImage2D to accept a []byte slice as wished in #11 .

Note that the new function (c *Context) initGlConstants() is needed because wasm does not support struct tags. It uses reflection because else we would need to list all gl constants again. If you think this would be better that's no problem to change it. I already have the equivalent function generated and ready. The struct tags are removed because Gopherjs makes trouble if you try to set a value for a field with struct tag (probably a bug). But we don't need them anyways.

Let me know what you think!

dbriemann avatar Oct 28 '18 12:10 dbriemann

@hajimehoshi what do you think about the current state?

dbriemann avatar Nov 08 '18 08:11 dbriemann

Sorry about the slow response.

My concern here is that this project doesn't have an active owner/maintainer. Adding more functionality here makes it even harder to maintain.

This was the very first webgl binding for GopherJS and it has served well, but by now, there are other more active packages that provide webgl access, so I think a good direction could be to freeze and archive this package instead. Per https://github.com/gopherjs/gopherjs/issues/894, we have limited resources.

If the Wasm port lived in another repository where it's more clear who develops/maintains it, that might be a more manageable solution. It would be less constrained by unnecessary backwards compatibility.

Alternatively, if we can add a maintainer to this repo. But I don't know what it means to be breaking API compatibility here, especially after this package has inactive for so long.

dmitshur avatar Apr 11 '19 04:04 dmitshur