title: Drawing with OpenGL in OOP
body: <p>I try to code an OpenGL project with Qt (v5.1.1) on OS X 10.9, in the manner of the modern pipeline implementation. The program is supposed to be a multi-agent based system or particle system. However I lack in understanding how to draw something out of another class.</p>
  
  <p>In cinder there were some simple drawThisAndThat() command you could call. I read the 6th edition of the 'OpenGL Superbible'. From this and several tutorials all examples seem to cover just programs where all modifications are made out of the class that initializes OpenGL.</p>
  
  <p>I would like to instantiate some objects moving on a grid and draw pixel to display their position. I know I have to call <code>void glVertexAttrib4fv(GLuint index, const GLfloat * vi);</code> but this is not sufficient. </p>
  
  <ul>
  <li>Do I need to call <code>glEnableVertexAttribArray(1);</code> and <code>glDrawArrays(GL_POINTS, 0, 3);</code> as well and what else?</li>
  <li>Am I right, to instantiate the class controlling the particles after instantiating OpenGL and bevor the main loop?</li>
  <li>How do I manage that the particle draws himself while erasing the position he was drawn bevor?</li>
  </ul>
  
  <p>The program is based on this <a href="http://qt-project.org/wiki/How_to_use_OpenGL_Core_Profile_with_Qt" rel="nofollow">code</a>.</p>