Minor example tweaks.#3
Conversation
dmitshur
commented
Jul 13, 2014
- Improve error handling to display the error message via alert(). This is important as some browsers do not have WebGL enabled (by default), so some users will run into this problem.
- Remove tag from HTML since it wasn't being used.
Improve error handling to display the error message via alert(). This is important as some browsers do not have WebGL enabled (by default), so some users will run into this problem. Remove <head> tag from HTML since it wasn't being used.
|
I have to admit, now that I finally got webgl to work via gopherjs, this is extremely exciting! :D |
|
I am actually working on merging my gopherjs engine 'enj' with my desktop engine 'eng'. Should be able to compile to both using the same source. I'm looking forward to seeing what you come up with! |
|
That sounds great. I share the same goal of being able to write one set of Go code and compile it to both desktop/OpenGL and web/WebGL. I will definitely be keeping an eye on your efforts. The coolest part of WebGL is that you can effectively edit GL calls on the fly for a live coding experience. I find it really frustrating to have to change GL code, then recompile and rerun my project to see if a value of 0.84 or 0.85 looks nicer. |
|
Hey @ajhager, is there any simple "draw a triangle" WebGL example using this library that you're aware of? Something like https://github.com/errcw/glow/blob/master/examples/cube/cube.go, where it loads a vertex and fragment shaders and draws something visible on the screen. Basically, I want something a little more advanced than a "gl.ClearColor" and less advanced than a full game engine. If not, I'll just use enj-examples and enj to figure it out, but if you could point me to something that exists, that'd be great. |
|
Yeah, I will come up with a simple example. |