title: openGL 2D moving and object by 1 unit
body: <p>I have some questions about how to move an object by pressing a key.  All I want to do is to press the up button in my keyboard and make the object move one unit.</p>
  
  <pre><code>void display(){
  
      //Clear Window
      glClear(GL_COLOR_BUFFER_BIT);
  
      glPushMatrix();
      glBegin(GL_POLYGON);
      glColor3f(1.0, 0.0, 0.0);
      glVertex2f(-0.1, -0.2);
      glVertex2f(-0.1, 0.2);
      glVertex2f(0.1, 0.2);
      glVertex2f(0.1, -0.2);
      glEnd();
      glPopMatrix();
      glFlush();
  }
  
  
  void keyboardListener(int key)
  {  
      if( key == GLUT_KEY_UP) 
      {
          glTranslatef(1.0, 0.0, 0.0);
          glutPostRedisplay(); 
      }
  }
  </code></pre>
  
  <p>Whats missing or what concept I am not understanding?</p>