change triangle orientation, fix exit()
authorBrian <brian.paul@tungstengraphics.com>
Fri, 10 Aug 2007 07:33:09 +0000 (08:33 +0100)
committerBrian <brian.paul@tungstengraphics.com>
Fri, 10 Aug 2007 07:33:09 +0000 (08:33 +0100)
progs/trivial/tri.c

index 51395f0a418a641d45fec863e0438e6f32f088a7..12fa8d11b6166708eab8075f4327e5c5eb1cf6d9 100644 (file)
@@ -59,7 +59,7 @@ static void Key(unsigned char key, int x, int y)
 
     switch (key) {
       case 27:
-       exit(1);
+       exit(0);
       default:
        return;
     }
@@ -72,12 +72,12 @@ static void Draw(void)
    glClear(GL_COLOR_BUFFER_BIT); 
 
    glBegin(GL_TRIANGLES);
-   glColor3f(0,0,.7); 
-   glVertex3f( 0.9, -0.9, -30.0);
    glColor3f(.8,0,0); 
-   glVertex3f( 0.9,  0.9, -30.0);
+   glVertex3f(-0.9, -0.9, -30.0);
    glColor3f(0,.9,0); 
-   glVertex3f(-0.9,  0.0, -30.0);
+   glVertex3f( 0.9, -0.9, -30.0);
+   glColor3f(0,0,.7); 
+   glVertex3f( 0.0,  0.9, -30.0);
    glEnd();
 
    glFlush();
@@ -130,5 +130,5 @@ int main(int argc, char **argv)
     glutKeyboardFunc(Key);
     glutDisplayFunc(Draw);
     glutMainLoop();
-       return 0;
+    return 0;
 }