vpglsl: build with scons and glew
authorKeith Whitwell <keithw@vmware.com>
Mon, 9 Mar 2009 17:10:12 +0000 (17:10 +0000)
committerKeith Whitwell <keithw@vmware.com>
Mon, 9 Mar 2009 18:51:14 +0000 (18:51 +0000)
progs/SConscript
progs/vpglsl/Makefile
progs/vpglsl/vp-tris.c

index 544ea6475047433e879f611b28e3371d1aae9f0c..1670f97bc73054cd296335118d542b19b066f5b9 100644 (file)
@@ -5,5 +5,6 @@ SConscript([
     'samples/SConscript',
     'trivial/SConscript',
     'vp/SConscript',
+    'vpglsl/SConscript',
     'fp/SConscript',
 ])
index 313b4dfa2279b66a83bbae54666ed88154c97e1c..3982aca5650574fd5a948cba9fd147f13f1b3406 100644 (file)
@@ -7,7 +7,7 @@
 TOP = ../..
 include $(TOP)/configs/current
 
-LIBS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) $(APP_LIB_DEPS)
+LIBS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB)  -l$(GLEW_LIB) -l$(GLU_LIB) -l$(GL_LIB) $(APP_LIB_DEPS)
 
 SOURCES = \
        vp-tris.c
index 9108d3f1978f5f9dbe2fd8e5b9b972d43ab180c0..9ae410bf98436b84e61bada10fe2b49ff91ec977 100644 (file)
@@ -4,7 +4,8 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <math.h>
-#define GL_GLEXT_PROTOTYPES
+
+#include <GL/glew.h>
 #include <GL/glut.h>
 
 static const char *filename = NULL;
@@ -99,27 +100,29 @@ static void setup_uniforms()
 
    }
 
-   GLuint loc1f = glGetUniformLocationARB(program, "KernelValue1f");
-   GLuint loc2f = glGetUniformLocationARB(program, "KernelValue2f");
-   GLuint loc4f = glGetUniformLocationARB(program, "KernelValue4f");
-   GLfloat vecKer[] =
-      { 1.0, 0.0, 0.0,  0.25,
-        0.0, 1.0, 0.0,  0.25,
-        0.0, 0.0, 1.0,  0.25,
-        0.0, 0.0, 0.0,  0.25,
-        0.5, 0.0, 0.0,  0.35,
-        0.0, 0.5, 0.0,  0.35,
-        0.0, 0.0, 0.5,  0.35,
-        0.0, 0.0, 0.0,  0.35
-      };
-   if (loc1f >= 0)
-      glUniform1fv(loc1f, 16, vecKer);
-
-   if (loc2f >= 0)
-      glUniform2fv(loc2f, 8, vecKer);
-
-   if (loc4f >= 0)
-      glUniform4fv(loc4f, 4, vecKer);
+   {
+      GLuint loc1f = glGetUniformLocationARB(program, "KernelValue1f");
+      GLuint loc2f = glGetUniformLocationARB(program, "KernelValue2f");
+      GLuint loc4f = glGetUniformLocationARB(program, "KernelValue4f");
+      GLfloat vecKer[] =
+         { 1.0, 0.0, 0.0,  0.25,
+           0.0, 1.0, 0.0,  0.25,
+           0.0, 0.0, 1.0,  0.25,
+           0.0, 0.0, 0.0,  0.25,
+           0.5, 0.0, 0.0,  0.35,
+           0.0, 0.5, 0.0,  0.35,
+           0.0, 0.0, 0.5,  0.35,
+           0.0, 0.0, 0.0,  0.35
+         };
+      if (loc1f >= 0)
+         glUniform1fv(loc1f, 16, vecKer);
+
+      if (loc2f >= 0)
+         glUniform2fv(loc2f, 8, vecKer);
+
+      if (loc4f >= 0)
+         glUniform4fv(loc4f, 4, vecKer);
+   }
 }
 
 static void prepare_shaders()
@@ -303,6 +306,7 @@ int main( int argc, char *argv[] )
    glutInitWindowSize( 250, 250 );
    glutInitDisplayMode( GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH );
    glutCreateWindow(argv[0]);
+   glewInit();
    glutReshapeFunc( Reshape );
    glutKeyboardFunc( Key );
    glutDisplayFunc( Display );