Minimal OpenGL 3.3 Core Profile Demo
nullprogram.com
nullprogram.com
https://github.com/go-gl/examples/tree/master/glfw31-gl41cor...
If you already have Go installed, you can try it easily, just:
go get -u github.com/go-gl/examples/glfw31-gl41core-cube
It will compile and run on OS X, Linux and Windows.I really don't get why the official OpenGL documentation still uses GLUT on its examples.
Khronos should really update those books, additionally with an helper matrix, texture and shader loading library to avoid every OpenGL beginner to re-write the same code before a triangle gets shown.
Yes there is the https://www.opengl.org/sdk/, but it is just a dump of libraries that won't help beginners easily.
Which is only going to get worse with Vulkan (around 600 LOC for the triangle).
Does this really matter? Vulkan isn't meant for beginners, nor should it be. Beginners would be much better off served using OpenGL, or on a higher level API that sits on top of Vulkan/DX12/Metal (actually, Metal is probably friendly enough for a beginner to use... but that's neither here nor there).
if (!glfwInit())
return -1;
Why do this? Is there some kind of amazing thing in the C/C++ world that doing this unlocks? It just seems like an inconsistent, dangerous accident waiting to happen.Only think I can think you could mean is the lack of curly braces, but that's so common it can't be it.
EDIT: Unrelated sidenote: GLFW doesn't really make OpenGL itself any less tedious, only setting it up.