title: c++ Opengl handle elements drawn
body: <p>I am currently working on a game and I want to know if there is any way of handling with the elements i am drawing . For example : if i draw in a loop 100 cubes , how can i show / hide the cube number 15 or 63 or n ... I thought that initializing elements in a list would work , but i didn't find any property of it that could help.</p>
  
  <pre><code>GLuint cube;
  cube = glGenLists(1);
  
  glNewList(cube,GL_COMPILE);
  
  for(int i = -30; i &lt; 3; i++) {
    for(int j = -30; j &lt; 3; j++) {
      glPushMatrix();
      glTranslatef(i*2.0,0,j * 2.0);
      Dcube();
  
      glPopMatrix();
     }
  }
  glEndList();
  </code></pre>
  
  <p>//something like : glDeleteList(cube); but that only works with entire list not with individual objects..</p>