I'm trying to draw 2 squares side by side of different colours, my problem is I can't get glTranslatef to move my second square to the right, the second square just draws over the first.
void display(void)
{
glClear(GL_COLOR_BUFFER_BIT);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glPointSize(10);
glBegin(GL_QUADS);
glColor3f(0.0,1.0,0.0);
drawSquare();
glTranslatef(10,0,0);
glColor3f(1.0,0.0,0.0);
drawSquare();
glEnd();
glFlush(); // Process all OpenGL routines
}
void drawSquare()
{
glVertex3f(0,0,0);
glVertex3f(10,0,0);
glVertex3f(10,10,0);
glVertex3f(0,10,0);
}