summaryrefslogtreecommitdiff
path: root/progs/trivial
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2008-03-14 11:35:57 -0600
committerBrian Paul <brian.paul@tungstengraphics.com>2008-03-14 11:35:57 -0600
commit14150bc8567cf424fc3a635a33f05213505681be (patch)
tree94c5059247e4ff9d4de3ded9b95407f997cf0f0e /progs/trivial
parent9de9e1fe8c3f87fe672aed074348f07107fa3cec (diff)
mesa: call glColorMask(1,1,1,1) before glClear()
Without this, second and subsequent redraws rendered incorrectly. Plus comments.
Diffstat (limited to 'progs/trivial')
-rw-r--r--progs/trivial/tri-mask-tri.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/progs/trivial/tri-mask-tri.c b/progs/trivial/tri-mask-tri.c
index 96a1ea7168..38ecd20a73 100644
--- a/progs/trivial/tri-mask-tri.c
+++ b/progs/trivial/tri-mask-tri.c
@@ -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);