ofxMSAShape3D – OpenGL Immediate mode style wrapper for Vertex Arrays / OpenGL ES / iPhone (2009)

Over the years OpenGL has developed lots of different ways of sending vertex data to the graphics card: Immediate mode (glBegin / glVertex / glEnd etc.), Display Lists, Vertex Arrays, Vertex Buffer Objects etc. The first of these (Immediate Mode) is quite inefficient, so it’s been dropped in OpenGL ES and depreciated in OpenGL 3.0. Instead we are to use Vertex Arrays or VBO’s (Vertex Buffer Objects). They are way more efficient, but generally not as straightforward to setup and use.

For this reason I wrote a C++ class that wraps up the functionality of Vertex Arrays (and soon VBO’s) in an immediate mode style syntax. I.e. you can carry on calling glBegin / glNormal / setColor / glTexCoord / glVertex / glEnd etc. but instead of sending the data on every function call, it just caches them all in client-side arrays, and sends it all in one go when you call glEnd(). Later you can call draw() to redraw the information you’ve put in. Thus improving performance on desktop systems, and allowing immediate mode style syntax on embedded systems such as the iPhone. (The previous post about the Meshulator uses this class).

Over the years OpenGL has developed lots of different ways of sending vertex data to the graphics card: Immediate mode […]

Related keywords

iphone, open source, openframeworks