mesa: call glColorMask(1,1,1,1) before glClear()
authorBrian Paul <brian.paul@tungstengraphics.com>
Fri, 14 Mar 2008 17:35:57 +0000 (11:35 -0600)
committerBrian Paul <brian.paul@tungstengraphics.com>
Fri, 14 Mar 2008 17:35:57 +0000 (11:35 -0600)
Without this, second and subsequent redraws rendered incorrectly.
Plus comments.

progs/trivial/tri-mask-tri.c

index 96a1ea7168a6e66a8a903e00e535345b8ce22c9c..38ecd20a73961df617e497c854062d3d0eaaa69e 100644 (file)
@@ -70,8 +70,11 @@ static void Key(unsigned char key, int x, int y)
 
 static void Draw(void)
 {
+   glColorMask(1,1,1,1);
+
    glClear(GL_COLOR_BUFFER_BIT); 
 
+   /* right triangle: green */
    glBegin(GL_TRIANGLES);
    glColor3f(0,1,0); 
    glVertex3f( 0.9, -0.9, -30.0);
@@ -81,6 +84,7 @@ static void Draw(void)
 
    glColorMask(1,0,1,0);
 
+   /* left triangle: white&mask: purple   middle region: white */
    glBegin(GL_TRIANGLES);
    glColor3f(1,1,1); 
    glVertex3f(-0.9, -0.9, -30.0);