title: glMultiDrawElementsIndirect usage
body: <p>Okay, so I am trying to write a simple rendering loop to understand <code>glMultiDrawElementsIndirect</code>. But at the moment it freezes up my whole computer(Ubuntu 14.04) and forces me to give it a cold restart.</p>
  
  <p>I define this structure as guidlined by the OpenGL spec:</p>
  
  <pre><code>struct DrawElementsIndirectCommand{
      GLuint count;
      GLuint instanceCount;
      GLuint firstIndex;
      GLuint baseVertex;
      GLuint baseInstance;
  };
  </code></pre>
  
  <p>then at the moment my understanding is this (in pseudo-code):</p>
  
  <pre><code>create vertex array
  create vertex buffer
  create element buffer
  create draw indirect buffer
  
  bind vertex array
  bind vertex buffer &amp; allocate some base storage
  bind element buffer &amp; allocate some base storage
  bind draw indirect buffer &amp; allocate some base storage 
  
  for every mesh in meshes
      load vertices into back of GL_ARRAY_BUFFER
      load elements into back of GL_ELEMENT_ARRAY_BUFFER
      create Draw...Command and put it at the back of GL_DRAW_INDIRECT_BUFFER
  </code></pre>
  
  <p>then in my drawing loop:</p>
  
  <pre><code>bind vertex array
  
  glMultiDrawElementsIndirect(
      GL_TRIANGLES,
      GL_UNSIGNED_INT,
      nullptr,
      num of commands loaded,
      0
  )
  </code></pre>
  
  <p>And this completely freezes my computer D: I really don't think I understand the correct use of <code>glMultiDrawElementsIndirect</code>, what is the correct way? and how can I do something like I am doing now? I want to load all of my meshes into one block.</p>