Mesa (mesa_7_5_branch): dlist-tri-flat-tri: make tri render differently if flatshade not enabled

Keith Whitwell keithw at kemper.freedesktop.org
Thu Jul 2 12:31:53 UTC 2009


Module: Mesa
Branch: mesa_7_5_branch
Commit: 1730eaa2a2454018b4907df2f2bda3c4455137ca
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=1730eaa2a2454018b4907df2f2bda3c4455137ca

Author: Keith Whitwell <keithw at vmware.com>
Date:   Tue Jun 30 16:57:21 2009 +0100

dlist-tri-flat-tri: make tri render differently if flatshade not enabled

When testing flat-shading, it helps to specify per-vertex colors so
that you can distinguish between flat & smooth shading.

---

 progs/trivial/dlist-tri-flat-tri.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/progs/trivial/dlist-tri-flat-tri.c b/progs/trivial/dlist-tri-flat-tri.c
index b2a4085..4dbb788 100644
--- a/progs/trivial/dlist-tri-flat-tri.c
+++ b/progs/trivial/dlist-tri-flat-tri.c
@@ -70,9 +70,11 @@ static void Init(void)
     */
    glShadeModel( GL_FLAT );
    glBegin(GL_TRIANGLES);
-   glColor3f(0,1,0);
+   glColor3f(1,0,0);
    glVertex3f( -0.5,  0.5, -30.0);
+   glColor3f(0,1,0);
    glVertex3f( -0.5, -0.5, -30.0);
+   glColor3f(0,0,1);
    glVertex3f(  0.5,  0.0, -30.0);
    glEnd();
 




More information about the mesa-commit mailing list