Purely Functional 3D in Typed Racket [video]
youtube.com
youtube.com
http://www.youtube.com/watch?v=t3xdv4UP9-U&t=11m52s
The source code is available on GitHub:
It's possible to put a lot more static content in each frame by uploading the vertex data to the card just once. That feature is on my to-do list.
Relevant HN thread: https://news.ycombinator.com/item?id=8381274
https://www.youtube.com/playlist?list=PLXr4KViVC0qI9t3liziti...
(Michael Fogus gave the keynote and there are other cool talks about games, grahics, and other stuff)
(I like to do all my for-fun projects in OS X.)
An OpenGL context is roughly a 3D drawing area and its associated behind-the-scenes data. Via changes to OpenGL version 3.0 through 3.2, it became possible to ask for specific versions of OpenGL for each context. There are two kinds of contexts: "compatibility" contexts, which expose all OpenGL features up to the version obtained, and "core" contexts, which don't have deprecated features. For example, starting with 3.1, a core context won't draw quads - you have to split them into two triangles.
On Linux, Racket uses libgtkgl to get OpenGL contexts that are associated with GTK widgets. This library won't return anything but compatibility contexts, up to version 3.0.
On OS X, it's only possible to get an OpenGL 2.1 context or an OpenGL 3.2 or 3.3 core context.
There are a few ways to fix this.
1. The libgtkgl developers add support for core contexts and versions later than 3.0. I doubt this will happen. They're dragging their feet.
2. OS X adds support for compatibility contexts. Again, not hopeful.
3. We find some other way to get an OpenGL context on Linux that's associated with a GTK widget. There aren't many options.
4. I develop using OpenGL 2.1. I lose a lot of shading language features that way, though, and probably a lot of performance.
5. I develop multiple rendering paths. I hate this idea, but it may be what I have to do.