title: Making a simple shape move in OpenGL (Shape is in data structures)
body: <p>I want to make the body (square) move left when I press the left arrow key. Unfortunately, it's in data structures and I don't know what to put in the <code>void SpecialKeys(int key, int x, int y)</code> part to make it move.  </p>
  
  <pre><code>#include &lt;vector&gt;
  #include &lt;time.h&gt;
  
  using namespace std;
  
  #include "Glut_Setup.h"
  
  
  
  **struct Vertex
  {
  float x,y,z;
  };
  Vertex Body []=
  {
  (-0.5, -2, 0),
  (0.5, -2, 0),
  (0.5, -3, 0),
  (-0.5, -3, 0)
  };**
  
  
  
  
  void GameScene()
  {
  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  
  
  
  
  
  glBegin(GL_QUADS);
  glColor3f(0.0, 0.0, 1.0);
  glVertex3f(-0.5, -2, 0);
  glVertex3f(0.5, -2, 0);
  glVertex3f(0.5, -3, 0); 
  glVertex3f(-0.5, -3, 0);
  glEnd();
  
  
  
  
  
  
  
  glutSwapBuffers();
  }
  
  void Keys(unsigned char key, int x, int y)
  {
  switch(key)
  {
  
  }
  }
  
  **void SpecialKeys(int key, int x, int y)
  {
  switch(key)
  {
  }
  }**
  </code></pre>