-/* $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 },
{
GLenum type;
char *string;
+ double version;
glutInit( &argc, 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 );
}