Merge remote branch 'nouveau/gallium-0.1' into gallium-0.2
[mesa.git] / progs / tests / cva.c
index b596a5a4d3ec73bff3462164c9387ff46592be89..a9393aef0ca5fcf1b959111fc2b1144e04efd32a 100644 (file)
@@ -1,4 +1,3 @@
-/* $Id: cva.c,v 1.6 2003/11/23 10:27:10 keithw Exp $ */
 
 /*
  * Trivial CVA test, good for testing driver fastpaths (especially
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
-#include <malloc.h>    /* for ptrdiff_t, referenced by GL.h when GL_GLEXT_LEGACY defined */
+#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/glut.h>
-
+#include <GL/glext.h>
 
 GLfloat verts[][4] = {
    { -0.5, -0.5, -2.0, 0.0 },
@@ -115,6 +114,7 @@ int main( int argc, char **argv )
 {
    GLenum type;
    char *string;
+   double version;
 
    glutInit( &argc, argv );
 
@@ -134,9 +134,8 @@ int main( int argc, char **argv )
     */
    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 );
    }