From 370eca12ad8b40bfc32c206a526d53f4c777156d Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 28 Feb 2008 17:42:18 -0700 Subject: Added calibrate_rast.c program Measures rasterization of points/lines/tris and suggests fixes/biases when something doesn't meet spec. --- progs/tests/calibrate_rast.c | 395 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 395 insertions(+) create mode 100644 progs/tests/calibrate_rast.c (limited to 'progs/tests/calibrate_rast.c') diff --git a/progs/tests/calibrate_rast.c b/progs/tests/calibrate_rast.c new file mode 100644 index 0000000000..37d8ac85e5 --- /dev/null +++ b/progs/tests/calibrate_rast.c @@ -0,0 +1,395 @@ +/* + * Automatic primitive rasterization precision test. + * + * Draw prims at various sub-pixel offsets and examine where the quad is + * actually drawn. + * Check if the range of offsets which paint the right pixels falls within + * OpenGL's specification. + * In case of failures, report the coordinate bias needed to fix the problem. + * + * Note that even Mesa/swrast fails some line tests. This is because some + * window coordinates wind up as 53.9999 instead of 54, for example. Enabling + * the small translation factor below fixes that. Revisit someday... + * + * Brian Paul + * 28 Feb 2008 + */ + + +#include +#include +#include +#include + + +static int Width = 100, Height = 100; +static int Win; +static float Step = 0.125; +#if 0 +/* This tiny offset fixes errors in Mesa/Xlib */ +static float Xtrans = 0.5 * 0.125; +static float Ytrans = 0.5 * 0.125; +#else +static float Xtrans = 0.0; +static float Ytrans = 0.0; +#endif + + +static void +PointCalibrate(int xpos, int ypos) +{ + GLfloat rgba[4]; + float x, y; + float xmin, ymin, xmax, ymax; + + xmin = ymin = 1000.0; + xmax = ymax = -1000.0; + + for (y = -1.0; y <= 1.0; y += Step) { + for (x = -1.0; x <= 1.0; x += Step) { + glClear(GL_COLOR_BUFFER_BIT); + glBegin(GL_POINTS); + glVertex2f(xpos + x, ypos + y); + glEnd(); + glReadPixels(xpos, ypos, 1, 1, GL_RGBA, GL_FLOAT, rgba); + if (rgba[0] == 1.0 && rgba[1] == 1.0 && rgba[2] == 1.0) { + /* hit */ + if (x < xmin) + xmin = x; + if (y < ymin) + ymin = y; + if (x > xmax) + xmax = x; + if (y > ymax) + ymax = y; + } + } + } + + printf("Point at (%2d, %2d) drawn for x in [%6.3f, %6.3f] and y in [%6.3f, %6.3f]\n", + xpos, ypos, + xpos + xmin, xpos + xmax, + ypos + ymin, ypos + ymax); + + if (xmax - xmin != 1.0 - Step) { + printf(" => Inconsistant X-axis rasterization!\n"); + } + if (ymax - ymin != 1.0 - Step) { + printf(" => Inconsistant Y-axis rasterization!\n"); + } + if (xmin < 0.0) { + printf(" => Points should be X biased by about %f\n", xmin); + } + if (ymin < 0.0) { + printf(" => Points should be Y biased by about %f\n", ymin); + } + if (xmax > 1.0) { + printf(" => Points should be X biased by about %f\n", 1.0 - xmax); + } + if (ymax > 1.0) { + printf(" => Points should be Y biased by about %f\n", 1.0 - ymax); + } + +} + + +/** + * XXX Implement VLineCalibrate() someday + */ +static void +HLineCalibrate(int xpos, int ypos, int len) +{ + GLfloat rgba[2][4]; + float x, y; + float ymin, ymax; + float xmin_left, xmax_left, xmin_right, xmax_right; + + xmin_left = xmin_right = 1000.0; + xmax_left = xmax_right = -1000.0; + ymin = 1000; + ymax = -1000.0; + + /* + * First, check vertical positioning of the horizontal line + */ + for (y = -1.0; y <= 1.0; y += Step) { + glClear(GL_COLOR_BUFFER_BIT); + glBegin(GL_LINES); + glVertex2f(xpos, ypos + y); + glVertex2f(xpos + len, ypos + y); + glEnd(); + + glReadPixels(xpos + len / 2, ypos, 1, 1, GL_RGBA, GL_FLOAT, rgba); + if (rgba[0][0] == 1.0) { + /* hit */ + if (y < ymin) + ymin = y; + if (y > ymax) + ymax = y; + } + } + + printf("H-line at Y=%2d drawn for y in [%6.3f, %6.3f]\n", + ypos, + ypos + ymin, ypos + ymax); + + if (ymax - ymin != 1.0 - Step) { + printf(" => Inconsistant Y-axis rasterization!\n"); + } + + if (ymin > 0.5 ) { + printf(" => Lines should be Y biased by about %f\n", ymin - 0.5); + } + + if (ymax < 0.5 ) { + printf(" => Lines should be Y biased by about %f\n", 0.5 - ymax); + } + + /* + * Second, check endpoints (for Y at 1/2 pixel) + */ + for (x = -1.0; x <= 1.0; x += Step) { + glClear(GL_COLOR_BUFFER_BIT); + glBegin(GL_LINES); + glVertex2f(xpos + x, ypos + 0.5f); + glVertex2f(xpos + x + len, ypos + 0.5f); + glEnd(); + + /* left end */ + glReadPixels(xpos - 1, ypos, 2, 1, GL_RGBA, GL_FLOAT, rgba); + if (rgba[0][0] == 0.0 && rgba[1][0] == 1.0) { + /* hit */ + if (x < xmin_left) + xmin_left = x; + if (x > xmax_left) + xmax_left = x; + } + + /* right end */ + glReadPixels(xpos + len - 1, ypos, 2, 1, GL_RGBA, GL_FLOAT, rgba); + if (rgba[0][0] == 1.0 && rgba[1][0] == 0.0) { + /* hit */ + if (x < xmin_right) + xmin_right = x; + if (x > xmax_right) + xmax_right = x; + } + } + + printf("H-line [%d..%d) hit left end for x in [%6.3f, %6.3f] " + "hit right end for x in [%6.3f, %6.3f]\n", + xpos, xpos + len, + xpos + xmin_left, xpos + xmax_left, + xpos + len + xmin_right, xpos + len + xmax_right); + + if (xmax_left - xmin_left > 1.0 - Step) { + printf(" => Inconsistant left-end rasterization!\n"); + } + if (xmax_right - xmin_right > 1.0 - Step) { + printf(" => Inconsistant right-end rasterization!\n"); + } + + if (xmin_left != xmin_right || + xmax_left != xmax_right) { + printf(" => Inconsistant length!\n"); + } + + if (xmin_left < 0.0) { + printf(" => Coords should be X biased by about %f\n", xmin_left ); + } + if (xmin_right < 0.0) { + printf(" => Coords should be X biased by about %f\n", xmin_right ); + } + if (xmax_left >= 1.0) { + printf(" => Coords should be X biased by about %f\n", -xmax_right + 1.0); + } + if (xmax_right >= 1.0) { + printf(" => Coords should be X biased by about %f\n", -xmax_right + 1.0); + } + +} + + +static void +QuadCalibrate(int xpos, int ypos, int width, int height) +{ + GLfloat rgba1[2][4]; + GLfloat rgba2[2][4]; + float x, y; + float xmin, ymin, xmax, ymax; + + xmin = ymin = 1000.0; + xmax = ymax = -1000.0; + + for (y = -1.0; y <= 1.0; y += Step) { + for (x = -1.0; x <= 1.0; x += Step) { + glClear(GL_COLOR_BUFFER_BIT); + glBegin(GL_QUADS); + glVertex2f(xpos + x, ypos + y); + glVertex2f(xpos + x + width, ypos + y); + glVertex2f(xpos + x + width, ypos + y + height); + glVertex2f(xpos + x, ypos + y + height); + glEnd(); + + /* horizontal measurement */ + glReadPixels(xpos - 1, ypos + 2, 2, 1, GL_RGBA, GL_FLOAT, rgba1); + glReadPixels(xpos + width - 1, ypos + 2, 2, 1, GL_RGBA, GL_FLOAT, rgba2); + if (rgba1[0][0] == 0.0 && rgba1[1][0] == 1.0 && + rgba2[0][0] == 1.0 && rgba2[1][0] == 0.0) { + if (x < xmin) + xmin = x; + if (x > xmax) + xmax = x; + } + + /* vertical measurement */ + glReadPixels(xpos + 2, ypos - 1, 1, 2, GL_RGBA, GL_FLOAT, rgba1); + glReadPixels(xpos + 2, ypos + height - 1, 1, 2, GL_RGBA, GL_FLOAT, rgba2); + if (rgba1[0][0] == 0.0 && rgba1[1][0] == 1.0 && + rgba2[0][0] == 1.0 && rgba2[1][0] == 0.0) { + if (y < ymin) + ymin = y; + if (y > ymax) + ymax = y; + } + } + } + + printf("Quad at (%2d, %2d)..(%2d, %2d) drawn" + " for x in [%6.3f, %6.3f] and y in [%6.3f, %6.3f]\n", + xpos, ypos, + xpos + width, ypos + height, + xpos + xmin, xpos + xmax, + ypos + ymin, ypos + ymax); + + if (xmax - xmin != 1.0 - Step) { + printf(" => Inconsistant X-axis rasterization/size!\n"); + } + if (ymax - ymin != 1.0 - Step) { + printf(" => Inconsistant Y-axis rasterization/size!\n"); + } + + if (xmin < -0.5) { + printf(" => Coords should be X biased by about %f\n", 0.5 + xmin ); + } + if (ymin < -0.5) { + printf(" => Coords should be Y biased by about %f\n", 0.5 + ymin); + } + if (xmax > 0.5) { + printf(" => Coords should be X biased by about %f\n", -xmax + 0.5); + } + if (ymax > 0.5) { + printf(" => Coords should be Y biased by about %f\n", -ymax + 0.5); + } +} + + +/** + * Misc/disabled code for debugging. + */ +static void +DebugTest(void) +{ + glClear(GL_COLOR_BUFFER_BIT); + glEnable(GL_BLEND); + glBlendFunc(GL_ONE, GL_ONE); + + glColor3f(.5, .5, .5); + + glBegin(GL_LINES); + glVertex2f(30, 35.5); + glVertex2f(54, 35.5); + glVertex2f(54, 35.5); + glVertex2f(66, 35.5); + glEnd(); + + glDisable(GL_BLEND); + glColor3f(1,1,1); +} + + +static void +Draw(void) +{ + glClear(GL_COLOR_BUFFER_BIT); + + glPushMatrix(); + glTranslatef(Xtrans, Ytrans, 0); + + PointCalibrate(1, 1); + PointCalibrate(50, 50); + PointCalibrate(28, 17); + PointCalibrate(17, 18); + printf("\n"); + + HLineCalibrate(5, 10, 10); + HLineCalibrate(25, 22, 12); + HLineCalibrate(54, 33, 12); + HLineCalibrate(54+12, 33, 12); + printf("\n"); + + QuadCalibrate(2, 2, 10, 10); + QuadCalibrate(50, 50, 10, 10); + QuadCalibrate(28, 17, 12, 12); + QuadCalibrate(17, 28, 12, 12); + + (void) DebugTest; + + glPopMatrix(); + + glutSwapBuffers(); +} + + +static void +Reshape(int width, int height) +{ + Width = width; + Height = height; + glViewport(0, 0, width, height); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + glOrtho(0, width, 0, height, -1, 1); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); +} + + +static void +Key(unsigned char key, int x, int y) +{ + (void) x; + (void) y; + switch (key) { + case 27: + glutDestroyWindow(Win); + exit(0); + break; + } + glutPostRedisplay(); +} + + +static void +Init(void) +{ + printf("Measurement/callibration for basic prim rasterization...\n"); + printf("GL_RENDERER: %s\n", (char*) glGetString(GL_RENDERER)); +} + + +int +main(int argc, char *argv[]) +{ + glutInit(&argc, argv); + glutInitWindowPosition(0, 0); + glutInitWindowSize(Width, Height); + glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE); + Win = glutCreateWindow(argv[0]); + glutReshapeFunc(Reshape); + glutKeyboardFunc(Key); + glutDisplayFunc(Draw); + Init(); + glutMainLoop(); + return 0; +} -- cgit v1.2.3 From a58065d4e2fc29644d804c92be773731242664c5 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Tue, 10 Mar 2009 13:11:23 +0000 Subject: progs/tests: compile with SCons and glew Also get mingw cross-compilation of these tests working --- progs/SConscript | 1 + progs/tests/SConscript | 133 ++++++++++++++++++++++++++++++++++++++++++ progs/tests/afsmultiarb.c | 3 +- progs/tests/antialias.c | 16 ++--- progs/tests/api_speed.c | 5 +- progs/tests/arbfpspec.c | 3 +- progs/tests/arbfptest1.c | 3 +- progs/tests/arbfptexture.c | 3 +- progs/tests/arbfptrig.c | 3 +- progs/tests/arbnpot-mipmap.c | 2 + progs/tests/arbnpot.c | 2 + progs/tests/arbvptest1.c | 3 +- progs/tests/arbvptest3.c | 3 +- progs/tests/arbvptorus.c | 3 +- progs/tests/arbvpwarpmesh.c | 3 +- progs/tests/arraytexture.c | 2 + progs/tests/blendminmax.c | 2 + progs/tests/blendsquare.c | 2 + progs/tests/blendxor.c | 3 +- progs/tests/bufferobj.c | 3 +- progs/tests/bug_3050.c | 2 + progs/tests/bug_3101.c | 2 + progs/tests/bug_3195.c | 2 + progs/tests/bug_texstore_i8.c | 2 + progs/tests/calibrate_rast.c | 2 + progs/tests/copypixrate.c | 3 +- progs/tests/crossbar.c | 2 + progs/tests/cva.c | 2 + progs/tests/debugger.c | 6 +- progs/tests/dinoshade.c | 2 + progs/tests/drawbuffers.c | 3 +- progs/tests/exactrast.c | 20 ++++--- progs/tests/ext422square.c | 3 +- progs/tests/fbotest1.c | 3 +- progs/tests/fbotest2.c | 3 +- progs/tests/fbotexture.c | 3 +- progs/tests/fillrate.c | 3 +- progs/tests/floattex.c | 2 + progs/tests/fog.c | 3 +- progs/tests/fogcoord.c | 3 +- progs/tests/fptest1.c | 3 +- progs/tests/fptexture.c | 3 +- progs/tests/interleave.c | 2 + progs/tests/invert.c | 2 + progs/tests/lineclip.c | 2 + progs/tests/manytex.c | 2 + progs/tests/mapbufrange.c | 3 +- progs/tests/mapvbo.c | 3 +- progs/tests/minmag.c | 2 + progs/tests/mipmap_limits.c | 2 + progs/tests/mipmap_view.c | 2 + progs/tests/multipal.c | 2 + progs/tests/multitexarray.c | 2 + progs/tests/multiwindow.c | 3 + progs/tests/no_s3tc.c | 2 + progs/tests/packedpixels.c | 2 + progs/tests/pbo.c | 3 +- progs/tests/prog_parameter.c | 2 + progs/tests/projtex.c | 2 + progs/tests/quads.c | 9 +-- progs/tests/random.c | 3 +- progs/tests/readrate.c | 3 +- progs/tests/rubberband.c | 3 +- progs/tests/seccolor.c | 3 +- progs/tests/shader_api.c | 3 +- progs/tests/stencil_twoside.c | 2 + progs/tests/stencil_wrap.c | 2 + progs/tests/stencilwrap.c | 2 + progs/tests/subtex.c | 2 + progs/tests/subtexrate.c | 3 +- progs/tests/tex1d.c | 2 + progs/tests/texcmp.c | 3 +- progs/tests/texcompress2.c | 3 +- progs/tests/texfilt.c | 14 +++-- progs/tests/texgenmix.c | 2 + progs/tests/texline.c | 2 + progs/tests/texrect.c | 3 +- progs/tests/texwrap.c | 3 +- progs/tests/unfilledclip.c | 2 + progs/tests/vao-01.c | 2 + progs/tests/vao-02.c | 2 + progs/tests/vparray.c | 3 +- progs/tests/vpeval.c | 3 +- progs/tests/vptest1.c | 3 +- progs/tests/vptest2.c | 3 +- progs/tests/vptest3.c | 3 +- progs/tests/vptorus.c | 3 +- progs/tests/vpwarpmesh.c | 3 +- progs/tests/yuvrect.c | 3 +- progs/tests/yuvsquare.c | 3 +- progs/tests/zcomp.c | 3 +- progs/tests/zdrawpix.c | 3 +- progs/tests/zreaddraw.c | 3 +- 93 files changed, 344 insertions(+), 78 deletions(-) create mode 100644 progs/tests/SConscript (limited to 'progs/tests/calibrate_rast.c') 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 #include #include -#define GL_GLEXT_PROTOTYPES +#include #include #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 #include #include +#include #include @@ -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 #include -#define GL_GLEXT_PROTOTYPES -#include -#include +#include #include #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 #include #include -#define GL_GLEXT_PROTOTYPES +#include #include 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 #include #include -#define GL_GLEXT_PROTOTYPES +#include #include @@ -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 #include #include -#define GL_GLEXT_PROTOTYPES +#include #include #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 #include #include -#define GL_GLEXT_PROTOTYPES +#include #include #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 #include +#include #include 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 #include #include +#include #include #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 #include #include -#define GL_GLEXT_PROTOTYPES +#include #include 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 #include #include -#define GL_GLEXT_PROTOTYPES +#include #include 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 #include #include -#define GL_GLEXT_PROTOTYPES +#include #include 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 #include #include -#define GL_GLEXT_PROTOTYPES +#include #include 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 #include #include +#include #include #include @@ -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 #include +#include #include 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 #include +#include #include 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 #include #include +#include #include #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 #include #include #include +#include #include #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 #include #include +#include #include 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 #include +#include #include 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 #include #include +#include #include #include @@ -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 #include #include +#include #include 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 #include #include +#include #include @@ -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 #include #include #include +#include #include 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 #include #include +#include #include 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 #endif #define GL_GLEXT_LEGACY +#include #include #include @@ -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 #include #include -#define GL_GLEXT_PROTOTYPES +#include #include @@ -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 #endif #define GL_GLEXT_LEGACY +#include /* OpenGL Utility Toolkit header */ #include /* OpenGL Utility Toolkit header */ /* Some 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 #include #include #include +#include #include #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 #include +#include #include 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 #include #include -#define GL_GLEXT_PROTOTYPES +#include #include #include @@ -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 #include #include #include +#include #include 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 #include #include #include +#include #include 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 #include #include #include @@ -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 #include #include +#include #include #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 #include #include +#include #include #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 #include #include +#include #include 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 #include #include +#include #include 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 #include #include -#define GL_GLEXT_PROTOTYPES +#include #include @@ -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 #include #include -#define GL_GLEXT_PROTOTYPES +#include #include #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 #include #include +#include #include 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 #include #include +#include #include #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 +#include #include 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 #include #include +#include #include @@ -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 #include #include #include #include #include +#include #include 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 #include +#include #include 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 #include #include +#include #include @@ -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 #include +#include #include 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 #include #include +#include #include #include @@ -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 #endif #define GL_GLEXT_LEGACY +#include #include #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 #include #include +#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 #include #include +#include #include @@ -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 #include #include +#include #include #include @@ -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 #include #include +#include #include @@ -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 #include #include #include +#include #include #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 #include #include +#include #include #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 #include #include +#include #include #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 #include #include +#include #include #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 #include #include #include #include +#include #include 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 #include #include #include +#include #include /* 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 #include #include +#include #include #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 #include #include +#include #include 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 #include #include -#define GL_GLEXT_PROTOTYPES +#include #include 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 #include +#include #include 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 #include +#include #include 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 #include #include +#include #include 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 #include #include +#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 #include #include #include +#include #include 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 #include #include +#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 #include #include -#define GL_GLEXT_PROTOTYPES 1 +#include #include #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 #include +#include #include #include #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 #include #include +#include #include 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 #include #include +#include #include #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 #include #include +#include #include #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 #include #include #include +#include #include #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 #include #include +#include #include @@ -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 +#include #include 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 #include #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 #include #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 #include #include -#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 #include #include -#define GL_GLEXT_PROTOTYPES +#include #include @@ -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 #include #include -#define GL_GLEXT_PROTOTYPES +#include #include @@ -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 #include #include -#define GL_GLEXT_PROTOTYPES +#include #include @@ -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 #include #include -#define GL_GLEXT_PROTOTYPES +#include #include 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 #include #include -#define GL_GLEXT_PROTOTYPES +#include #include 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 #include #include -#define GL_GLEXT_PROTOTYPES +#include #include 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 #include #include -#define GL_GLEXT_PROTOTYPES +#include #include #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 #include #include -#define GL_GLEXT_PROTOTYPES +#include #include #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 #include #include +#include #include #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 #include #include +#include #include #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 #include #include -#define GL_GLEXT_PROTOTYPES +#include #include 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); -- cgit v1.2.3