summaryrefslogtreecommitdiff
path: root/progs
diff options
context:
space:
mode:
authorKeith Whitwell <keithw@vmware.com>2009-03-10 13:11:23 +0000
committerKeith Whitwell <keithw@vmware.com>2009-03-10 13:11:23 +0000
commita58065d4e2fc29644d804c92be773731242664c5 (patch)
treea5a7387d97c3b4a2f4138769ab90cce54e9156df /progs
parent225de01f83b58a09adfad47a5d71bece63a6ebfd (diff)
progs/tests: compile with SCons and glew
Also get mingw cross-compilation of these tests working
Diffstat (limited to 'progs')
-rw-r--r--progs/SConscript1
-rw-r--r--progs/tests/SConscript133
-rw-r--r--progs/tests/afsmultiarb.c3
-rw-r--r--progs/tests/antialias.c16
-rw-r--r--progs/tests/api_speed.c5
-rw-r--r--progs/tests/arbfpspec.c3
-rw-r--r--progs/tests/arbfptest1.c3
-rw-r--r--progs/tests/arbfptexture.c3
-rw-r--r--progs/tests/arbfptrig.c3
-rw-r--r--progs/tests/arbnpot-mipmap.c2
-rw-r--r--progs/tests/arbnpot.c2
-rw-r--r--progs/tests/arbvptest1.c3
-rw-r--r--progs/tests/arbvptest3.c3
-rw-r--r--progs/tests/arbvptorus.c3
-rw-r--r--progs/tests/arbvpwarpmesh.c3
-rw-r--r--progs/tests/arraytexture.c2
-rw-r--r--progs/tests/blendminmax.c2
-rw-r--r--progs/tests/blendsquare.c2
-rw-r--r--progs/tests/blendxor.c3
-rw-r--r--progs/tests/bufferobj.c3
-rw-r--r--progs/tests/bug_3050.c2
-rw-r--r--progs/tests/bug_3101.c2
-rw-r--r--progs/tests/bug_3195.c2
-rw-r--r--progs/tests/bug_texstore_i8.c2
-rw-r--r--progs/tests/calibrate_rast.c2
-rw-r--r--progs/tests/copypixrate.c3
-rw-r--r--progs/tests/crossbar.c2
-rw-r--r--progs/tests/cva.c2
-rw-r--r--progs/tests/debugger.c6
-rw-r--r--progs/tests/dinoshade.c2
-rw-r--r--progs/tests/drawbuffers.c3
-rw-r--r--progs/tests/exactrast.c20
-rw-r--r--progs/tests/ext422square.c3
-rw-r--r--progs/tests/fbotest1.c3
-rw-r--r--progs/tests/fbotest2.c3
-rw-r--r--progs/tests/fbotexture.c3
-rw-r--r--progs/tests/fillrate.c3
-rw-r--r--progs/tests/floattex.c2
-rw-r--r--progs/tests/fog.c3
-rw-r--r--progs/tests/fogcoord.c3
-rw-r--r--progs/tests/fptest1.c3
-rw-r--r--progs/tests/fptexture.c3
-rw-r--r--progs/tests/interleave.c2
-rw-r--r--progs/tests/invert.c2
-rw-r--r--progs/tests/lineclip.c2
-rw-r--r--progs/tests/manytex.c2
-rw-r--r--progs/tests/mapbufrange.c3
-rw-r--r--progs/tests/mapvbo.c3
-rw-r--r--progs/tests/minmag.c2
-rw-r--r--progs/tests/mipmap_limits.c2
-rw-r--r--progs/tests/mipmap_view.c2
-rw-r--r--progs/tests/multipal.c2
-rw-r--r--progs/tests/multitexarray.c2
-rw-r--r--progs/tests/multiwindow.c3
-rw-r--r--progs/tests/no_s3tc.c2
-rw-r--r--progs/tests/packedpixels.c2
-rw-r--r--progs/tests/pbo.c3
-rw-r--r--progs/tests/prog_parameter.c2
-rw-r--r--progs/tests/projtex.c2
-rw-r--r--progs/tests/quads.c9
-rw-r--r--progs/tests/random.c3
-rw-r--r--progs/tests/readrate.c3
-rw-r--r--progs/tests/rubberband.c3
-rw-r--r--progs/tests/seccolor.c3
-rw-r--r--progs/tests/shader_api.c3
-rw-r--r--progs/tests/stencil_twoside.c2
-rw-r--r--progs/tests/stencil_wrap.c2
-rw-r--r--progs/tests/stencilwrap.c2
-rw-r--r--progs/tests/subtex.c2
-rw-r--r--progs/tests/subtexrate.c3
-rw-r--r--progs/tests/tex1d.c2
-rw-r--r--progs/tests/texcmp.c3
-rw-r--r--progs/tests/texcompress2.c3
-rw-r--r--progs/tests/texfilt.c14
-rw-r--r--progs/tests/texgenmix.c2
-rw-r--r--progs/tests/texline.c2
-rw-r--r--progs/tests/texrect.c3
-rw-r--r--progs/tests/texwrap.c3
-rw-r--r--progs/tests/unfilledclip.c2
-rw-r--r--progs/tests/vao-01.c2
-rw-r--r--progs/tests/vao-02.c2
-rw-r--r--progs/tests/vparray.c3
-rw-r--r--progs/tests/vpeval.c3
-rw-r--r--progs/tests/vptest1.c3
-rw-r--r--progs/tests/vptest2.c3
-rw-r--r--progs/tests/vptest3.c3
-rw-r--r--progs/tests/vptorus.c3
-rw-r--r--progs/tests/vpwarpmesh.c3
-rw-r--r--progs/tests/yuvrect.c3
-rw-r--r--progs/tests/yuvsquare.c3
-rw-r--r--progs/tests/zcomp.c3
-rw-r--r--progs/tests/zdrawpix.c3
-rw-r--r--progs/tests/zreaddraw.c3
93 files changed, 344 insertions, 78 deletions
diff --git a/progs/SConscript b/progs/SConscript
index 1670f97bc7..71db2831d6 100644
--- a/progs/SConscript
+++ b/progs/SConscript
@@ -3,6 +3,7 @@ SConscript([
'demos/SConscript',
'redbook/SConscript',
'samples/SConscript',
+ 'tests/SConscript',
'trivial/SConscript',
'vp/SConscript',
'vpglsl/SConscript',
diff --git a/progs/tests/SConscript b/progs/tests/SConscript
new file mode 100644
index 0000000000..f01525d6fa
--- /dev/null
+++ b/progs/tests/SConscript
@@ -0,0 +1,133 @@
+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'])
+
+linux_progs = [
+ 'api_speed',
+]
+
+glx_progs = [
+ 'auxbuffer',
+ 'getprocaddress',
+ 'jkrahntest',
+ 'sharedtex',
+ 'texcompress2',
+ 'texobjshare',
+]
+
+mesa_progs = [
+ 'debugger',
+]
+
+progs = [
+ 'afsmultiarb',
+ 'antialias',
+ 'arbfpspec',
+ 'arbfptest1',
+ 'arbfptexture',
+ 'arbfptrig',
+ 'arbnpot-mipmap',
+ 'arbnpot',
+ 'arbvptest1',
+ 'arbvptest3',
+ 'arbvptorus',
+ 'arbvpwarpmesh',
+ 'arraytexture',
+ 'blendminmax',
+ 'blendsquare',
+ 'blendxor',
+ 'bufferobj',
+ 'bug_3050',
+ 'bug_3101',
+ 'bug_3195',
+ 'bug_texstore_i8',
+ 'calibrate_rast',
+ 'copypixrate',
+ 'crossbar',
+ 'cva',
+ 'dinoshade',
+ 'drawbuffers',
+ 'exactrast',
+ 'ext422square',
+ 'fbotest1',
+ 'fbotest2',
+ 'fbotexture',
+ 'fillrate',
+ 'floattex',
+ 'fog',
+ 'fogcoord',
+ 'fptest1',
+ 'fptexture',
+ 'interleave',
+ 'invert',
+ 'lineclip',
+ 'manytex',
+ 'mapbufrange',
+ 'mapvbo',
+ 'minmag',
+ 'mipmap_limits',
+ 'mipmap_view',
+ 'multipal',
+ 'multitexarray',
+ 'multiwindow',
+ 'no_s3tc',
+ 'packedpixels',
+ 'pbo',
+ 'prog_parameter',
+ 'projtex',
+ 'quads',
+ 'random',
+ 'readrate',
+ 'rubberband',
+ 'seccolor',
+ 'shader_api',
+ 'stencil_twoside',
+ 'stencil_wrap',
+ 'stencilwrap',
+ 'subtex',
+ 'subtexrate',
+ 'tex1d',
+ 'texcmp',
+ 'texfilt',
+ 'texgenmix',
+ 'texline',
+ 'texrect',
+ 'texwrap',
+ 'unfilledclip',
+ 'vao-01',
+ 'vao-02',
+ 'vparray',
+ 'vpeval',
+ 'vptest1',
+ 'vptest2',
+ 'vptest3',
+ 'vptorus',
+ 'vpwarpmesh',
+ 'yuvrect',
+ 'yuvsquare',
+ 'zcomp',
+ 'zdrawpix',
+ 'zreaddraw',
+]
+
+for prog in progs:
+ env.Program(
+ target = prog,
+ source = prog + '.c',
+ )
diff --git a/progs/tests/afsmultiarb.c b/progs/tests/afsmultiarb.c
index c026ecd4ce..162ab19493 100644
--- a/progs/tests/afsmultiarb.c
+++ b/progs/tests/afsmultiarb.c
@@ -11,7 +11,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
#include "readtex.h"
@@ -442,6 +442,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 300, 300 );
glutInitWindowPosition( 0, 0 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
+ glewInit();
glutCreateWindow(argv[0] );
Init( argc, argv );
diff --git a/progs/tests/antialias.c b/progs/tests/antialias.c
index f23b5aff32..656bf2471f 100644
--- a/progs/tests/antialias.c
+++ b/progs/tests/antialias.c
@@ -9,6 +9,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/glut.h>
@@ -29,7 +30,7 @@ PrintString(const char *s)
static void
-Polygon( GLint verts, GLfloat radius, GLfloat z )
+doPolygon( GLint verts, GLfloat radius, GLfloat z )
{
int i;
for (i = 0; i < verts; i++) {
@@ -47,33 +48,33 @@ DrawObject( void )
glLineWidth(3.0);
glColor3f(1, 1, 1);
glBegin(GL_LINE_LOOP);
- Polygon(12, 1.2, 0);
+ doPolygon(12, 1.2, 0);
glEnd();
glLineWidth(1.0);
glColor3f(1, 1, 1);
glBegin(GL_LINE_LOOP);
- Polygon(12, 1.1, 0);
+ doPolygon(12, 1.1, 0);
glEnd();
glColor3f(1, 0, 0);
glBegin(GL_POLYGON);
- Polygon(12, 0.4, 0.3);
+ doPolygon(12, 0.4, 0.3);
glEnd();
glColor3f(0, 1, 0);
glBegin(GL_POLYGON);
- Polygon(12, 0.6, 0.2);
+ doPolygon(12, 0.6, 0.2);
glEnd();
glColor3f(0, 0, 1);
glBegin(GL_POLYGON);
- Polygon(12, 0.8, 0.1);
+ doPolygon(12, 0.8, 0.1);
glEnd();
glColor3f(1, 1, 1);
glBegin(GL_POLYGON);
- Polygon(12, 1.0, 0);
+ doPolygon(12, 1.0, 0);
glEnd();
}
@@ -225,6 +226,7 @@ main( int argc, char *argv[] )
glutInitDisplayMode( GLUT_RGB | GLUT_ALPHA | GLUT_DOUBLE |
GLUT_DEPTH | GLUT_MULTISAMPLE );
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/tests/api_speed.c b/progs/tests/api_speed.c
index aed65b35fe..28e28e61d8 100644
--- a/progs/tests/api_speed.c
+++ b/progs/tests/api_speed.c
@@ -37,9 +37,7 @@
#include <stdio.h>
#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/gl.h>
-#include <GL/glext.h>
+#include <GL/glew.h>
#include <GL/glut.h>
#define inline __inline__
@@ -127,6 +125,7 @@ int main( int argc, char *argv[] )
glutInitDisplayMode( GLUT_RGB );
glutCreateWindow( argv[0] );
+ glewInit();
if ( argc > 1 ) {
count = strtoul( argv[1], NULL, 0 );
diff --git a/progs/tests/arbfpspec.c b/progs/tests/arbfpspec.c
index eac2a9100f..550e954340 100644
--- a/progs/tests/arbfpspec.c
+++ b/progs/tests/arbfpspec.c
@@ -8,7 +8,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
static float Xrot = 0.0, Yrot = 0.0, Zrot = 0.0;
@@ -180,6 +180,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );
diff --git a/progs/tests/arbfptest1.c b/progs/tests/arbfptest1.c
index 7949f87edd..e7237b76a8 100644
--- a/progs/tests/arbfptest1.c
+++ b/progs/tests/arbfptest1.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>
@@ -201,6 +201,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/tests/arbfptexture.c b/progs/tests/arbfptexture.c
index a854908c31..f66b060cbb 100644
--- a/progs/tests/arbfptexture.c
+++ b/progs/tests/arbfptexture.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>
#include "readtex.c"
@@ -143,6 +143,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );
diff --git a/progs/tests/arbfptrig.c b/progs/tests/arbfptrig.c
index 26b68c6b41..95f008a078 100644
--- a/progs/tests/arbfptrig.c
+++ b/progs/tests/arbfptrig.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>
#include "readtex.c"
@@ -146,6 +146,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );
diff --git a/progs/tests/arbnpot-mipmap.c b/progs/tests/arbnpot-mipmap.c
index 4ed84e7ace..700ec0b09d 100644
--- a/progs/tests/arbnpot-mipmap.c
+++ b/progs/tests/arbnpot-mipmap.c
@@ -46,6 +46,7 @@
*/
#include <stdlib.h>
#include <stdio.h>
+#include <GL/glew.h>
#include <GL/glut.h>
GLubyte mipmapImage32[40][46][3];
@@ -175,6 +176,7 @@ int main(int argc, char** argv)
glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB | GLUT_DEPTH);
glutInitWindowSize (500, 500);
glutCreateWindow (argv[0]);
+ glewInit();
myinit();
glutReshapeFunc (myReshape);
glutDisplayFunc(display);
diff --git a/progs/tests/arbnpot.c b/progs/tests/arbnpot.c
index 05ba85dad9..c51a541641 100644
--- a/progs/tests/arbnpot.c
+++ b/progs/tests/arbnpot.c
@@ -8,6 +8,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/glut.h>
#include "../util/readtex.c"
@@ -188,6 +189,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 400, 400 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/tests/arbvptest1.c b/progs/tests/arbvptest1.c
index 0ebd3987f5..3a6d71a42b 100644
--- a/progs/tests/arbvptest1.c
+++ b/progs/tests/arbvptest1.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 Display( void )
@@ -155,6 +155,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/tests/arbvptest3.c b/progs/tests/arbvptest3.c
index 6437062900..56de7b4696 100644
--- a/progs/tests/arbvptest3.c
+++ b/progs/tests/arbvptest3.c
@@ -4,7 +4,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
static float Zrot = 0.0;
@@ -118,6 +118,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/tests/arbvptorus.c b/progs/tests/arbvptorus.c
index 9d19ef90da..f1f84d8774 100644
--- a/progs/tests/arbvptorus.c
+++ b/progs/tests/arbvptorus.c
@@ -7,7 +7,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
static float Xrot = 0.0, Yrot = 0.0, Zrot = 0.0;
@@ -174,6 +174,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );
diff --git a/progs/tests/arbvpwarpmesh.c b/progs/tests/arbvpwarpmesh.c
index 3dfe94f759..973a157409 100644
--- a/progs/tests/arbvpwarpmesh.c
+++ b/progs/tests/arbvpwarpmesh.c
@@ -7,7 +7,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
static float Xrot = -60.0, Yrot = 0.0, Zrot = 0.0;
@@ -234,6 +234,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );
diff --git a/progs/tests/arraytexture.c b/progs/tests/arraytexture.c
index 48c622be30..6c0484df0d 100644
--- a/progs/tests/arraytexture.c
+++ b/progs/tests/arraytexture.c
@@ -34,6 +34,7 @@
#include <stdio.h>
#include <string.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/glut.h>
#include <GL/glext.h>
@@ -326,6 +327,7 @@ int main(int argc, char *argv[])
glutInitWindowSize(350, 350);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
glutCreateWindow("Array texture test");
+ glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
diff --git a/progs/tests/blendminmax.c b/progs/tests/blendminmax.c
index 2aab1a39d2..7297f41b78 100644
--- a/progs/tests/blendminmax.c
+++ b/progs/tests/blendminmax.c
@@ -34,6 +34,7 @@
#include <stdio.h>
#include <stdlib.h>
+#include <GL/glew.h>
#include <GL/glut.h>
static int Width = 400;
@@ -200,6 +201,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( Width, Height );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow( "GL_EXT_blend_minmax test" );
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/tests/blendsquare.c b/progs/tests/blendsquare.c
index 1694866a55..3ee3ae2230 100644
--- a/progs/tests/blendsquare.c
+++ b/progs/tests/blendsquare.c
@@ -34,6 +34,7 @@
#include <stdio.h>
#include <stdlib.h>
+#include <GL/glew.h>
#include <GL/glut.h>
static int Width = 400;
@@ -169,6 +170,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( Width, Height );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow( "GL_NV_blend_square test" );
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/tests/blendxor.c b/progs/tests/blendxor.c
index 8961a827ea..d6dcb8b848 100644
--- a/progs/tests/blendxor.c
+++ b/progs/tests/blendxor.c
@@ -3,10 +3,10 @@
*
*/
-#define GL_GLEXT_PROTOTYPES
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/glut.h>
#include "readtex.c"
@@ -183,6 +183,7 @@ main(int argc, char *argv[])
glutInitWindowSize(Width, Height);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
Win = glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
diff --git a/progs/tests/bufferobj.c b/progs/tests/bufferobj.c
index 9edb86e575..1d97b060ef 100644
--- a/progs/tests/bufferobj.c
+++ b/progs/tests/bufferobj.c
@@ -6,11 +6,11 @@
*/
-#define GL_GLEXT_PROTOTYPES
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/glut.h>
#define NUM_OBJECTS 10
@@ -428,6 +428,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 600, 300 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
Win = glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );
diff --git a/progs/tests/bug_3050.c b/progs/tests/bug_3050.c
index 4ea7b80f23..a04e40eaf6 100644
--- a/progs/tests/bug_3050.c
+++ b/progs/tests/bug_3050.c
@@ -39,6 +39,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <GL/glew.h>
#include <GL/glut.h>
static int Width = 400;
@@ -154,6 +155,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( Width, Height );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow( "Bug #3050 Test" );
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/tests/bug_3101.c b/progs/tests/bug_3101.c
index 761dcbb951..06a9776155 100644
--- a/progs/tests/bug_3101.c
+++ b/progs/tests/bug_3101.c
@@ -34,6 +34,7 @@
#include <stdio.h>
#include <stdlib.h>
+#include <GL/glew.h>
#include <GL/glut.h>
static int Width = 400;
@@ -119,6 +120,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( Width, Height );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow( "Bug #3101 Test" );
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/tests/bug_3195.c b/progs/tests/bug_3195.c
index 4aceae04ab..a075b94e37 100644
--- a/progs/tests/bug_3195.c
+++ b/progs/tests/bug_3195.c
@@ -36,6 +36,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/glut.h>
#include <GL/glext.h>
@@ -264,6 +265,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 350, 350 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow( "Bug #3195 Test" );
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );
diff --git a/progs/tests/bug_texstore_i8.c b/progs/tests/bug_texstore_i8.c
index f8dac210f7..10e5eba7c5 100644
--- a/progs/tests/bug_texstore_i8.c
+++ b/progs/tests/bug_texstore_i8.c
@@ -29,6 +29,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
+#include <GL/glew.h>
#include <GL/glut.h>
static GLenum Target = GL_TEXTURE_2D;
@@ -180,6 +181,7 @@ int main(int argc, char **argv)
glutInitDisplayMode(type);
win = glutCreateWindow("Tex test");
+ glewInit();
if (!win) {
exit(1);
}
diff --git a/progs/tests/calibrate_rast.c b/progs/tests/calibrate_rast.c
index 37d8ac85e5..5d89ff79c5 100644
--- a/progs/tests/calibrate_rast.c
+++ b/progs/tests/calibrate_rast.c
@@ -19,6 +19,7 @@
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
+#include <GL/glew.h>
#include <GL/glut.h>
@@ -386,6 +387,7 @@ main(int argc, char *argv[])
glutInitWindowSize(Width, Height);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
Win = glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Draw);
diff --git a/progs/tests/copypixrate.c b/progs/tests/copypixrate.c
index 142315364c..aa4acfc18b 100644
--- a/progs/tests/copypixrate.c
+++ b/progs/tests/copypixrate.c
@@ -5,11 +5,11 @@
* 26 Jan 2006
*/
-#define GL_GLEXT_PROTOTYPES
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/glut.h>
static GLint WinWidth = 1000, WinHeight = 800;
@@ -260,6 +260,7 @@ main(int argc, char *argv[])
glutInitWindowSize(WinWidth, WinHeight);
glutInitDisplayMode(mode);
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
diff --git a/progs/tests/crossbar.c b/progs/tests/crossbar.c
index 12aabb1c9a..3dd21372f9 100644
--- a/progs/tests/crossbar.c
+++ b/progs/tests/crossbar.c
@@ -35,6 +35,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <GL/glew.h>
#include <GL/glut.h>
static const GLint tests[][8] = {
@@ -226,6 +227,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( Width, Height );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow( "GL_ARB_texture_env_crossbar test" );
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/tests/cva.c b/progs/tests/cva.c
index a9393aef0c..80483900cb 100644
--- a/progs/tests/cva.c
+++ b/progs/tests/cva.c
@@ -15,6 +15,7 @@
#include <windows.h>
#endif
#define GL_GLEXT_LEGACY
+#include <GL/glew.h>
#include <GL/glut.h>
#include <GL/glext.h>
@@ -129,6 +130,7 @@ int main( int argc, char **argv )
glutInitWindowSize( 250, 250 );
glutInitWindowPosition( 100, 100 );
glutCreateWindow( "CVA Test" );
+ glewInit();
/* Make sure the server supports GL 1.2 vertex arrays.
*/
diff --git a/progs/tests/debugger.c b/progs/tests/debugger.c
index 4c6955bcfc..1c2f9bebca 100644
--- a/progs/tests/debugger.c
+++ b/progs/tests/debugger.c
@@ -9,7 +9,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
@@ -81,6 +81,7 @@ find_line_column(const GLubyte *string, const GLubyte *pos,
#define NV_FRAGMENT_PROGRAM 4
+
struct breakpoint {
enum {PIXEL, LINE} type;
int x, y;
@@ -101,7 +102,7 @@ static void Debugger2(GLenum target, GLvoid *data)
{
static GLuint skipCount = 0;
const GLubyte *ln;
- GLint pos, line, column;
+ GLint pos = 0, line, column;
GLint id;
int progType;
GLint len;
@@ -721,6 +722,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 200, 200 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );
diff --git a/progs/tests/dinoshade.c b/progs/tests/dinoshade.c
index 44115b9209..fb7c3f4535 100644
--- a/progs/tests/dinoshade.c
+++ b/progs/tests/dinoshade.c
@@ -43,6 +43,7 @@
#include <windows.h>
#endif
#define GL_GLEXT_LEGACY
+#include <GL/glew.h> /* OpenGL Utility Toolkit header */
#include <GL/glut.h> /* OpenGL Utility Toolkit header */
/* Some <math.h> files do not define M_PI... */
@@ -823,6 +824,7 @@ main(int argc, char **argv)
#endif
glutCreateWindow("Shadowy Leapin' Lizards");
+ glewInit();
if (glutGet(GLUT_WINDOW_STENCIL_SIZE) <= 1) {
printf("dinoshade: Sorry, I need at least 2 bits of stencil.\n");
diff --git a/progs/tests/drawbuffers.c b/progs/tests/drawbuffers.c
index 5e89569380..d75a870c26 100644
--- a/progs/tests/drawbuffers.c
+++ b/progs/tests/drawbuffers.c
@@ -7,11 +7,11 @@
*/
-#define GL_GLEXT_PROTOTYPES
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/glut.h>
#include "extfuncs.h"
@@ -294,6 +294,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/tests/exactrast.c b/progs/tests/exactrast.c
index 56c0c79c3f..63b8336d97 100644
--- a/progs/tests/exactrast.c
+++ b/progs/tests/exactrast.c
@@ -26,6 +26,7 @@
#include <stdio.h>
#include <stdlib.h>
+#include <GL/glew.h>
#include <GL/glut.h>
static int Width = 400, Height = 400;
@@ -34,14 +35,14 @@ static float Xtrans = 0, Ytrans = 0;
static float Step = 0.125;
enum {
- POINTS,
- HLINES,
- VLINES,
- QUADS,
+ MODE_POINTS,
+ MODE_HLINES,
+ MODE_VLINES,
+ MODE_QUADS,
NUM_MODES
};
-static int Mode = POINTS;
+static int Mode = MODE_POINTS;
static void
@@ -58,7 +59,7 @@ Draw(void)
glPushMatrix();
glTranslatef(tx + Xtrans, ty + Ytrans, 0);
- if (Mode == POINTS) {
+ if (Mode == MODE_POINTS) {
glBegin(GL_POINTS);
for (j = 0; j < Height; j += 2) {
for (i = 0; i < Width; i += 2) {
@@ -67,7 +68,7 @@ Draw(void)
}
glEnd();
}
- else if (Mode == HLINES) {
+ else if (Mode == MODE_HLINES) {
glBegin(GL_LINES);
for (i = 0; i < Height; i += 2) {
glVertex2f(0, i);
@@ -75,7 +76,7 @@ Draw(void)
}
glEnd();
}
- else if (Mode == VLINES) {
+ else if (Mode == MODE_VLINES) {
glBegin(GL_LINES);
for (i = 0; i < Width; i += 2) {
glVertex2f(i, 0 );
@@ -83,7 +84,7 @@ Draw(void)
}
glEnd();
}
- else if (Mode == QUADS) {
+ else if (Mode == MODE_QUADS) {
glBegin(GL_QUADS);
for (j = 0; j < Height; j += 4) {
for (i = 0; i < Width; i += 4) {
@@ -189,6 +190,7 @@ main(int argc, char *argv[])
glutInitWindowSize(Width, Height);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
Win = glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
diff --git a/progs/tests/ext422square.c b/progs/tests/ext422square.c
index 6533514d69..89e99f0292 100644
--- a/progs/tests/ext422square.c
+++ b/progs/tests/ext422square.c
@@ -12,7 +12,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
#include <assert.h>
@@ -249,6 +249,7 @@ int main( int argc, char *argv[] )
glutInitWindowPosition( 0, 0 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow(argv[0] );
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );
diff --git a/progs/tests/fbotest1.c b/progs/tests/fbotest1.c
index ab2757c3c3..8dac21494e 100644
--- a/progs/tests/fbotest1.c
+++ b/progs/tests/fbotest1.c
@@ -6,11 +6,11 @@
*/
-#define GL_GLEXT_PROTOTYPES
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/glut.h>
static int Win;
@@ -202,6 +202,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/tests/fbotest2.c b/progs/tests/fbotest2.c
index 5283c7e1fd..f9c506193f 100644
--- a/progs/tests/fbotest2.c
+++ b/progs/tests/fbotest2.c
@@ -6,11 +6,11 @@
*/
-#define GL_GLEXT_PROTOTYPES
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/glut.h>
static int Win = 0;
@@ -191,6 +191,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/tests/fbotexture.c b/progs/tests/fbotexture.c
index ae993576b0..bc6c7278ed 100644
--- a/progs/tests/fbotexture.c
+++ b/progs/tests/fbotexture.c
@@ -9,7 +9,7 @@
*/
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
#include <assert.h>
#include <stdio.h>
@@ -605,6 +605,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/tests/fillrate.c b/progs/tests/fillrate.c
index 8fe636c364..1e58df281e 100644
--- a/progs/tests/fillrate.c
+++ b/progs/tests/fillrate.c
@@ -6,10 +6,10 @@
*/
-#define GL_GLEXT_PROTOTYPES
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/glut.h>
#include "readtex.h"
@@ -194,6 +194,7 @@ main(int argc, char *argv[])
glutInitWindowSize(Width, Height);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
Win = glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Draw);
diff --git a/progs/tests/floattex.c b/progs/tests/floattex.c
index dd6d882089..dd99d836c6 100644
--- a/progs/tests/floattex.c
+++ b/progs/tests/floattex.c
@@ -8,6 +8,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/glut.h>
#include "extfuncs.h"
#include "readtex.h"
@@ -230,6 +231,7 @@ main(int argc, char *argv[])
glutInitWindowSize(400, 400);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Draw);
diff --git a/progs/tests/fog.c b/progs/tests/fog.c
index ecd9f533f9..b6cea8c080 100644
--- a/progs/tests/fog.c
+++ b/progs/tests/fog.c
@@ -30,10 +30,10 @@
* Test to exercise fog modes and for comparison with GL_EXT_fog_coord.
*/
-#define GL_GLEXT_PROTOTYPES
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/glut.h>
static int Width = 600;
@@ -190,6 +190,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( Width, Height );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/tests/fogcoord.c b/progs/tests/fogcoord.c
index 89355742aa..7822d33b09 100644
--- a/progs/tests/fogcoord.c
+++ b/progs/tests/fogcoord.c
@@ -3,10 +3,10 @@
*/
-#define GL_GLEXT_PROTOTYPES
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/glut.h>
static int Width = 600;
@@ -93,6 +93,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( Width, Height );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/tests/fptest1.c b/progs/tests/fptest1.c
index 095190a8ae..2b8f8d0f5e 100644
--- a/progs/tests/fptest1.c
+++ b/progs/tests/fptest1.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>
@@ -216,6 +216,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/tests/fptexture.c b/progs/tests/fptexture.c
index f57ad62828..332e07182d 100644
--- a/progs/tests/fptexture.c
+++ b/progs/tests/fptexture.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>
#include "../util/readtex.c"
@@ -141,6 +141,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );
diff --git a/progs/tests/interleave.c b/progs/tests/interleave.c
index e98b3ed046..47bf9dfbe5 100644
--- a/progs/tests/interleave.c
+++ b/progs/tests/interleave.c
@@ -36,6 +36,7 @@
#include <stdlib.h>
#include <string.h>
#include <time.h>
+#include <GL/glew.h>
#include <GL/glut.h>
static int Width = 400;
@@ -386,6 +387,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( Width, Height );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow( "glInterleavedArrays test" );
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/tests/invert.c b/progs/tests/invert.c
index 750592ed79..63099fbd22 100644
--- a/progs/tests/invert.c
+++ b/progs/tests/invert.c
@@ -35,6 +35,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <GL/glew.h>
#include <GL/glut.h>
#include "readtex.h"
@@ -186,6 +187,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( Width, Height );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow( "GL_MESA_pack_invert test" );
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/tests/lineclip.c b/progs/tests/lineclip.c
index 098f5e92eb..bb688c04a5 100644
--- a/progs/tests/lineclip.c
+++ b/progs/tests/lineclip.c
@@ -26,6 +26,7 @@
*/
#include <stdlib.h>
+#include <GL/glew.h>
#include <GL/glut.h>
static int win_width, win_height;
@@ -164,6 +165,7 @@ main(int argc, char *argv[])
glutInitWindowSize(win_width, win_height);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc(reshape);
glutKeyboardFunc(key);
glutDisplayFunc(display);
diff --git a/progs/tests/manytex.c b/progs/tests/manytex.c
index 83c8676657..52e7e1de44 100644
--- a/progs/tests/manytex.c
+++ b/progs/tests/manytex.c
@@ -13,6 +13,7 @@
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/glut.h>
@@ -336,6 +337,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( WinWidth, WinHeight );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
Win = glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/tests/mapbufrange.c b/progs/tests/mapbufrange.c
index 04d57b58f1..0021bb2607 100644
--- a/progs/tests/mapbufrange.c
+++ b/progs/tests/mapbufrange.c
@@ -9,13 +9,13 @@
*/
-#define GL_GLEXT_PROTOTYPES
#include <assert.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <GL/glew.h>
+#include <GL/glew.h>
#include <GL/glut.h>
static GLuint Win;
@@ -194,6 +194,7 @@ main(int argc, char *argv[])
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
Win = glutCreateWindow(argv[0]);
glewInit();
+ glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Display);
diff --git a/progs/tests/mapvbo.c b/progs/tests/mapvbo.c
index 49e120de73..c392e76835 100644
--- a/progs/tests/mapvbo.c
+++ b/progs/tests/mapvbo.c
@@ -10,9 +10,9 @@
*/
-#define GL_GLEXT_PROTOTYPES
#include <stdio.h>
#include <stdlib.h>
+#include <GL/glew.h>
#include <GL/glut.h>
static GLuint BufferID;
@@ -129,6 +129,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 300, 300 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
Win = glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/tests/minmag.c b/progs/tests/minmag.c
index 78ef9db03a..03019f94fa 100644
--- a/progs/tests/minmag.c
+++ b/progs/tests/minmag.c
@@ -17,6 +17,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <GL/glew.h>
#include <GL/glut.h>
@@ -189,6 +190,7 @@ main(int argc, char *argv[])
glutInitWindowSize(Width, Height);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(redraw);
diff --git a/progs/tests/mipmap_limits.c b/progs/tests/mipmap_limits.c
index 8bdad826f7..7f0390b07d 100644
--- a/progs/tests/mipmap_limits.c
+++ b/progs/tests/mipmap_limits.c
@@ -51,6 +51,7 @@
*/
#include <stdlib.h>
#include <stdio.h>
+#include <GL/glew.h>
#include <GL/glut.h>
static GLint BaseLevel = 0, MaxLevel = 8;
@@ -260,6 +261,7 @@ int main(int argc, char** argv)
glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB | GLUT_DEPTH);
glutInitWindowSize (600, 600);
glutCreateWindow (argv[0]);
+ glewInit();
myinit();
glutReshapeFunc (myReshape);
glutDisplayFunc(display);
diff --git a/progs/tests/mipmap_view.c b/progs/tests/mipmap_view.c
index 54607b8939..16f3584f70 100644
--- a/progs/tests/mipmap_view.c
+++ b/progs/tests/mipmap_view.c
@@ -10,6 +10,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/glut.h>
#include <GL/glext.h>
@@ -242,6 +243,7 @@ main(int argc, char *argv[])
glutInitWindowSize(WinWidth, WinHeight);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
Win = glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Display);
diff --git a/progs/tests/multipal.c b/progs/tests/multipal.c
index 7bd4473565..4a94016978 100644
--- a/progs/tests/multipal.c
+++ b/progs/tests/multipal.c
@@ -13,6 +13,7 @@
#include <windows.h>
#endif
#define GL_GLEXT_LEGACY
+#include <GL/glew.h>
#include <GL/glut.h>
#include "../util/readtex.c" /* I know, this is a hack. */
@@ -350,6 +351,7 @@ int main( int argc, char *argv[] )
glutInitWindowPosition( 0, 0 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow(argv[0] );
+ glewInit();
Init( argc, argv );
diff --git a/progs/tests/multitexarray.c b/progs/tests/multitexarray.c
index b4fab004a6..518fee2992 100644
--- a/progs/tests/multitexarray.c
+++ b/progs/tests/multitexarray.c
@@ -16,6 +16,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
+#include "GL/glew.h"
#include "GL/glut.h"
static GLuint Window = 0;
@@ -221,6 +222,7 @@ int main( int argc, char *argv[] )
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
Window = glutCreateWindow("Texture Objects");
+ glewInit();
if (!Window) {
exit(1);
}
diff --git a/progs/tests/multiwindow.c b/progs/tests/multiwindow.c
index b069bea91c..6db552d195 100644
--- a/progs/tests/multiwindow.c
+++ b/progs/tests/multiwindow.c
@@ -25,6 +25,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/glut.h>
@@ -145,6 +146,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 400, 400 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
Window[0] = glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display0 );
@@ -155,6 +157,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 400, 400 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
Window[1] = glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display1 );
diff --git a/progs/tests/no_s3tc.c b/progs/tests/no_s3tc.c
index d3383ff98a..31cfb40b9d 100644
--- a/progs/tests/no_s3tc.c
+++ b/progs/tests/no_s3tc.c
@@ -38,6 +38,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
+#include <GL/glew.h>
#include <GL/glut.h>
#include <GL/glext.h>
@@ -59,6 +60,7 @@ main( int argc, char ** argv )
glutInitWindowPosition( 0, 0 );
glutInitWindowSize( 300, 300 );
glutCreateWindow( "No S3TC Test" );
+ glewInit();
gl_version = strtod( (const char *) glGetString( GL_VERSION ), NULL );
if ( ! glutExtensionSupported( "GL_ARB_texture_compression" )
diff --git a/progs/tests/packedpixels.c b/progs/tests/packedpixels.c
index 67ffe08825..1703b271cb 100644
--- a/progs/tests/packedpixels.c
+++ b/progs/tests/packedpixels.c
@@ -8,6 +8,7 @@
#include <stdlib.h>
#include <math.h>
#include <string.h>
+#include <GL/glew.h>
#include <GL/glut.h>
@@ -333,6 +334,7 @@ main(int argc, char *argv[])
glutInitWindowSize(700, 800);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Draw);
diff --git a/progs/tests/pbo.c b/progs/tests/pbo.c
index b31b36cc12..9974486db3 100644
--- a/progs/tests/pbo.c
+++ b/progs/tests/pbo.c
@@ -5,12 +5,12 @@
* 11 March 2004
*/
-#define GL_GLEXT_PROTOTYPES
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/glut.h>
#include "../util/readtex.c" /* a hack, I know */
@@ -287,6 +287,7 @@ main( int argc, char *argv[] )
glutInitWindowSize( 750, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow(argv[0]);
+ glewInit();
Init();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
diff --git a/progs/tests/prog_parameter.c b/progs/tests/prog_parameter.c
index 96697e5bda..6dd956c402 100644
--- a/progs/tests/prog_parameter.c
+++ b/progs/tests/prog_parameter.c
@@ -35,6 +35,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/glut.h>
#ifndef GL_EXT_gpu_program_parameters
@@ -274,6 +275,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( Width, Height );
glutInitDisplayMode( GLUT_RGB );
glutCreateWindow( "Program Parameters Test" );
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/tests/projtex.c b/progs/tests/projtex.c
index e3ef948ab6..800d81ecd6 100644
--- a/progs/tests/projtex.c
+++ b/progs/tests/projtex.c
@@ -18,6 +18,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/glut.h>
#if 0
#include "texture.h"
@@ -1005,6 +1006,7 @@ main(int argc, char **argv)
glutInitDisplayMode(GLUT_RGBA | GLUT_DEPTH | GLUT_DOUBLE);
(void) glutCreateWindow("projtex");
+ glewInit();
loadTexture = loadImageTextures;
drawObject = drawCube;
diff --git a/progs/tests/quads.c b/progs/tests/quads.c
index 1bf57e6337..2098b51ccd 100644
--- a/progs/tests/quads.c
+++ b/progs/tests/quads.c
@@ -3,10 +3,10 @@
*/
-#define GL_GLEXT_PROTOTYPES
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/glut.h>
#define NUM_QUADS 20
@@ -19,7 +19,7 @@ static GLuint Vbuffer = 0;
static GLfloat buf[NUM_QUADS * 6 * 4];
-static GLboolean SwapBuffers = GL_TRUE;
+static GLboolean doSwapBuffers = GL_TRUE;
static GLint Frames = 0, T0 = 0;
@@ -48,7 +48,7 @@ Draw(void)
glPopMatrix();
- if (SwapBuffers)
+ if (doSwapBuffers)
glutSwapBuffers();
/*
else
@@ -91,7 +91,7 @@ Key(unsigned char key, int x, int y)
(void) y;
switch (key) {
case 's':
- SwapBuffers = !SwapBuffers;
+ doSwapBuffers = !doSwapBuffers;
break;
case 'a':
Anim = !Anim;
@@ -246,6 +246,7 @@ main(int argc, char *argv[])
glutInitWindowSize(600, 600);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
Win = glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
diff --git a/progs/tests/random.c b/progs/tests/random.c
index d52c338e0e..4023674c05 100644
--- a/progs/tests/random.c
+++ b/progs/tests/random.c
@@ -5,13 +5,13 @@
* 21 June 2007
*/
-#define GL_GLEXT_PROTOTYPES
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/glut.h>
static int Win;
@@ -445,6 +445,7 @@ main(int argc, char *argv[])
glutInitWindowSize(Width, Height);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
Win = glutCreateWindow(argv[0]);
+ glewInit();
ParseArgs(argc, argv);
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
diff --git a/progs/tests/readrate.c b/progs/tests/readrate.c
index 42ae62d48a..6bdda04907 100644
--- a/progs/tests/readrate.c
+++ b/progs/tests/readrate.c
@@ -7,11 +7,11 @@
* gcc readrate.c -L/usr/X11R6/lib -lglut -lGLU -lGL -lX11 -o readrate
*/
-#define GL_GLEXT_PROTOTYPES
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/glut.h>
/* Hack, to test drawing instead of reading */
@@ -275,6 +275,7 @@ main(int argc, char *argv[])
glutInitWindowSize(MAX_WIDTH, MAX_HEIGHT);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH | GLUT_STENCIL);
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
diff --git a/progs/tests/rubberband.c b/progs/tests/rubberband.c
index a8e64bc091..866a0f519e 100644
--- a/progs/tests/rubberband.c
+++ b/progs/tests/rubberband.c
@@ -2,10 +2,10 @@
* Test rubber-band selection box w/ logicops and blend.
*/
-#define GL_GLEXT_PROTOTYPES
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/glut.h>
#include "readtex.c"
@@ -232,6 +232,7 @@ main(int argc, char *argv[])
glutInitWindowSize(Width, Height);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
Win = glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
diff --git a/progs/tests/seccolor.c b/progs/tests/seccolor.c
index 77fd40647b..f1ba314ef0 100644
--- a/progs/tests/seccolor.c
+++ b/progs/tests/seccolor.c
@@ -3,10 +3,10 @@
*/
-#define GL_GLEXT_PROTOTYPES
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/glut.h>
static int Width = 600;
@@ -136,6 +136,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( Width, Height );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/tests/shader_api.c b/progs/tests/shader_api.c
index 679f9137c8..a513ca6ba1 100644
--- a/progs/tests/shader_api.c
+++ b/progs/tests/shader_api.c
@@ -5,7 +5,7 @@
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
static void assert_test(const char *file, int line, int cond, const char *msg)
@@ -323,6 +323,7 @@ int main(int argc, char **argv)
{
glutInit(&argc, argv);
glutCreateWindow("Mesa bug demo");
+ glewInit();
RUN_TEST(test_uniform_size_type);
RUN_TEST(test_attrib_size_type);
diff --git a/progs/tests/stencil_twoside.c b/progs/tests/stencil_twoside.c
index 8826c46fc2..1e18ca6b5e 100644
--- a/progs/tests/stencil_twoside.c
+++ b/progs/tests/stencil_twoside.c
@@ -33,6 +33,7 @@
#include <stdio.h>
#include <stdlib.h>
+#include <GL/glew.h>
#include <GL/glut.h>
static int use20syntax = 1;
@@ -288,6 +289,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( Width, Height );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH | GLUT_STENCIL );
glutCreateWindow( "GL_ATI_separate_stencil test" );
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/tests/stencil_wrap.c b/progs/tests/stencil_wrap.c
index 88cf3809ca..28307fef4f 100644
--- a/progs/tests/stencil_wrap.c
+++ b/progs/tests/stencil_wrap.c
@@ -34,6 +34,7 @@
#include <stdio.h>
#include <stdlib.h>
+#include <GL/glew.h>
#include <GL/glut.h>
static int Width = 550;
@@ -248,6 +249,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( Width, Height );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH | GLUT_STENCIL );
glutCreateWindow( "GL_EXT_stencil_wrap test" );
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/tests/stencilwrap.c b/progs/tests/stencilwrap.c
index 753375d0f3..2e219fd8b5 100644
--- a/progs/tests/stencilwrap.c
+++ b/progs/tests/stencilwrap.c
@@ -8,6 +8,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/glut.h>
GLboolean wrapping;
@@ -272,6 +273,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 400, 400 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_STENCIL );
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/tests/subtex.c b/progs/tests/subtex.c
index 81ceb085aa..86b737c01f 100644
--- a/progs/tests/subtex.c
+++ b/progs/tests/subtex.c
@@ -9,6 +9,7 @@
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
+#include "GL/glew.h"
#include "GL/glut.h"
static GLuint Window = 0;
@@ -207,6 +208,7 @@ int main( int argc, char *argv[] )
glutInitDisplayMode( GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE );
Window = glutCreateWindow("Texture Objects");
+ glewInit();
if (!Window) {
exit(1);
}
diff --git a/progs/tests/subtexrate.c b/progs/tests/subtexrate.c
index 568b68d552..4bda970d06 100644
--- a/progs/tests/subtexrate.c
+++ b/progs/tests/subtexrate.c
@@ -5,11 +5,11 @@
* 26 Jan 2006
*/
-#define GL_GLEXT_PROTOTYPES
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/glut.h>
static GLint WinWidth = 1024, WinHeight = 512;
@@ -337,6 +337,7 @@ main(int argc, char *argv[])
glutInitWindowSize(WinWidth, WinHeight);
glutInitDisplayMode(mode);
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
diff --git a/progs/tests/tex1d.c b/progs/tests/tex1d.c
index 1fab849dd3..4abe1068c7 100644
--- a/progs/tests/tex1d.c
+++ b/progs/tests/tex1d.c
@@ -7,6 +7,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include "GL/glew.h"
#include "GL/glut.h"
static GLuint Window = 0;
@@ -124,6 +125,7 @@ int main( int argc, char *argv[] )
glutInitDisplayMode( GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE );
Window = glutCreateWindow("Texture Objects");
+ glewInit();
if (!Window) {
exit(1);
}
diff --git a/progs/tests/texcmp.c b/progs/tests/texcmp.c
index 6e822fb689..52c504a318 100644
--- a/progs/tests/texcmp.c
+++ b/progs/tests/texcmp.c
@@ -7,7 +7,7 @@
#include <stdlib.h>
#include <math.h>
#include <string.h>
-#define GL_GLEXT_PROTOTYPES 1
+#include <GL/glew.h>
#include <GL/glut.h>
#include "readtex.c" /* I know, this is a hack. */
@@ -371,6 +371,7 @@ int main( int argc, char *argv[] )
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
if (glutCreateWindow(argv[0]) <= 0) {
+ glewInit();
printf("Couldn't create window\n");
exit(0);
}
diff --git a/progs/tests/texcompress2.c b/progs/tests/texcompress2.c
index e2eed756b6..3e8e9908cb 100644
--- a/progs/tests/texcompress2.c
+++ b/progs/tests/texcompress2.c
@@ -3,9 +3,9 @@
*/
-#define GL_GLEXT_PROTOTYPES
#include <assert.h>
#include <stdio.h>
+#include <GL/glew.h>
#include <GL/glut.h>
#include <GL/glx.h>
#include "readtex.c"
@@ -258,6 +258,7 @@ main( int argc, char *argv[] )
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE);
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
diff --git a/progs/tests/texfilt.c b/progs/tests/texfilt.c
index 6ee4bc4eae..fa919dba62 100644
--- a/progs/tests/texfilt.c
+++ b/progs/tests/texfilt.c
@@ -27,6 +27,7 @@
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/glut.h>
const GLenum filter_modes[] = {
@@ -219,8 +220,8 @@ static void Init( void )
static void generate_tunnel( unsigned num_segs, GLfloat ** pos_data,
GLfloat ** tex_data )
{
- const GLfloat far = 20.0f;
- const GLfloat near = -90.0f;
+ const GLfloat far_distance = 20.0f;
+ const GLfloat near_distance = -90.0f;
const GLfloat far_tex = 30.0f;
const GLfloat near_tex = 0.0f;
const GLfloat angle_step = (2 * M_PI) / num_segs;
@@ -241,12 +242,12 @@ static void generate_tunnel( unsigned num_segs, GLfloat ** pos_data,
for ( i = 0 ; i < num_segs ; i++ ) {
position[0] = 2.5 * sinf( angle );
position[1] = 2.5 * cosf( angle );
- position[2] = (i & 1) ? far : near;
+ position[2] = (i & 1) ? far_distance : near_distance;
position[3] = 1.0f;
position[4] = position[0];
position[5] = position[1];
- position[6] = (i & 1) ? near : far;
+ position[6] = (i & 1) ? near_distance : far_distance;
position[7] = 1.0f;
position += 8;
@@ -264,12 +265,12 @@ static void generate_tunnel( unsigned num_segs, GLfloat ** pos_data,
position[0] = 2.5 * sinf( angle );
position[1] = 2.5 * cosf( angle );
- position[2] = (i & 1) ? near : far;
+ position[2] = (i & 1) ? near_distance : far_distance;
position[3] = 1.0f;
position[4] = position[0];
position[5] = position[1];
- position[6] = (i & 1) ? far : near;
+ position[6] = (i & 1) ? far_distance : near_distance;
position[7] = 1.0f;
position += 8;
@@ -381,6 +382,7 @@ int main( int argc, char ** argv )
glutInitWindowSize( 800, 600 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow( "Texture Filter Test" );
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );
diff --git a/progs/tests/texgenmix.c b/progs/tests/texgenmix.c
index be8f6775c7..008da8625e 100644
--- a/progs/tests/texgenmix.c
+++ b/progs/tests/texgenmix.c
@@ -6,6 +6,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <GL/glew.h>
#include <GL/glut.h>
#undef max
@@ -618,6 +619,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( winWidth, winHeight );
glutInitWindowPosition( 0, 0 );
glutCreateWindow( "Mixed texgen/non-texgen texture coordinate test" );
+ glewInit();
initialize();
instructions();
diff --git a/progs/tests/texline.c b/progs/tests/texline.c
index 76dfccd9b1..1803832b47 100644
--- a/progs/tests/texline.c
+++ b/progs/tests/texline.c
@@ -9,6 +9,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/glut.h>
#include "../util/readtex.c" /* I know, this is a hack. */
@@ -263,6 +264,7 @@ int main( int argc, char *argv[] )
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow(argv[0] );
+ glewInit();
Init(argc, argv);
diff --git a/progs/tests/texrect.c b/progs/tests/texrect.c
index 43edc49180..10061ee586 100644
--- a/progs/tests/texrect.c
+++ b/progs/tests/texrect.c
@@ -6,11 +6,11 @@
*/
-#define GL_GLEXT_PROTOTYPES
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <GL/glew.h>
#include <GL/glut.h>
#include "readtex.h"
@@ -328,6 +328,7 @@ int main( int argc, char *argv[] )
glutInitWindowPosition( 0, 0 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow(argv[0] );
+ glewInit();
Init( argc, argv );
diff --git a/progs/tests/texwrap.c b/progs/tests/texwrap.c
index 8143256f8a..12f045b72e 100644
--- a/progs/tests/texwrap.c
+++ b/progs/tests/texwrap.c
@@ -8,10 +8,10 @@
*/
-#define GL_GLEXT_PROTOTYPES
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/glut.h>
@@ -294,6 +294,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 1000, 270 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/tests/unfilledclip.c b/progs/tests/unfilledclip.c
index f25e52616a..db6fffa3e8 100644
--- a/progs/tests/unfilledclip.c
+++ b/progs/tests/unfilledclip.c
@@ -26,6 +26,7 @@
*/
#include <stdlib.h>
+#include <GL/glew.h>
#include <GL/glut.h>
static int win_width, win_height;
@@ -194,6 +195,7 @@ main(int argc, char *argv[])
glutInitWindowSize(win_width, win_height);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc(reshape);
glutKeyboardFunc(key);
glutDisplayFunc(display);
diff --git a/progs/tests/vao-01.c b/progs/tests/vao-01.c
index c2d70885f0..117fae8bd9 100644
--- a/progs/tests/vao-01.c
+++ b/progs/tests/vao-01.c
@@ -49,6 +49,7 @@ typedef void (* PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, GLuint *arrays);
typedef GLboolean (* PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array);
#else
+#include <GL/glew.h>
#include <GL/glut.h>
#endif
@@ -166,6 +167,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( Width, Height );
glutInitDisplayMode( GLUT_RGB );
glutCreateWindow( "GL_APPLE_vertex_array_object demo" );
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/tests/vao-02.c b/progs/tests/vao-02.c
index 993bc368d4..7764ed5106 100644
--- a/progs/tests/vao-02.c
+++ b/progs/tests/vao-02.c
@@ -49,6 +49,7 @@ typedef void (* PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, GLuint *arrays);
typedef GLboolean (* PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array);
#else
+#include <GL/glew.h>
#include <GL/glut.h>
#endif
@@ -194,6 +195,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( Width, Height );
glutInitDisplayMode( GLUT_RGB );
glutCreateWindow( "GL_APPLE_vertex_array_object demo" );
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/tests/vparray.c b/progs/tests/vparray.c
index 580a670f8e..9c2fad97d9 100644
--- a/progs/tests/vparray.c
+++ b/progs/tests/vparray.c
@@ -12,7 +12,7 @@
#include <stdlib.h>
#include <string.h>
#include <math.h>
-#define GL_GLEXT_PROTOTYPES
+#include "GL/glew.h"
#include "GL/glut.h"
#define MAXVERTS 10000
@@ -280,6 +280,7 @@ int main(int argc, char **argv)
glutInitWindowPosition(0, 0);
glutInitWindowSize(400, 400);
if (glutCreateWindow("Isosurface") <= 0) {
+ glewInit();
exit(0);
}
glutReshapeFunc(Reshape);
diff --git a/progs/tests/vpeval.c b/progs/tests/vpeval.c
index 8b6996d3b5..f07737f973 100644
--- a/progs/tests/vpeval.c
+++ b/progs/tests/vpeval.c
@@ -10,7 +10,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
@@ -222,6 +222,7 @@ main(int argc, char **argv)
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB | GLUT_DEPTH);
glutInitWindowPosition(0, 0);
glutCreateWindow(argv[0]);
+ glewInit();
myinit(argc, argv);
glutReshapeFunc(myReshape);
glutDisplayFunc(display);
diff --git a/progs/tests/vptest1.c b/progs/tests/vptest1.c
index 560df2c3fd..5162919292 100644
--- a/progs/tests/vptest1.c
+++ b/progs/tests/vptest1.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>
@@ -161,6 +161,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/tests/vptest2.c b/progs/tests/vptest2.c
index 2158e07f04..4161b03a67 100644
--- a/progs/tests/vptest2.c
+++ b/progs/tests/vptest2.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>
@@ -140,6 +140,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 50, 50 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/tests/vptest3.c b/progs/tests/vptest3.c
index 2c5c800040..4e4bfee31d 100644
--- a/progs/tests/vptest3.c
+++ b/progs/tests/vptest3.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 float Zrot = 0.0;
@@ -111,6 +111,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/tests/vptorus.c b/progs/tests/vptorus.c
index 764dea4ec2..e61ffdac21 100644
--- a/progs/tests/vptorus.c
+++ b/progs/tests/vptorus.c
@@ -7,7 +7,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
static float Xrot = 0.0, Yrot = 0.0, Zrot = 0.0;
@@ -162,6 +162,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );
diff --git a/progs/tests/vpwarpmesh.c b/progs/tests/vpwarpmesh.c
index 56aa8200ec..80204ea136 100644
--- a/progs/tests/vpwarpmesh.c
+++ b/progs/tests/vpwarpmesh.c
@@ -7,7 +7,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
static float Xrot = -60.0, Yrot = 0.0, Zrot = 0.0;
@@ -224,6 +224,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );
diff --git a/progs/tests/yuvrect.c b/progs/tests/yuvrect.c
index acef406097..aab2f80ed9 100644
--- a/progs/tests/yuvrect.c
+++ b/progs/tests/yuvrect.c
@@ -9,7 +9,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
#include "../util/readtex.c" /* I know, this is a hack. */
@@ -180,6 +180,7 @@ int main( int argc, char *argv[] )
glutInitWindowPosition( 0, 0 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow(argv[0] );
+ glewInit();
Init( argc, argv );
diff --git a/progs/tests/yuvsquare.c b/progs/tests/yuvsquare.c
index 3601e7a31c..658528b799 100644
--- a/progs/tests/yuvsquare.c
+++ b/progs/tests/yuvsquare.c
@@ -9,7 +9,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
#include "../util/readtex.c" /* I know, this is a hack. */
@@ -219,6 +219,7 @@ int main( int argc, char *argv[] )
glutInitWindowPosition( 0, 0 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow(argv[0] );
+ glewInit();
Init( argc, argv );
diff --git a/progs/tests/zcomp.c b/progs/tests/zcomp.c
index b53079d07f..15e35f17b0 100644
--- a/progs/tests/zcomp.c
+++ b/progs/tests/zcomp.c
@@ -2,10 +2,10 @@
* Test Z compositing with glDrawPixels(GL_DEPTH_COMPONENT) and stencil test.
*/
-#define GL_GLEXT_PROTOTYPES
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/glut.h>
#include "../util/showbuffer.c"
@@ -211,6 +211,7 @@ main(int argc, char *argv[])
glutInitWindowSize(Width, Height);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH | GLUT_STENCIL);
Win = glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
diff --git a/progs/tests/zdrawpix.c b/progs/tests/zdrawpix.c
index dd222e7dd0..ba7da571eb 100644
--- a/progs/tests/zdrawpix.c
+++ b/progs/tests/zdrawpix.c
@@ -10,10 +10,10 @@
* Press 'd' to view the Z buffer as a grayscale image.
*/
-#define GL_GLEXT_PROTOTYPES
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/glut.h>
#include "../util/showbuffer.c"
@@ -180,6 +180,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/tests/zreaddraw.c b/progs/tests/zreaddraw.c
index e2dacbf7f2..3d8c557b37 100644
--- a/progs/tests/zreaddraw.c
+++ b/progs/tests/zreaddraw.c
@@ -8,7 +8,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
static GLint WinWidth = 500, WinHeight = 500;
@@ -107,6 +107,7 @@ int main(int argc, char *argv[])
glutInitWindowSize(WinWidth, WinHeight);
glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE);
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Display);