For the project I reached the first stage where one can see something: A green background. Quite a few discoveries along the way why there is nothing more to see, but also why there should not be more to see.
The Basics
I created a public Trello board, visible here. I'm not yet so sure on how to handle completed milestones, but I guess it's sensible to created dedicated lists for each and archive them.
Then there is the project on GitHub, aptly named "golgo". I'm not so happy with acronyms but I couldn't find a fancy name. "gogol" and "golingo" would have been cheeky, but also cheesy - possibly even misleading as I guess there could be a human language related project some time in the future.
Starting Small
Previously I only had quick looks at the existence of the projects that I'll have to use: The native OpenGL project "go-gl" as well as the Go-to-JavaScript transpiler "gopherjs", together with the accompanying "webgl" wrapper.
So I wanted to create a small project setup that acts as a proof-of-concept that a common OpenGL code can be written, only referring to the environment-specific wrapper/implementations. It was essentially an "In theory, it should work" moment.
I started with what I believed to be the more complex part: the native implementation. I did so because my initial test was flawed with various compilation problems and missing libraries on my system. But it turned out, when using the recommended glfw3 approach, it works quite well.
The example code with which I started was based on one from the famous NEHE tutorials: 02, which simply draws a coloured square and rectangle. The original can be found here, but apparently any OpenGL tutorial on the web refers to them. Compile, run, joy - it works!
The gopherjs/webgl project doesn't come with any detailed tutorial and simply has a clear color background example. But it's good enough to be used and put some GL calls into it. So, next step: extract a common interface on the used GL commands (Clear, Begin, Color, Vertex, ...) and then put the implementations behind that.
Then the fun started: Methods such as "Begin" and so forth are not available in the WebGL context. Is the wrapper project not complete? Are some bindings missing? Nope. These methods are simply old-school! More precisely, WebGL is based on a subset of OpenGL, OpenGL ES 2 to be exact. Which also removed the so-called "fixed-function" API, to which those primitives like "Begin", "Color" and "Vertex" belonged.
This is actually quite cool, with that I realized that OpenGL is evolving by also removing some old functionality. Shaders all the way! At the same time I also remembered that in my first WebGL based project I indeed had to compile shaders, work with vertex buffers and the like. And I also realized that it won't be easy to add all necessary functions immediately for the first proof-of-concept.
First Milestone
A green background in both environments is good enough as a start. With that I could take some time and figure out a first package structure for the project.
Next up will most likely be either a unified application startup or further GLES wrapper code to get that NEHE example running...
So, what are your regular reminders to start small and release often? Leave a comment below and follow the blog's tag "Go, Game of Life" for further updates!