From 5479e9303126490a6638eb0f68f3cc7e6bd1a9d2 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 27 Mar 2001 17:38:28 +0000 Subject: [PATCH] double buffer by default. if drawSmooth, use 50% alpha at top of polygon --- progs/demos/texenv.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/progs/demos/texenv.c b/progs/demos/texenv.c index 6cf855887e2..e31876c8aa7 100644 --- a/progs/demos/texenv.c +++ b/progs/demos/texenv.c @@ -65,7 +65,7 @@ GLfloat *labelInfoColor = labelColor0; GLfloat labelLevelColor0[4] = { 0.8, 0.8, 0.1, 1.0 }; GLfloat labelLevelColor1[4] = { 0.0, 0.0, 0.0, 1.0 }; -GLboolean doubleBuffered = GL_FALSE; +GLboolean doubleBuffered = GL_TRUE; GLboolean drawBackground = GL_FALSE; GLboolean drawBlended = GL_TRUE; GLboolean drawSmooth = GL_FALSE; @@ -574,6 +574,10 @@ static void drawSample( int x, int y, int w, int h, glEnable( GL_TEXTURE_2D ); } + /* + * if (drawSmooth) then draw quad which goes from purple at the + * bottom (100% alpha) to green at the top (50% alpha). + */ glBegin( GL_QUADS ); if ( drawSmooth ) glColor4f( 1.0, 0.0, 1.0, 1.0 ); glTexCoord2f( 0.0, 0.0 ); @@ -583,11 +587,11 @@ static void drawSample( int x, int y, int w, int h, glTexCoord2f( 1.0, 0.0 ); glVertex2f( 0.8, -0.8 ); - if ( drawSmooth ) glColor4f( 0.0, 1.0, 0.0, 1.0 ); + if ( drawSmooth ) glColor4f( 0.0, 1.0, 0.0, 0.5 ); glTexCoord2f( 1.0, 1.0 ); glVertex2f( 0.8, 0.8 ); - if ( drawSmooth ) glColor4f( 0.0, 1.0, 0.0, 1.0 ); + if ( drawSmooth ) glColor4f( 0.0, 1.0, 0.0, 0.5 ); glTexCoord2f( 0.0, 1.0 ); glVertex2f( -0.8, 0.8 ); glEnd(); -- 2.30.2