diff options
author | Brian Paul <[email protected]> | 2010-03-17 16:26:41 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2010-03-17 16:29:34 -0600 |
commit | 0557d0a4b2c010b6f617613b2b46e055ce12fac9 (patch) | |
tree | 035a9bcf4ba714299bea769ff00d8737d5c278f5 /progs/trivial | |
parent | fecd4cde501e8b0b5d057a9cc9d2e3af8d853d9e (diff) |
progs/trivial: added comments
Diffstat (limited to 'progs/trivial')
-rw-r--r-- | progs/trivial/tri-stencil.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/progs/trivial/tri-stencil.c b/progs/trivial/tri-stencil.c index 9f68bca9149..d66b68c415a 100644 --- a/progs/trivial/tri-stencil.c +++ b/progs/trivial/tri-stencil.c @@ -77,6 +77,7 @@ static void Draw(void) glStencilFunc(GL_ALWAYS, 1, 1); glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE); + /* red triangle (setting stencil to 1) */ glColor3ub(200, 0, 0); glBegin(GL_POLYGON); glVertex3i(-4, -4, 0); @@ -88,6 +89,7 @@ static void Draw(void) glStencilFunc(GL_EQUAL, 1, 1); glStencilOp(GL_INCR, GL_KEEP, GL_DECR); + /* green quad (if over red, decr stencil to 0, else incr to 1) */ glColor3ub(0, 200, 0); glBegin(GL_POLYGON); glVertex3i(3, 3, 0); @@ -101,6 +103,7 @@ static void Draw(void) glStencilFunc(GL_EQUAL, 1, 1); glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP); + /* blue quad (where stencil == 1) */ glColor3ub(0, 0, 200); glBegin(GL_POLYGON); glVertex3f(2.5, 2.5, 0); |