progs/tests: Add checks for GL_NV_vertex_program.
authorVinson Lee <vlee@vmware.com>
Fri, 12 Feb 2010 19:59:37 +0000 (11:59 -0800)
committerVinson Lee <vlee@vmware.com>
Fri, 12 Feb 2010 19:59:37 +0000 (11:59 -0800)
progs/tests/vpeval.c
progs/tests/vptest1.c
progs/tests/vptest2.c
progs/tests/vptest3.c

index 3e8a732df59be2196d86201b28a39e153fc07ec7..a4024b5336b2e86db20ed3c376645aafab113148 100644 (file)
@@ -145,6 +145,11 @@ myinit(int argc, char *argv[])
 
     printf("Using vertex program attribs? %s\n", program ? "yes" : "no");
 
+    if (program && !glutExtensionSupported("GL_NV_vertex_program")) {
+       printf("Sorry, this requires GL_NV_vertex_program\n");
+       exit(1);
+    }
+
     if (!program) {
         glMap2f(GL_MAP2_VERTEX_4,
                 0.0, 1.0, 4, 4,
index 6e32b033468ef97f3058f23a73089df2e4d63423..d83f9cae37b989780001e2ae9488c7820aba07a2 100644 (file)
@@ -113,6 +113,11 @@ static void Init( void )
 
    GLuint progs[5];
 
+   if (!glutExtensionSupported("GL_NV_vertex_program")) {
+      printf("Sorry, this program requires GL_NV_vertex_program\n");
+      exit(1);
+   }
+
    glGenProgramsNV(2, progs);
    assert(progs[0]);
    assert(progs[1]);
index 4161b03a673583467f5799f9c590036627233a7f..89cd6b1458c173669a78dc2965fb1aa4be53cdbb 100644 (file)
@@ -144,6 +144,12 @@ int main( int argc, char *argv[] )
    glutReshapeFunc( Reshape );
    glutKeyboardFunc( Key );
    glutDisplayFunc( Display );
+
+   if (!glutExtensionSupported("GL_NV_vertex_program")) {
+      printf("Sorry, this program requires GL_NV_vertex_program\n");
+      exit(1);
+   }
+
    Test1();
    Test2();
    Test3();
index 4e4bfee31dc95a9453bb22cdac4cd35b7e9c9f0f..58ce227e6e07d8cd2f778f9821b148e3c6d254c7 100644 (file)
@@ -93,6 +93,11 @@ static void Init( void )
 #endif
       "END\n";
 
+   if (!glutExtensionSupported("GL_NV_vertex_program")) {
+      printf("Sorry, this program requires GL_NV_vertex_program\n");
+      exit(1);
+   }
+
    glLoadProgramNV(GL_VERTEX_PROGRAM_NV, 1,
                    strlen(prog1),
                    (const GLubyte *) prog1);