OpenGL Draw API Visualised

To help me grok and remember the OpenGL 3.3 draw API, I drew them in a diagram. I hope this will help me see at a glance what I can and can’t achieve with each function call.

OpenGL array draw calls: glArrayElement; glDrawArrays; glMultiDrawArrays; glDrawElements; glMultiDrawElements

OpenGL 3.3 array draw calls

I haven’t annotated any of the parameter types. These days I tend to be calling these functions from Python, so generally only care about the values. Interestingly, the most recent additions to the API, such as glMultiDrawElements, feature parameters such as ‘const void ** indices‘. Apparently the OpenGL Architecture Review Board has also decided that they also no longer care about the types either. Wise choice. :-)

Updatate: I wanted to publish this diagram as SVG, but apparently these days that works in every browser except IE, surprise surprise.

7 thoughts on “OpenGL Draw API Visualised

  1. Nice diagram!

    I wonder how well SVG works after passing through a couple of RSS aggregators (Planet Python, then Google Reader). I wouldn’t be surprised to discover it doesn’t survive their filtering, so thanks for the png.

  2. A quick way to port this diagram for use with iPhone, i.e. generic vertex/fragment shaders, is to put attribute numbers for the v,c,n columns and rewrite the fixed pipeline functions in generic terms. Could be a really cool active gif.

  3. Thanks for the feedback, people.

    Donal: That sounds great, but I don’t think I’m currently up to the task. My lappy only supports a subset of OpenGL 2.1, and I haven’t really used buffers or shaders in anger.

    However, I’d be delighted to try and figure it out and to actually draw the diagram – especially if someone brainy such as yourself were to talk me through what it should look like. :-)

  4. Pingback: Varrojo@Linux » Vistazo a la API de OpenGL para Dibujar

  5. Hey tito,
    Yeah, you’re absolutely right. I just felt compelled to include them in the diagram out of some sort of ‘neatness’ fetish. I can’t justify it. I just liked showing they were the only API calls that connect directly to the verts, colors, etc, which other API calls refer to indirectly through indices or pointers. Foolish of me to label it ‘opengl3.x’ then. Good catch.

Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>