progs/tests: also test stencil INCR_WRAP mode if supported
[mesa.git] / progs / tests / bug_3101.c
index d27488262aa4da7431dbc08c3ea0f978c9d4c3e2..06a97761557555b2be934ee2d2145aae2104edae 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright IBM Corporation 2004
+ * (C) Copyright IBM Corporation 2005
  * All Rights Reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  */
 
 /**
- * \file blendminmax.c
- * 
- * Simple test of GL_EXT_blend_minmax functionality.  Four squares are drawn
- * with different blending modes, but all should be rendered with the same
- * final color.
+ * \file bug_3101.c
+ *
+ * Simple regression test for bug #3101.  Attempt to draw a single square.
+ * After emiting the first vertex, call \c glEdgeFlag to change the vertex
+ * format.  If the bug still exists, this will cause a segfault.
  *
  * \author Ian Romanick <idr@us.ibm.com>
  */
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <GL/glew.h>
 #include <GL/glut.h>
 
 static int Width = 400;
@@ -63,6 +64,8 @@ static void Display( void )
    glVertex2f(-1,  1);
    glEnd();
 
+   glPopMatrix();
+
    glutSwapBuffers();
 }
 
@@ -117,6 +120,7 @@ int main( int argc, char *argv[] )
    glutInitWindowSize( Width, Height );
    glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
    glutCreateWindow( "Bug #3101 Test" );
+   glewInit();
    glutReshapeFunc( Reshape );
    glutKeyboardFunc( Key );
    glutDisplayFunc( Display );