diff options
author | Keith Whitwell <keith@tungstengraphics.com> | 2003-02-21 23:07:40 +0000 |
---|---|---|
committer | Keith Whitwell <keith@tungstengraphics.com> | 2003-02-21 23:07:40 +0000 |
commit | b9f8f7f6a408876b991897fa41f790ff135fa989 (patch) | |
tree | 8c6b1c374b5266039dc866d9975712be2ae8e37f /progs | |
parent | 66f40571e1b263ff5459f3b6bdb938941e1d4567 (diff) |
Eliminate non-subset operations
Diffstat (limited to 'progs')
-rw-r--r-- | progs/samples/line.c | 2 | ||||
-rw-r--r-- | progs/samples/point.c | 4 | ||||
-rw-r--r-- | progs/samples/prim.c | 36 | ||||
-rw-r--r-- | progs/samples/tri.c | 10 |
4 files changed, 28 insertions, 24 deletions
diff --git a/progs/samples/line.c b/progs/samples/line.c index 83f70cb3ac4..48a9497d534 100644 --- a/progs/samples/line.c +++ b/progs/samples/line.c @@ -147,7 +147,7 @@ static void Draw(void) glVertex3fv(pntB); glEnd(); - glPointSize(1); +/* glPointSize(1); */ SetColor(COLOR_GREEN); glBegin(GL_POINTS); diff --git a/progs/samples/point.c b/progs/samples/point.c index 4cb6ad7d517..224e940bd39 100644 --- a/progs/samples/point.c +++ b/progs/samples/point.c @@ -151,7 +151,7 @@ static void Draw(void) glDisable(GL_POINT_SMOOTH); } - glPointSize(size); +/* glPointSize(size); */ if (mode) { (rgb) ? glColor3f(1.0, 0.0, 0.0) : glIndexf(CI_ANTI_ALIAS_RED); } else { @@ -164,7 +164,7 @@ static void Draw(void) glDisable(GL_POINT_SMOOTH); glDisable(GL_BLEND); - glPointSize(1); +/* glPointSize(1); */ SetColor(COLOR_GREEN); glBegin(GL_POINTS); glVertex3fv(point); diff --git a/progs/samples/prim.c b/progs/samples/prim.c index 388e0153b4f..611919d0723 100644 --- a/progs/samples/prim.c +++ b/progs/samples/prim.c @@ -52,27 +52,27 @@ static void Reshape(int width, int height) windH = (GLint)height; } -static void RotateColorMask(void) +static void RotateRestoreColorMask( int rotate ) { static GLint rotation = 0; - rotation = (rotation + 1) & 0x3; + if (rotate) rotation = (rotation + 1) & 0x3; switch (rotation) { case 0: glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); - glIndexMask( 0xff ); +/* glIndexMask( 0xff ); */ break; case 1: glColorMask(GL_FALSE, GL_TRUE, GL_TRUE, GL_TRUE); - glIndexMask(0xFE); +/* glIndexMask(0xFE); */ break; case 2: glColorMask(GL_TRUE, GL_FALSE, GL_TRUE, GL_TRUE); - glIndexMask(0xFD); +/* glIndexMask(0xFD); */ break; case 3: glColorMask(GL_TRUE, GL_TRUE, GL_FALSE, GL_TRUE); - glIndexMask(0xFB); +/* glIndexMask(0xFB); */ break; } } @@ -90,7 +90,7 @@ static void Key(unsigned char key, int x, int y) mode2 = !mode2; break; case '3': - RotateColorMask(); + RotateRestoreColorMask( 1 ); break; default: return; @@ -344,7 +344,7 @@ static void Rect(void) { SetColor(COLOR_GREEN); - glRecti(-boxW/4, -boxH/4, boxW/4, boxH/4); +/* glRecti(-boxW/4, -boxH/4, boxW/4, boxH/4); */ } static void PolygonFunc(void) @@ -445,15 +445,16 @@ static void Draw(void) glViewport(0, 0, windW, windH); glDisable(GL_SCISSOR_TEST); - glPushAttrib(GL_COLOR_BUFFER_BIT); +/* glPushAttrib(GL_COLOR_BUFFER_BIT); */ glColorMask(1, 1, 1, 1); - glIndexMask(~0); +/* glIndexMask(~0); */ glClearColor(0.0, 0.0, 0.0, 0.0); glClear(GL_COLOR_BUFFER_BIT); - glPopAttrib(); +/* glPopAttrib(); */ + RotateRestoreColorMask( 0 ); if (mode1) { glShadeModel(GL_SMOOTH); @@ -461,11 +462,11 @@ static void Draw(void) glShadeModel(GL_FLAT); } - if (mode2) { - glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - } else { - glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); - } +/* if (mode2) { */ +/* glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); */ +/* } else { */ +/* glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); */ +/* } */ Viewport(0, 0); Point(); Viewport(0, 1); Lines(); @@ -478,10 +479,13 @@ static void Draw(void) Viewport(1, 2); Triangles(); Viewport(1, 3); TriangleStrip(); + Viewport(2, 0); Rect(); Viewport(2, 1); PolygonFunc(); Viewport(2, 2); Quads(); Viewport(2, 3); QuadStrip(); + if (0) { + } glFlush(); diff --git a/progs/samples/tri.c b/progs/samples/tri.c index 700325132ef..3856c9f1800 100644 --- a/progs/samples/tri.c +++ b/progs/samples/tri.c @@ -279,11 +279,11 @@ static void Draw(void) if (showVerticies) { (rgb) ? glColor3fv(RGBMap[COLOR_RED]) : glIndexf(color1); - glRectf(p0[0]-2, p0[1]-2, p0[0]+2, p0[1]+2); +/* glRectf(p0[0]-2, p0[1]-2, p0[0]+2, p0[1]+2); */ (rgb) ? glColor3fv(RGBMap[COLOR_GREEN]) : glIndexf(color2); - glRectf(p1[0]-2, p1[1]-2, p1[0]+2, p1[1]+2); +/* glRectf(p1[0]-2, p1[1]-2, p1[0]+2, p1[1]+2); */ (rgb) ? glColor3fv(RGBMap[COLOR_BLUE]) : glIndexf(color3); - glRectf(p2[0]-2, p2[1]-2, p2[0]+2, p2[1]+2); +/* glRectf(p2[0]-2, p2[1]-2, p2[0]+2, p2[1]+2); */ } glPopMatrix(); @@ -306,7 +306,7 @@ static void Draw(void) glScalef(zoom, zoom, zoom); glRotatef(zRotation, 0,0,1); - glPointSize(10); +/* glPointSize(10); */ glLineWidth(5); glEnable(GL_POINT_SMOOTH); glEnable(GL_LINE_STIPPLE); @@ -322,7 +322,7 @@ static void Draw(void) glVertex3fv(p2); EndPrim(); - glPointSize(1); +/* glPointSize(1); */ glLineWidth(1); glDisable(GL_POINT_SMOOTH); glDisable(GL_LINE_STIPPLE); |