title: Opengl add a new object in each click?
body: <pre><code>void onClick(int button, int state, int x, int y) {
    if (button == GLUT_LEFT_BUTTON &amp;&amp; state == GLUT_DOWN)
      drawHouse(x,y);
  }
  </code></pre>
  
  <p>I have a problem about opengl onclick function. I drawed an object(primitive house) and i want to display it when i click on the mouse. How can i do this?</p>
  
  <p>My teacher gave this command: "<strong>Add a new object, defined in the first part, after the user presses mouse left button. Each click adds a new object at the position of click. Maximum 10 objects can be created on the screen. Then, after each click a new object should replace the first object.</strong>"</p>