progs/util: make sure function pointers are initialized
authorKeith Whitwell <keithw@vmware.com>
Mon, 29 Jun 2009 15:07:14 +0000 (16:07 +0100)
committerKeith Whitwell <keithw@vmware.com>
Tue, 30 Jun 2009 14:41:43 +0000 (15:41 +0100)
Call Init() from CompileShaderFile, was previously only called for the
Text version of this function.

progs/util/shaderutil.c

index 2f1c4e3..5cef84e 100644 (file)
@@ -9,6 +9,7 @@
 #include <assert.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <GL/glew.h>
 #include <GL/glut.h>
 #include "extfuncs.h"
 #include "shaderutil.h"
@@ -78,8 +79,12 @@ CompileShaderFile(GLenum shaderType, const char *filename)
    int n;
    char *buffer = (char*) malloc(max);
    GLuint shader;
+   FILE *f;
 
-   FILE *f = fopen(filename, "r");
+   Init();
+
+
+   f = fopen(filename, "r");
    if (!f) {
       fprintf(stderr, "Unable to open shader file %s\n", filename);
       return 0;