progs/vp: print program and error info when program does not compile
authorBrian Paul <brianp@vmware.com>
Mon, 14 Sep 2009 23:48:17 +0000 (17:48 -0600)
committerBrian Paul <brianp@vmware.com>
Mon, 14 Sep 2009 23:48:17 +0000 (17:48 -0600)
progs/vp/vp-tris.c

index 97995accdd180012563df4919c34e9361c38d16a..1356242d971d9c57405d4c1a898fa9fa8e0048f6 100644 (file)
@@ -119,6 +119,12 @@ static void Init( void )
       glBindProgramARB(GL_VERTEX_PROGRAM_ARB, prognum);
       glProgramStringARB(GL_VERTEX_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
                        sz, (const GLubyte *) buf);
+      if (glGetError()) {
+         printf("Program failed to compile:\n%s\n", buf);
+         printf("Error: %s\n",
+                (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
+         exit(1);
+      }
       assert(glIsProgramARB(prognum));
    }