progs/trivial: add dlist-mat-tri.c
[mesa.git] / progs / tests / cva.c
index eff35048f3c04b89d71e3020d96289535dc9d510..80483900cb7d077bb80aed85de9c9438533546f4 100644 (file)
@@ -1,4 +1,3 @@
-/* $Id: cva.c,v 1.5 2003/01/28 15:31:35 brianp Exp $ */
 
 /*
  * Trivial CVA test, good for testing driver fastpaths (especially
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
+#include <stddef.h>    /* for ptrdiff_t, referenced by GL.h when GL_GLEXT_LEGACY defined */
 #ifdef _WIN32
 #include <windows.h>
 #endif
 #define GL_GLEXT_LEGACY
+#include <GL/glew.h>
 #include <GL/glut.h>
-
+#include <GL/glext.h>
 
 GLfloat verts[][4] = {
    { -0.5, -0.5, -2.0, 0.0 },
@@ -114,6 +115,7 @@ int main( int argc, char **argv )
 {
    GLenum type;
    char *string;
+   double version;
 
    glutInit( &argc, argv );
 
@@ -128,14 +130,14 @@ int main( int argc, char **argv )
    glutInitWindowSize( 250, 250 );
    glutInitWindowPosition( 100, 100 );
    glutCreateWindow( "CVA Test" );
+   glewInit();
 
    /* Make sure the server supports GL 1.2 vertex arrays.
     */
    string = (char *) glGetString( GL_VERSION );
 
-   if ( !strstr(string, "1.2") &&
-        !strstr(string, "1.3") &&
-        !strstr(string, "1.4")) {
+   version = atof(string);
+   if ( version < 1.2 ) {
       fprintf( stderr, "This program requires OpenGL 1.2 vertex arrays.\n" );
       exit( -1 );
    }