title: VAO problems with bind
body: <p>Help to find the error. <br/>
  I suppose it is wrong to bind. In "display" I used VBO - all works fine.<br/>
  But when I used VAO - i get black screen.</p>
  
  <pre><code>void createVAO(GLuint *_vId, GLuint *_cId, GLuint *_tId, GLuint *_vao) {
  glGenVertexArrays(1, _vao);
  glBindVertexArray(*_vao);
  
  glEnableClientState( GL_VERTEX_ARRAY );
  glBindBuffer(GL_ARRAY_BUFFER, *_vId );
  glVertexPointer( 3, GL_FLOAT, 0, 0 );
  
  glBindVertexArray(0);
  
  glBindBuffer(GL_ARRAY_BUFFER, 0);
  glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); }
  
  
  void createVBO(GLuint *_vId, GLuint *_cId, GLuint *_tId) {
  glGenBuffers(1, _vId);
  glBindBuffer(GL_ARRAY_BUFFER, *_vId);
  glBufferData(GL_ARRAY_BUFFER, sizeof(XYZ) * cubeVerticesCount, cubePositions, GL_STATIC_DRAW );
  glBindBuffer(GL_ARRAY_BUFFER, 0); }
  
  
  void display() {
  glClear(GL_COLOR_BUFFER_BIT);
  
  glMatrixMode(GL_MODELVIEW);
  glLoadIdentity();
  glTranslatef(0, 0, -800);
  glRotatef(rotate.angle_x, 1, 0, 0);
  glRotatef(rotate.angle_y, 0, 1, 0);
  glScalef(zoom,zoom,zoom);
  
  // VAO - dont work
  glColor3f(1.0f,1.0f,1.0f);
  glBindVertexArray(vao);
  glDrawElements(GL_POINTS, 0, GL_UNSIGNED_INT, NULL);
  glBindVertexArray(0);
  
  // VBO - work
  //glEnableClientState( GL_VERTEX_ARRAY );
  //glBindBuffer( GL_ARRAY_BUFFER, vId );
  //glVertexPointer( 3, GL_FLOAT, 0, 0 );
  //glDrawArrays(GL_POINTS, 0, cubeVerticesCount);
  //glDisableClientState(GL_VERTEX_ARRAY);
  
  calculateFPS();
  glutSwapBuffers(); }
  </code></pre>
  
  <p>Full source code.
  <a href="http://codepad.org/I87AxDl4" rel="nofollow">http://codepad.org/I87AxDl4</a></p>
  
  <p>I'm sorry for a lot of unnecessary code.</p>