summaryrefslogtreecommitdiff
path: root/progs/glsl
diff options
context:
space:
mode:
Diffstat (limited to 'progs/glsl')
-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.c2
-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/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
26 files changed, 105 insertions, 1 deletions
diff --git a/progs/glsl/SConscript b/progs/glsl/SConscript
new file mode 100644
index 0000000000..7a4549cd70
--- /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 46ef8043bc..6da15b2fcc 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 d488ec6cb9..08fac15c89 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 526ef0e2e3..607acd0597 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 0ea1f8331f..c401e590f7 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 ac71c68235..22ce7edcdc 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 e69f0b82c4..3fd674c331 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 0b7561f3e4..509ad47e7f 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 37579eb346..5ba7468cc4 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 988d082341..fe5d1564e0 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 24e1992665..eeea4eb52a 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 2351863aff..400511508e 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 1a1c63aaf4..cbf173304c 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"
@@ -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 bd8f50036b..83e4696fc9 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 b240077c25..aa01e2166d 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 392dc4db85..1b346228aa 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/samplers.c b/progs/glsl/samplers.c
index 3fb8577d5e..cbb264dad1 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 2902b53552..673ad465ad 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 8a65d0667c..d7b968fed0 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 0b3cc84958..6720941a6e 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 96ddca1f32..08a87a5152 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 37ad6bf291..2b644acb6d 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 89df64fc71..3d4decaa2f 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 06488bd175..9ebc4ec360 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 f6eedd8327..8e1612aca4 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 9d00a61054..b74bf50679 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);