TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Minimal OpenGL 3.3 Core Profile Demo

48 pointsby davvidalmost 10 years ago

6 comments

shurcooLalmost 10 years ago
This is cool, and I&#x27;m glad to see he switched to GLFW which is the best choice IMO. If you&#x27;d like an equivalent article&#x2F;sample minimal project for modern OpenGL (4.1) written in Go, I recommend:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;go-gl&#x2F;examples&#x2F;tree&#x2F;master&#x2F;glfw31-gl41core-cube" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;go-gl&#x2F;examples&#x2F;tree&#x2F;master&#x2F;glfw31-gl41cor...</a><p>If you already have Go installed, you can try it easily, just:<p><pre><code> go get -u github.com&#x2F;go-gl&#x2F;examples&#x2F;glfw31-gl41core-cube </code></pre> It will compile and run on OS X, Linux and Windows.
pjmlpalmost 10 years ago
Given his switch to GLFW.<p>I really don&#x27;t get why the official OpenGL documentation still uses GLUT on its examples.<p>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.<p>Yes there is the <a href="https:&#x2F;&#x2F;www.opengl.org&#x2F;sdk&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.opengl.org&#x2F;sdk&#x2F;</a>, but it is just a dump of libraries that won&#x27;t help beginners easily.<p>Which is only going to get worse with Vulkan (around 600 LOC for the triangle).
评论 #9683010 未加载
RelaxBoxalmost 10 years ago
It&#x27;s nice to see some content for modern OpenGL -- it&#x27;s been a while since I&#x27;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&#x27;s a nightmare for people just getting started.
评论 #9677195 未加载
评论 #9677109 未加载
tdicolaalmost 10 years ago
Wow that&#x27;s great to see the absolute bare necessities to use modern OpenGL distilled into one nice blog post.
Narishmaalmost 10 years ago
This uses gettimeofday() for timing purposes which has been deprecated for a few years now. I believe it&#x27;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.
评论 #9676810 未加载
benihanaalmost 10 years ago
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:<p><pre><code> if (!glfwInit()) return -1; </code></pre> Why do this? Is there some kind of amazing thing in the C&#x2F;C++ world that doing this unlocks? It just seems like an inconsistent, dangerous accident waiting to happen.
评论 #9677299 未加载