summaryrefslogtreecommitdiffstats
path: root/progs/glsl
diff options
context:
space:
mode:
Diffstat (limited to 'progs/glsl')
-rw-r--r--progs/glsl/Makefile2
-rw-r--r--progs/glsl/SConscript55
-rw-r--r--progs/glsl/array.c3
-rw-r--r--progs/glsl/bitmap.c2
-rw-r--r--progs/glsl/brick.c2
-rw-r--r--progs/glsl/bump.c1
-rw-r--r--progs/glsl/convolutions.c3
-rw-r--r--progs/glsl/deriv.c2
-rw-r--r--progs/glsl/fragcoord.c2
-rw-r--r--progs/glsl/identity.c2
-rw-r--r--progs/glsl/linktest.c2
-rw-r--r--progs/glsl/mandelbrot.c2
-rw-r--r--progs/glsl/multinoise.c2
-rw-r--r--progs/glsl/multitex.c6
-rw-r--r--progs/glsl/noise.c2
-rw-r--r--progs/glsl/pointcoord.c2
-rw-r--r--progs/glsl/points.c2
-rw-r--r--progs/glsl/reflect.vert1
-rw-r--r--progs/glsl/samplers.c2
-rw-r--r--progs/glsl/shadow_sampler.c2
-rw-r--r--progs/glsl/skinning.c2
-rw-r--r--progs/glsl/texaaline.c2
-rw-r--r--progs/glsl/texdemo1.c2
-rw-r--r--progs/glsl/toyball.c2
-rw-r--r--progs/glsl/trirast.c2
-rw-r--r--progs/glsl/twoside.c2
-rw-r--r--progs/glsl/vert-or-frag-only.c2
-rw-r--r--progs/glsl/vert-tex.c2
28 files changed, 109 insertions, 4 deletions
diff --git a/progs/glsl/Makefile b/progs/glsl/Makefile
index f97cdb69429..eedd866c957 100644
--- a/progs/glsl/Makefile
+++ b/progs/glsl/Makefile
@@ -10,7 +10,7 @@ LIB_DEP = \
$(TOP)/$(LIB_DIR)/$(GLU_LIB_NAME) \
$(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME)
-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)
INCLUDE_DIRS = -I$(TOP)/progs/util
diff --git a/progs/glsl/SConscript b/progs/glsl/SConscript
new file mode 100644
index 00000000000..7a4549cd705
--- /dev/null
+++ b/progs/glsl/SConscript
@@ -0,0 +1,55 @@
+Import('*')
+
+if not env['GLUT']:
+ Return()
+
+env = env.Clone()
+
+env.Prepend(CPPPATH = [
+ '../util',
+])
+
+env.Prepend(LIBS = [
+ util,
+ '$GLUT_LIB'
+])
+
+if env['platform'] == 'windows':
+ env.Append(CPPDEFINES = ['NOMINMAX'])
+ env.Prepend(LIBS = ['winmm'])
+
+progs = [
+ 'array',
+ 'bitmap',
+ 'brick',
+ 'bump',
+ 'convolutions',
+ 'deriv',
+ 'fragcoord',
+ 'identity',
+ 'linktest',
+ 'mandelbrot',
+ 'multinoise',
+ 'multitex',
+ 'noise',
+ 'noise2',
+ 'pointcoord',
+ 'points',
+ 'samplers',
+ 'shadow_sampler',
+ 'skinning',
+ 'texaaline',
+ 'texdemo1',
+ 'toyball',
+ 'trirast',
+ 'twoside',
+ 'vert-or-frag-only',
+ 'vert-tex',
+]
+
+for prog in progs:
+ env.Program(
+ target = prog,
+ source = prog + '.c',
+ )
+
diff --git a/progs/glsl/array.c b/progs/glsl/array.c
index 46ef8043bcf..6da15b2fcc0 100644
--- a/progs/glsl/array.c
+++ b/progs/glsl/array.c
@@ -9,9 +9,9 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/gl.h>
#include <GL/glut.h>
-#include <GL/glext.h>
#include "extfuncs.h"
#include "shaderutil.h"
@@ -248,6 +248,7 @@ main(int argc, char *argv[])
glutInitWindowSize(500, 500);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
win = glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
diff --git a/progs/glsl/bitmap.c b/progs/glsl/bitmap.c
index d488ec6cb9f..08fac15c89d 100644
--- a/progs/glsl/bitmap.c
+++ b/progs/glsl/bitmap.c
@@ -9,6 +9,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/gl.h>
#include <GL/glut.h>
#include <GL/glext.h>
@@ -309,6 +310,7 @@ main(int argc, char *argv[])
glutInitWindowSize(WinWidth, WinHeight);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
Win = glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
diff --git a/progs/glsl/brick.c b/progs/glsl/brick.c
index 526ef0e2e36..607acd05977 100644
--- a/progs/glsl/brick.c
+++ b/progs/glsl/brick.c
@@ -9,6 +9,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/gl.h>
#include <GL/glut.h>
#include <GL/glext.h>
@@ -191,6 +192,7 @@ main(int argc, char *argv[])
glutInitWindowSize(400, 400);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
win = glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
diff --git a/progs/glsl/bump.c b/progs/glsl/bump.c
index 0ea1f8331ff..c401e590f74 100644
--- a/progs/glsl/bump.c
+++ b/progs/glsl/bump.c
@@ -288,6 +288,7 @@ main(int argc, char *argv[])
glutInitWindowSize(400, 400);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
win = glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
diff --git a/progs/glsl/convolutions.c b/progs/glsl/convolutions.c
index ac71c68235e..22ce7edcdc5 100644
--- a/progs/glsl/convolutions.c
+++ b/progs/glsl/convolutions.c
@@ -5,6 +5,8 @@
* Author: Zack Rusin
*/
+#include <GL/glew.h>
+
#define GL_GLEXT_PROTOTYPES
#include "readtex.h"
@@ -455,6 +457,7 @@ int main(int argc, char **argv)
exit(1);
}
+ glewInit();
init();
glutReshapeFunc(reshape);
diff --git a/progs/glsl/deriv.c b/progs/glsl/deriv.c
index e69f0b82c45..3fd674c3310 100644
--- a/progs/glsl/deriv.c
+++ b/progs/glsl/deriv.c
@@ -13,6 +13,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/gl.h>
#include <GL/glut.h>
#include <GL/glext.h>
@@ -228,6 +229,7 @@ main(int argc, char *argv[])
glutInitWindowSize(200, 200);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
win = glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
diff --git a/progs/glsl/fragcoord.c b/progs/glsl/fragcoord.c
index 0b7561f3e47..509ad47e7f6 100644
--- a/progs/glsl/fragcoord.c
+++ b/progs/glsl/fragcoord.c
@@ -12,6 +12,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/gl.h>
#include <GL/glut.h>
#include <GL/glext.h>
@@ -174,6 +175,7 @@ main(int argc, char *argv[])
glutInitWindowSize(WinWidth, WinHeight);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
win = glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Redisplay);
diff --git a/progs/glsl/identity.c b/progs/glsl/identity.c
index 37579eb3469..5ba7468cc44 100644
--- a/progs/glsl/identity.c
+++ b/progs/glsl/identity.c
@@ -9,6 +9,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/gl.h>
#include <GL/glut.h>
#include <GL/glext.h>
@@ -195,6 +196,7 @@ main(int argc, char *argv[])
glutInitWindowSize(200, 200);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
win = glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
diff --git a/progs/glsl/linktest.c b/progs/glsl/linktest.c
index 988d0823418..fe5d1564e07 100644
--- a/progs/glsl/linktest.c
+++ b/progs/glsl/linktest.c
@@ -9,6 +9,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/gl.h>
#include <GL/glut.h>
#include <GL/glext.h>
@@ -245,6 +246,7 @@ main(int argc, char *argv[])
glutInitWindowSize(300, 300);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
Win = glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Redisplay);
diff --git a/progs/glsl/mandelbrot.c b/progs/glsl/mandelbrot.c
index 24e19926655..eeea4eb52ae 100644
--- a/progs/glsl/mandelbrot.c
+++ b/progs/glsl/mandelbrot.c
@@ -9,6 +9,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/gl.h>
#include <GL/glut.h>
#include <GL/glext.h>
@@ -206,6 +207,7 @@ main(int argc, char *argv[])
glutInitWindowSize(400, 400);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
win = glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
diff --git a/progs/glsl/multinoise.c b/progs/glsl/multinoise.c
index 2351863aff8..400511508e1 100644
--- a/progs/glsl/multinoise.c
+++ b/progs/glsl/multinoise.c
@@ -8,6 +8,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/gl.h>
#include <GL/glut.h>
#include <GL/glext.h>
@@ -270,6 +271,7 @@ main(int argc, char *argv[])
glutInitWindowSize(400, 400);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
win = glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
diff --git a/progs/glsl/multitex.c b/progs/glsl/multitex.c
index 1a1c63aaf48..c6e0b10b49d 100644
--- a/progs/glsl/multitex.c
+++ b/progs/glsl/multitex.c
@@ -28,6 +28,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <GL/glew.h>
#include "GL/glut.h"
#include "readtex.h"
#include "extfuncs.h"
@@ -139,7 +140,7 @@ DrawPolygonArray(void)
}
else {
glVertexPointer(2, GL_FLOAT, 0, vertPtr);
- glEnable(GL_VERTEX_ARRAY);
+ glEnableClientState(GL_VERTEX_ARRAY);
}
glVertexAttribPointer_func(TexCoord0_attr, 2, GL_FLOAT, GL_FALSE,
@@ -152,7 +153,7 @@ DrawPolygonArray(void)
glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
- glBindBufferARB_func(GL_ARRAY_BUFFER_ARB, 0);
+ glBindBufferARB_func(GL_ARRAY_BUFFER_ARB, 0);
}
@@ -400,6 +401,7 @@ main(int argc, char *argv[])
glutInitWindowSize(500, 400);
glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE);
glutCreateWindow(Demo);
+ glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(key);
glutSpecialFunc(specialkey);
diff --git a/progs/glsl/noise.c b/progs/glsl/noise.c
index bd8f50036bf..83e4696fc99 100644
--- a/progs/glsl/noise.c
+++ b/progs/glsl/noise.c
@@ -8,6 +8,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/gl.h>
#include <GL/glut.h>
#include <GL/glext.h>
@@ -207,6 +208,7 @@ main(int argc, char *argv[])
glutInitWindowSize(400, 400);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
win = glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
diff --git a/progs/glsl/pointcoord.c b/progs/glsl/pointcoord.c
index b240077c252..aa01e2166d7 100644
--- a/progs/glsl/pointcoord.c
+++ b/progs/glsl/pointcoord.c
@@ -10,6 +10,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/gl.h>
#include <GL/glut.h>
#include <GL/glext.h>
@@ -195,6 +196,7 @@ main(int argc, char *argv[])
glutInitWindowSize(WinWidth, WinHeight);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
win = glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Redisplay);
diff --git a/progs/glsl/points.c b/progs/glsl/points.c
index 392dc4db853..1b346228aa1 100644
--- a/progs/glsl/points.c
+++ b/progs/glsl/points.c
@@ -10,6 +10,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/gl.h>
#include <GL/glut.h>
#include <GL/glext.h>
@@ -248,6 +249,7 @@ main(int argc, char *argv[])
glutInitWindowSize(WinWidth, WinHeight);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
Win = glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
diff --git a/progs/glsl/reflect.vert b/progs/glsl/reflect.vert
index 402be38bf7b..e1f22def339 100644
--- a/progs/glsl/reflect.vert
+++ b/progs/glsl/reflect.vert
@@ -11,6 +11,7 @@ void main()
float two_n_dot_u = 2.0 * dot(n, u);
vec4 f;
f.xyz = u - n * two_n_dot_u;
+ f.w = 1.0;
// outputs
normal = n;
diff --git a/progs/glsl/samplers.c b/progs/glsl/samplers.c
index 3fb8577d5e3..cbb264dad17 100644
--- a/progs/glsl/samplers.c
+++ b/progs/glsl/samplers.c
@@ -39,6 +39,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <GL/glew.h>
#include "GL/glut.h"
#include "readtex.h"
#include "extfuncs.h"
@@ -357,6 +358,7 @@ main(int argc, char *argv[])
glutInitWindowSize(500, 400);
glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE);
glutCreateWindow(Demo);
+ glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(key);
glutSpecialFunc(specialkey);
diff --git a/progs/glsl/shadow_sampler.c b/progs/glsl/shadow_sampler.c
index 2902b535522..673ad465ad8 100644
--- a/progs/glsl/shadow_sampler.c
+++ b/progs/glsl/shadow_sampler.c
@@ -10,6 +10,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/gl.h>
#include <GL/glut.h>
#include <GL/glext.h>
@@ -329,6 +330,7 @@ main(int argc, char *argv[])
glutInitWindowSize(400, 300);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
win = glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Redisplay);
diff --git a/progs/glsl/skinning.c b/progs/glsl/skinning.c
index 8a65d0667ce..d7b968fed05 100644
--- a/progs/glsl/skinning.c
+++ b/progs/glsl/skinning.c
@@ -12,6 +12,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/gl.h>
#include <GL/glut.h>
#include <GL/glext.h>
@@ -266,6 +267,7 @@ main(int argc, char *argv[])
glutInitWindowSize(500, 500);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
win = glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
diff --git a/progs/glsl/texaaline.c b/progs/glsl/texaaline.c
index 0b3cc849586..6720941a6e1 100644
--- a/progs/glsl/texaaline.c
+++ b/progs/glsl/texaaline.c
@@ -11,6 +11,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/gl.h>
#include <GL/glut.h>
#include <GL/glext.h>
@@ -359,6 +360,7 @@ main(int argc, char *argv[])
glutInitWindowSize(WinWidth, WinHeight);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
win = glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Redisplay);
diff --git a/progs/glsl/texdemo1.c b/progs/glsl/texdemo1.c
index 96ddca1f32d..08a87a51525 100644
--- a/progs/glsl/texdemo1.c
+++ b/progs/glsl/texdemo1.c
@@ -28,6 +28,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <GL/glew.h>
#include "GL/glut.h"
#include "readtex.h"
#include "extfuncs.h"
@@ -426,6 +427,7 @@ main(int argc, char *argv[])
glutInitWindowSize(500, 400);
glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE);
win = glutCreateWindow(Demo);
+ glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(key);
glutSpecialFunc(specialkey);
diff --git a/progs/glsl/toyball.c b/progs/glsl/toyball.c
index 37ad6bf2914..2b644acb6d4 100644
--- a/progs/glsl/toyball.c
+++ b/progs/glsl/toyball.c
@@ -9,6 +9,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/gl.h>
#include <GL/glut.h>
#include <GL/glext.h>
@@ -212,6 +213,7 @@ main(int argc, char *argv[])
glutInitWindowSize(400, 400);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
win = glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
diff --git a/progs/glsl/trirast.c b/progs/glsl/trirast.c
index 89df64fc718..3d4decaa2fb 100644
--- a/progs/glsl/trirast.c
+++ b/progs/glsl/trirast.c
@@ -15,6 +15,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/gl.h>
#include <GL/glut.h>
#include <GL/glext.h>
@@ -247,6 +248,7 @@ main(int argc, char *argv[])
glutInitWindowSize(WinWidth, WinHeight);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
win = glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Redisplay);
diff --git a/progs/glsl/twoside.c b/progs/glsl/twoside.c
index 06488bd1759..9ebc4ec3607 100644
--- a/progs/glsl/twoside.c
+++ b/progs/glsl/twoside.c
@@ -12,6 +12,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/gl.h>
#include <GL/glut.h>
#include <GL/glext.h>
@@ -293,6 +294,7 @@ main(int argc, char *argv[])
glutInitWindowSize(WinWidth, WinHeight);
glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE);
win = glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Redisplay);
diff --git a/progs/glsl/vert-or-frag-only.c b/progs/glsl/vert-or-frag-only.c
index f6eedd8327c..8e1612aca46 100644
--- a/progs/glsl/vert-or-frag-only.c
+++ b/progs/glsl/vert-or-frag-only.c
@@ -11,6 +11,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/gl.h>
#include <GL/glut.h>
#include <GL/glext.h>
@@ -181,6 +182,7 @@ main(int argc, char *argv[])
glutInitWindowSize(400, 200);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
Win = glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Redisplay);
diff --git a/progs/glsl/vert-tex.c b/progs/glsl/vert-tex.c
index 9d00a610540..b74bf50679f 100644
--- a/progs/glsl/vert-tex.c
+++ b/progs/glsl/vert-tex.c
@@ -9,6 +9,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/gl.h>
#include <GL/glut.h>
#include <GL/glext.h>
@@ -266,6 +267,7 @@ main(int argc, char *argv[])
glutInitWindowSize(500, 500);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
win = glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);