#import <OpenGL/OpenGL.h>
#import <GLUT/GLUT.h>
int width=500, height=500;
void init()
{
glViewport(0, 0, width, height);
glLoadIdentity();
glOrtho(0, width, height, 0, 0, 1);
}
void display()
{
glClearColor(0.9, 0.9, 0.9, 1.0);
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(1.0, 0.0, 0.0);
glMatrixMode(GL_MODELVIEW); /************************/
glLoadIdentity();[/B] /**************/
glTranslatef(100,0,0); /****** trying to translate the vertexes */
glBegin(GL_QUADS);
glVertex2i(100, 100);
glVertex2i(300, 100);
glVertex2i(300, 300);
glVertex2i(100, 300);
glEnd();
glFlush();
}
int main(int argc, char * argv[])
{
glutInit(&argc, argv);
glutInitWindowPosition(100, 100);
glutInitWindowSize(width, height);
glutCreateWindow("Test");
glutDisplayFunc(display);
init();
glutMainLoop();
return 0;
}