From b799af91d5ffbee1481161fec29eb4c92b161272 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Mon, 29 Jun 2009 14:13:58 +0100 Subject: [PATCH] progs/glsl: compile with scons and glew Get most of these working with scons. --- progs/SConscript | 1 + progs/glsl/SConscript | 55 ++++++++++++++++++++++++++++++++++ progs/glsl/array.c | 3 +- progs/glsl/bitmap.c | 2 ++ progs/glsl/brick.c | 2 ++ progs/glsl/bump.c | 1 + progs/glsl/convolutions.c | 3 ++ progs/glsl/deriv.c | 2 ++ progs/glsl/fragcoord.c | 2 ++ progs/glsl/identity.c | 2 ++ progs/glsl/linktest.c | 2 ++ progs/glsl/mandelbrot.c | 2 ++ progs/glsl/multinoise.c | 2 ++ progs/glsl/multitex.c | 2 ++ progs/glsl/noise.c | 2 ++ progs/glsl/pointcoord.c | 2 ++ progs/glsl/points.c | 2 ++ progs/glsl/samplers.c | 2 ++ progs/glsl/shadow_sampler.c | 2 ++ progs/glsl/skinning.c | 2 ++ progs/glsl/texaaline.c | 2 ++ progs/glsl/texdemo1.c | 2 ++ progs/glsl/toyball.c | 2 ++ progs/glsl/trirast.c | 2 ++ progs/glsl/twoside.c | 2 ++ progs/glsl/vert-or-frag-only.c | 2 ++ progs/glsl/vert-tex.c | 2 ++ 27 files changed, 106 insertions(+), 1 deletion(-) create mode 100644 progs/glsl/SConscript diff --git a/progs/SConscript b/progs/SConscript index 71ebe5e0f37..620dd30e69c 100644 --- a/progs/SConscript +++ b/progs/SConscript @@ -1,6 +1,7 @@ SConscript([ 'util/SConscript', 'demos/SConscript', + 'glsl/SConscript', 'redbook/SConscript', 'samples/SConscript', 'tests/SConscript', 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 #include #include +#include #include #include -#include #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 #include #include +#include #include #include #include @@ -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 #include #include +#include #include #include #include @@ -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 + #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 #include #include +#include #include #include #include @@ -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 #include #include +#include #include #include #include @@ -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 #include #include +#include #include #include #include @@ -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 #include #include +#include #include #include #include @@ -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 #include #include +#include #include #include #include @@ -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 #include #include +#include #include #include #include @@ -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 bbf58af055d..724f15e1a38 100644 --- a/progs/glsl/multitex.c +++ b/progs/glsl/multitex.c @@ -28,6 +28,7 @@ #include #include #include +#include #include "GL/glut.h" #include "readtex.h" #include "extfuncs.h" @@ -334,6 +335,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 #include #include +#include #include #include #include @@ -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 #include #include +#include #include #include #include @@ -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 #include #include +#include #include #include #include @@ -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 3fb8577d5e3..cbb264dad17 100644 --- a/progs/glsl/samplers.c +++ b/progs/glsl/samplers.c @@ -39,6 +39,7 @@ #include #include #include +#include #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 #include #include +#include #include #include #include @@ -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 #include #include +#include #include #include #include @@ -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 #include #include +#include #include #include #include @@ -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 #include #include +#include #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 #include #include +#include #include #include #include @@ -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 #include #include +#include #include #include #include @@ -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 #include #include +#include #include #include #include @@ -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 #include #include +#include #include #include #include @@ -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 #include #include +#include #include #include #include @@ -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); -- 2.30.2