Re:Minimal OpenGL 3.3 Core Profile Demo
by shurcooL on Monday June 08, 2015 @01:01AM
(#9677307)
This is cool, and I'm glad to see he switched to GLFW which is the best choice IMO. If you'd like an equivalent article/sample minimal project for modern OpenGL (4.1) written in Go, I recommend:
Re:Minimal OpenGL 3.3 Core Profile Demo
by pjmlp on Monday June 08, 2015 @03:06AM
(#9677604)
Given his switch to GLFW.
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).
Re:Minimal OpenGL 3.3 Core Profile Demo
by yoklov on Monday June 08, 2015 @06:46PM
(#9683010)
> 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).
Re:Minimal OpenGL 3.3 Core Profile Demo
by RelaxBox on Sunday June 07, 2015 @10:16PM
(#9677083)
It's nice to see some content for modern OpenGL -- it's been a while since I've done any raw GL programming, and I understand the newest specs are finally deprecating the mess of APIs that have accumulate. Last I saw there were many different ways to render polygons (immediate mode, display lists, vertex arrays, vertex buffer objects...) and I can only imagine it's a nightmare for people just getting started.
Re:Minimal OpenGL 3.3 Core Profile Demo
by cechner on Sunday June 07, 2015 @11:32PM
(#9677195)
I spent the last few months struggling with modern OpenGL myself - using GL ES2 which doesnt even provide access to the deprecated OpenGL 1 stuff. I wrote about it here to help others trying to pick it up from scratch: http://seshbot.com/blog/2015/05/05/an-introduction-to-opengl...
Re:Minimal OpenGL 3.3 Core Profile Demo
by Narishma on Sunday June 07, 2015 @07:43PM
(#9676729)
This uses gettimeofday() for timing purposes which has been deprecated for a few years now. I believe it's not reliable as it can be changed by other processes running alongside your application (like ntpd for example). A better alternative is clock_gettime() with a monotonic clock.
Re:Minimal OpenGL 3.3 Core Profile Demo
by benihana on Sunday June 07, 2015 @11:54PM
(#9677250)
This is great! I last looked at OpenGL on the desktop a decade ago and it was tedious. GLFW looks awesome. But looking at the example code for it, I saw this:
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.
https://github.com/go-gl/examples/tree/master/glfw31-gl41cor...
If you already have Go installed, you can try it easily, just:
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).
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.