Mesa (gallium-0.2): progs/trivial: Use glew where needed.
Jose Fonseca
jrfonseca at kemper.freedesktop.org
Fri Jan 23 14:55:29 UTC 2009
Module: Mesa
Branch: gallium-0.2
Commit: 479ea7d87b6d283cd74d345cb618d69a889284d9
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=479ea7d87b6d283cd74d345cb618d69a889284d9
Author: José Fonseca <jfonseca at vmware.com>
Date: Fri Jan 23 14:35:36 2009 +0000
progs/trivial: Use glew where needed.
Builds on windows now.
---
progs/SConstruct | 25 +++++++++++++++++++++++--
progs/trivial/Makefile | 2 +-
progs/trivial/clear-fbo-tex.c | 4 +++-
progs/trivial/clear-fbo.c | 4 +++-
progs/trivial/drawarrays.c | 3 ++-
progs/trivial/drawelements.c | 3 ++-
progs/trivial/drawrange.c | 3 ++-
progs/trivial/lineloop-elts.c | 3 ++-
progs/trivial/long-fixed-func.c | 3 ++-
progs/trivial/point-param.c | 4 +++-
progs/trivial/quad-tex-3d.c | 3 +++
progs/trivial/quad-tex-pbo.c | 4 +++-
progs/trivial/readpixels.c | 4 +++-
progs/trivial/tri-array-interleaved.c | 3 ++-
progs/trivial/tri-blend-color.c | 3 +++
progs/trivial/tri-blend-max.c | 4 +++-
progs/trivial/tri-blend-min.c | 4 +++-
progs/trivial/tri-blend-revsub.c | 4 +++-
progs/trivial/tri-blend-sub.c | 4 +++-
progs/trivial/tri-fbo-tex.c | 3 ++-
progs/trivial/tri-fbo.c | 4 +++-
progs/trivial/tri-fp-const-imm.c | 4 +++-
progs/trivial/tri-fp.c | 4 +++-
progs/trivial/tri-query.c | 4 +++-
progs/trivial/tri-tex-3d.c | 3 +++
progs/trivial/vbo-drawarrays.c | 3 ++-
progs/trivial/vbo-drawelements.c | 3 ++-
progs/trivial/vbo-drawrange.c | 3 ++-
progs/trivial/vp-array-int.c | 3 ++-
progs/trivial/vp-array.c | 3 ++-
progs/trivial/vp-clip.c | 3 ++-
progs/trivial/vp-line-clip.c | 3 ++-
progs/trivial/vp-tri-cb-pos.c | 6 ++++--
progs/trivial/vp-tri-cb-tex.c | 4 +++-
progs/trivial/vp-tri-cb.c | 3 ++-
progs/trivial/vp-tri-imm.c | 3 ++-
progs/trivial/vp-tri-swap.c | 3 ++-
progs/trivial/vp-tri-tex.c | 3 ++-
progs/trivial/vp-tri.c | 3 ++-
progs/trivial/vp-unfilled.c | 3 ++-
40 files changed, 119 insertions(+), 39 deletions(-)
diff --git a/progs/SConstruct b/progs/SConstruct
index ac5314f..bce48f7 100644
--- a/progs/SConstruct
+++ b/progs/SConstruct
@@ -10,9 +10,23 @@ env = Environment(
# Use Mesa's headers and libs
-if 0:
+if 1:
+ build_topdir = 'build'
+ build_subdir = env['platform']
+ if env['machine'] != 'generic':
+ build_subdir += '-' + env['machine']
+ if env['debug']:
+ build_subdir += "-debug"
+ if env['profile']:
+ build_subdir += "-profile"
+ build_dir = os.path.join(build_topdir, build_subdir)
+
+ env.Append(CPPDEFINES = ['GLEW_STATIC'])
env.Append(CPPPATH = ['#../include'])
- env.Append(LIBPATH = ['#../lib'])
+ env.Append(LIBPATH = [
+ '#../' + build_dir + '/glew/',
+ '#../' + build_dir + '/glut/glx',
+ ])
conf = Configure(env)
@@ -32,6 +46,13 @@ if conf.CheckCHeader('GL/glut.h'):
env['GLUT_LIB'] = 'glut'
env['GLUT'] = True
+# GLEW
+env['GLEW'] = False
+if conf.CheckCHeader('GL/glew.h'):
+ env['GLEW_LIB'] = 'glew'
+ env['GLEW'] = True
+ env.Prepend(LIBS = ['glew'])
+
conf.Finish()
diff --git a/progs/trivial/Makefile b/progs/trivial/Makefile
index 2c158c8..dce96f6 100644
--- a/progs/trivial/Makefile
+++ b/progs/trivial/Makefile
@@ -8,7 +8,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 $(GLEW_LIB) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) $(APP_LIB_DEPS)
SOURCES = \
clear-fbo-tex.c \
diff --git a/progs/trivial/clear-fbo-tex.c b/progs/trivial/clear-fbo-tex.c
index 68f1ab3..eccfde5 100644
--- a/progs/trivial/clear-fbo-tex.c
+++ b/progs/trivial/clear-fbo-tex.c
@@ -5,7 +5,7 @@
#include <math.h>
#include <string.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
@@ -210,6 +210,8 @@ main( int argc, char *argv[] )
exit(1);
}
+ glewInit();
+
Init();
glutReshapeFunc(Reshape);
diff --git a/progs/trivial/clear-fbo.c b/progs/trivial/clear-fbo.c
index 82218ed..64b2543 100644
--- a/progs/trivial/clear-fbo.c
+++ b/progs/trivial/clear-fbo.c
@@ -5,7 +5,7 @@
#include <math.h>
#include <string.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
@@ -195,6 +195,8 @@ main( int argc, char *argv[] )
exit(1);
}
+ glewInit();
+
Init();
glutReshapeFunc(Reshape);
diff --git a/progs/trivial/drawarrays.c b/progs/trivial/drawarrays.c
index 596eee9..27d8668 100644
--- a/progs/trivial/drawarrays.c
+++ b/progs/trivial/drawarrays.c
@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
@@ -118,6 +118,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 );
diff --git a/progs/trivial/drawelements.c b/progs/trivial/drawelements.c
index e0c8e80..4c11503 100644
--- a/progs/trivial/drawelements.c
+++ b/progs/trivial/drawelements.c
@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
GLfloat verts[][4] = {
@@ -111,6 +111,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 );
diff --git a/progs/trivial/drawrange.c b/progs/trivial/drawrange.c
index 9c787cb..e9ea99b 100644
--- a/progs/trivial/drawrange.c
+++ b/progs/trivial/drawrange.c
@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
GLfloat verts[][4] = {
@@ -109,6 +109,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 );
diff --git a/progs/trivial/lineloop-elts.c b/progs/trivial/lineloop-elts.c
index 96da8e4..ab94415 100644
--- a/progs/trivial/lineloop-elts.c
+++ b/progs/trivial/lineloop-elts.c
@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
GLfloat verts[][4] = {
@@ -111,6 +111,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 );
diff --git a/progs/trivial/long-fixed-func.c b/progs/trivial/long-fixed-func.c
index 88f4fe0..41ad25c 100644
--- a/progs/trivial/long-fixed-func.c
+++ b/progs/trivial/long-fixed-func.c
@@ -5,7 +5,7 @@
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
@@ -142,6 +142,7 @@ main(int argc, char **argv)
if (glutCreateWindow("tri-long-fixedfunc") == GL_FALSE) {
exit(1);
}
+ glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Draw);
diff --git a/progs/trivial/point-param.c b/progs/trivial/point-param.c
index 96544a0..1edeec3 100644
--- a/progs/trivial/point-param.c
+++ b/progs/trivial/point-param.c
@@ -22,7 +22,7 @@
* OF THIS SOFTWARE.
*/
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
@@ -146,6 +146,8 @@ int main(int argc, char **argv)
exit(1);
}
+ glewInit();
+
Init();
glutReshapeFunc(Reshape);
diff --git a/progs/trivial/quad-tex-3d.c b/progs/trivial/quad-tex-3d.c
index fd02d9d..ca7ea91 100644
--- a/progs/trivial/quad-tex-3d.c
+++ b/progs/trivial/quad-tex-3d.c
@@ -25,6 +25,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
+#include <GL/glew.h>
#include <GL/glut.h>
@@ -167,6 +168,8 @@ int main(int argc, char **argv)
exit(1);
}
+ glewInit();
+
Init();
glutReshapeFunc(Reshape);
diff --git a/progs/trivial/quad-tex-pbo.c b/progs/trivial/quad-tex-pbo.c
index 5b63c69..c6f60f5 100644
--- a/progs/trivial/quad-tex-pbo.c
+++ b/progs/trivial/quad-tex-pbo.c
@@ -22,7 +22,7 @@
* OF THIS SOFTWARE.
*/
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <stdio.h>
#include <string.h>
@@ -171,6 +171,8 @@ int main(int argc, char **argv)
exit(1);
}
+ glewInit();
+
Init();
glutReshapeFunc(Reshape);
diff --git a/progs/trivial/readpixels.c b/progs/trivial/readpixels.c
index 783468a..88aac26 100644
--- a/progs/trivial/readpixels.c
+++ b/progs/trivial/readpixels.c
@@ -3,7 +3,7 @@
*/
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
@@ -91,6 +91,8 @@ int main(int argc, char **argv)
if (argc > 1)
Zoom = atof(argv[1]);
+ glewInit();
+
Init();
glutReshapeFunc(Reshape);
diff --git a/progs/trivial/tri-array-interleaved.c b/progs/trivial/tri-array-interleaved.c
index e40e692..95de205 100644
--- a/progs/trivial/tri-array-interleaved.c
+++ b/progs/trivial/tri-array-interleaved.c
@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
struct {
@@ -110,6 +110,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 );
diff --git a/progs/trivial/tri-blend-color.c b/progs/trivial/tri-blend-color.c
index b9a5394..d2d72d0 100644
--- a/progs/trivial/tri-blend-color.c
+++ b/progs/trivial/tri-blend-color.c
@@ -25,6 +25,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
+#include <GL/glew.h>
#include <GL/glut.h>
@@ -131,6 +132,8 @@ int main(int argc, char **argv)
exit(1);
}
+ glewInit();
+
Init();
glutReshapeFunc(Reshape);
diff --git a/progs/trivial/tri-blend-max.c b/progs/trivial/tri-blend-max.c
index ebc241c..b39f8f3 100644
--- a/progs/trivial/tri-blend-max.c
+++ b/progs/trivial/tri-blend-max.c
@@ -41,8 +41,9 @@
* to demonstrate the effect order has on alpha blending results.
* Use the 't' key to toggle the order of drawing polygons.
*/
-#include <GL/glut.h>
#include <stdlib.h>
+#include <GL/glew.h>
+#include <GL/glut.h>
static int leftFirst = GL_TRUE;
@@ -136,6 +137,7 @@ int main(int argc, char** argv)
glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB);
glutInitWindowSize (200, 200);
glutCreateWindow (argv[0]);
+ glewInit();
init();
glutReshapeFunc (reshape);
glutKeyboardFunc (keyboard);
diff --git a/progs/trivial/tri-blend-min.c b/progs/trivial/tri-blend-min.c
index 00b2dec..656297c 100644
--- a/progs/trivial/tri-blend-min.c
+++ b/progs/trivial/tri-blend-min.c
@@ -41,8 +41,9 @@
* to demonstrate the effect order has on alpha blending results.
* Use the 't' key to toggle the order of drawing polygons.
*/
-#include <GL/glut.h>
#include <stdlib.h>
+#include <GL/glew.h>
+#include <GL/glut.h>
static int leftFirst = GL_TRUE;
@@ -136,6 +137,7 @@ int main(int argc, char** argv)
glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB);
glutInitWindowSize (200, 200);
glutCreateWindow (argv[0]);
+ glewInit();
init();
glutReshapeFunc (reshape);
glutKeyboardFunc (keyboard);
diff --git a/progs/trivial/tri-blend-revsub.c b/progs/trivial/tri-blend-revsub.c
index be187fd..fe225f1 100644
--- a/progs/trivial/tri-blend-revsub.c
+++ b/progs/trivial/tri-blend-revsub.c
@@ -41,8 +41,9 @@
* to demonstrate the effect order has on alpha blending results.
* Use the 't' key to toggle the order of drawing polygons.
*/
-#include <GL/glut.h>
#include <stdlib.h>
+#include <GL/glew.h>
+#include <GL/glut.h>
static int leftFirst = GL_TRUE;
@@ -136,6 +137,7 @@ int main(int argc, char** argv)
glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB);
glutInitWindowSize (200, 200);
glutCreateWindow (argv[0]);
+ glewInit();
init();
glutReshapeFunc (reshape);
glutKeyboardFunc (keyboard);
diff --git a/progs/trivial/tri-blend-sub.c b/progs/trivial/tri-blend-sub.c
index d207791..cc1aeaf 100644
--- a/progs/trivial/tri-blend-sub.c
+++ b/progs/trivial/tri-blend-sub.c
@@ -41,8 +41,9 @@
* to demonstrate the effect order has on alpha blending results.
* Use the 't' key to toggle the order of drawing polygons.
*/
-#include <GL/glut.h>
#include <stdlib.h>
+#include <GL/glew.h>
+#include <GL/glut.h>
static int leftFirst = GL_TRUE;
@@ -136,6 +137,7 @@ int main(int argc, char** argv)
glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB);
glutInitWindowSize (200, 200);
glutCreateWindow (argv[0]);
+ glewInit();
init();
glutReshapeFunc (reshape);
glutKeyboardFunc (keyboard);
diff --git a/progs/trivial/tri-fbo-tex.c b/progs/trivial/tri-fbo-tex.c
index d413d40..253f931 100644
--- a/progs/trivial/tri-fbo-tex.c
+++ b/progs/trivial/tri-fbo-tex.c
@@ -9,7 +9,7 @@
*/
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
#include <assert.h>
#include <stdio.h>
@@ -256,6 +256,7 @@ main(int argc, char *argv[])
glutInitWindowSize(Width, Height);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
Win = glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Display);
diff --git a/progs/trivial/tri-fbo.c b/progs/trivial/tri-fbo.c
index 82d70c4..7a38f21 100644
--- a/progs/trivial/tri-fbo.c
+++ b/progs/trivial/tri-fbo.c
@@ -5,7 +5,7 @@
#include <math.h>
#include <string.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
@@ -190,6 +190,8 @@ main( int argc, char *argv[] )
exit(1);
}
+ glewInit();
+
Init();
glutReshapeFunc(Reshape);
diff --git a/progs/trivial/tri-fp-const-imm.c b/progs/trivial/tri-fp-const-imm.c
index 7111380..9e2c63a 100644
--- a/progs/trivial/tri-fp-const-imm.c
+++ b/progs/trivial/tri-fp-const-imm.c
@@ -25,7 +25,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
@@ -159,6 +159,8 @@ int main(int argc, char **argv)
exit(1);
}
+ glewInit();
+
Init();
glutReshapeFunc(Reshape);
diff --git a/progs/trivial/tri-fp.c b/progs/trivial/tri-fp.c
index 9ff355a..fcf57f5 100644
--- a/progs/trivial/tri-fp.c
+++ b/progs/trivial/tri-fp.c
@@ -25,7 +25,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
@@ -157,6 +157,8 @@ int main(int argc, char **argv)
exit(1);
}
+ glewInit();
+
Init();
glutReshapeFunc(Reshape);
diff --git a/progs/trivial/tri-query.c b/progs/trivial/tri-query.c
index c9161c4..25cfcb8 100644
--- a/progs/trivial/tri-query.c
+++ b/progs/trivial/tri-query.c
@@ -25,7 +25,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
@@ -148,6 +148,8 @@ int main(int argc, char **argv)
exit(1);
}
+ glewInit();
+
Init();
glutReshapeFunc(Reshape);
diff --git a/progs/trivial/tri-tex-3d.c b/progs/trivial/tri-tex-3d.c
index 613803f..50f6a75 100644
--- a/progs/trivial/tri-tex-3d.c
+++ b/progs/trivial/tri-tex-3d.c
@@ -25,6 +25,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
+#include <GL/glew.h>
#include <GL/glut.h>
@@ -160,6 +161,8 @@ int main(int argc, char **argv)
exit(1);
}
+ glewInit();
+
Init();
glutReshapeFunc(Reshape);
diff --git a/progs/trivial/vbo-drawarrays.c b/progs/trivial/vbo-drawarrays.c
index fb59009..c29954b 100644
--- a/progs/trivial/vbo-drawarrays.c
+++ b/progs/trivial/vbo-drawarrays.c
@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
@@ -124,6 +124,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 );
diff --git a/progs/trivial/vbo-drawelements.c b/progs/trivial/vbo-drawelements.c
index dddb456..b1b16d9 100644
--- a/progs/trivial/vbo-drawelements.c
+++ b/progs/trivial/vbo-drawelements.c
@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
struct {
@@ -128,6 +128,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 );
diff --git a/progs/trivial/vbo-drawrange.c b/progs/trivial/vbo-drawrange.c
index 407b754..fa87eaf 100644
--- a/progs/trivial/vbo-drawrange.c
+++ b/progs/trivial/vbo-drawrange.c
@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
#define ELTOBJ 0
@@ -136,6 +136,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 );
diff --git a/progs/trivial/vp-array-int.c b/progs/trivial/vp-array-int.c
index 4d60f2b..2e1ac13 100644
--- a/progs/trivial/vp-array-int.c
+++ b/progs/trivial/vp-array-int.c
@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
GLint verts[][4] = {
@@ -108,6 +108,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 );
diff --git a/progs/trivial/vp-array.c b/progs/trivial/vp-array.c
index abe8f62..852bf7d 100644
--- a/progs/trivial/vp-array.c
+++ b/progs/trivial/vp-array.c
@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
GLfloat verts[][4] = {
@@ -108,6 +108,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 );
diff --git a/progs/trivial/vp-clip.c b/progs/trivial/vp-clip.c
index 206ba0b..267b927 100644
--- a/progs/trivial/vp-clip.c
+++ b/progs/trivial/vp-clip.c
@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
static void Init( void )
@@ -93,6 +93,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 );
diff --git a/progs/trivial/vp-line-clip.c b/progs/trivial/vp-line-clip.c
index b2aaf17..d27e4aa 100644
--- a/progs/trivial/vp-line-clip.c
+++ b/progs/trivial/vp-line-clip.c
@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
static void Init( void )
@@ -107,6 +107,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 );
diff --git a/progs/trivial/vp-tri-cb-pos.c b/progs/trivial/vp-tri-cb-pos.c
index eb3aa0a..430a4d3 100644
--- a/progs/trivial/vp-tri-cb-pos.c
+++ b/progs/trivial/vp-tri-cb-pos.c
@@ -5,7 +5,7 @@
#include <string.h>
#include <stdlib.h>
#include <math.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
@@ -146,11 +146,13 @@ int main(int argc, char **argv)
exit(1);
}
+ glewInit();
+
Init();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Draw);
glutMainLoop();
- return 0;
+ return 0;
}
diff --git a/progs/trivial/vp-tri-cb-tex.c b/progs/trivial/vp-tri-cb-tex.c
index 1e99d5b..57fd2cd 100644
--- a/progs/trivial/vp-tri-cb-tex.c
+++ b/progs/trivial/vp-tri-cb-tex.c
@@ -5,7 +5,7 @@
#include <string.h>
#include <stdlib.h>
#include <math.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
@@ -179,6 +179,8 @@ int main(int argc, char **argv)
exit(1);
}
+ glewInit();
+
Init();
glutReshapeFunc(Reshape);
diff --git a/progs/trivial/vp-tri-cb.c b/progs/trivial/vp-tri-cb.c
index f9d0d7f..1f12a2c 100644
--- a/progs/trivial/vp-tri-cb.c
+++ b/progs/trivial/vp-tri-cb.c
@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
static void Init( void )
@@ -98,6 +98,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_DEPTH | GLUT_RGB | GLUT_SINGLE );
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/trivial/vp-tri-imm.c b/progs/trivial/vp-tri-imm.c
index c774573..f2549f3 100644
--- a/progs/trivial/vp-tri-imm.c
+++ b/progs/trivial/vp-tri-imm.c
@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
static void Init( void )
@@ -92,6 +92,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_DEPTH | GLUT_RGB | GLUT_SINGLE );
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/trivial/vp-tri-swap.c b/progs/trivial/vp-tri-swap.c
index e9ca1a0..a3ab120 100644
--- a/progs/trivial/vp-tri-swap.c
+++ b/progs/trivial/vp-tri-swap.c
@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
static void Init( void )
@@ -94,6 +94,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_DEPTH | GLUT_RGB | GLUT_SINGLE );
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/trivial/vp-tri-tex.c b/progs/trivial/vp-tri-tex.c
index 83ec1ef..bd2b5e5 100644
--- a/progs/trivial/vp-tri-tex.c
+++ b/progs/trivial/vp-tri-tex.c
@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
static void Init( void )
@@ -128,6 +128,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_DEPTH | GLUT_RGB | GLUT_SINGLE );
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/trivial/vp-tri.c b/progs/trivial/vp-tri.c
index d2ef504..2932977 100644
--- a/progs/trivial/vp-tri.c
+++ b/progs/trivial/vp-tri.c
@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
static void Init( void )
@@ -95,6 +95,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_DEPTH | GLUT_RGB | GLUT_SINGLE );
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/trivial/vp-unfilled.c b/progs/trivial/vp-unfilled.c
index ac23181..fe2de67 100644
--- a/progs/trivial/vp-unfilled.c
+++ b/progs/trivial/vp-unfilled.c
@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
static void Init( void )
@@ -95,6 +95,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 );
More information about the mesa-commit
mailing list