summaryrefslogtreecommitdiffstats
path: root/progs/vpglsl/vp-tris.c
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2009-03-09 17:10:12 +0000
committerKeith Whitwell <[email protected]>2009-03-09 18:51:14 +0000
commitce0ac9006a4ceb42d7f07061f264e3092d03e640 (patch)
treead9dc9e33e796f7d733f4b67d9fe9bbb74d8a0ef /progs/vpglsl/vp-tris.c
parent0e28e1a72fd3517d6d872ac8396e800268ba3dde (diff)
vpglsl: build with scons and glew
Diffstat (limited to 'progs/vpglsl/vp-tris.c')
-rw-r--r--progs/vpglsl/vp-tris.c48
1 files changed, 26 insertions, 22 deletions
diff --git a/progs/vpglsl/vp-tris.c b/progs/vpglsl/vp-tris.c
index 9108d3f1978..9ae410bf984 100644
--- a/progs/vpglsl/vp-tris.c
+++ b/progs/vpglsl/vp-tris.c
@@ -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 );