From 72ebf4fd03fdf64b483026879e18a3158be0c6c8 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Fri, 21 Nov 2008 03:40:48 +0900 Subject: scons: Build progs. Just demos and trivial dirs for starters. --- progs/SConscript | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 progs/SConscript (limited to 'progs/SConscript') diff --git a/progs/SConscript b/progs/SConscript new file mode 100644 index 0000000000..245fc26725 --- /dev/null +++ b/progs/SConscript @@ -0,0 +1,4 @@ +SConscript([ + 'demos/SConscript', + 'trivial/SConscript', +]) -- cgit v1.2.3 From 528a0a885e85907888738cd7b28fff1334697e50 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Fri, 23 Jan 2009 16:24:43 +0000 Subject: progs: Port vp-tris to glew. There was some wglGetProcAddress calls to setup extensions already, but including glext caused many compilation errors in MinGW. --- progs/SConscript | 1 + progs/vp/Makefile | 2 +- progs/vp/SConscript | 13 +++++++++++++ progs/vp/vp-tris.c | 31 ++----------------------------- 4 files changed, 17 insertions(+), 30 deletions(-) create mode 100644 progs/vp/SConscript (limited to 'progs/SConscript') diff --git a/progs/SConscript b/progs/SConscript index 245fc26725..ffb6de4f16 100644 --- a/progs/SConscript +++ b/progs/SConscript @@ -1,4 +1,5 @@ SConscript([ 'demos/SConscript', 'trivial/SConscript', + 'vp/SConscript', ]) diff --git a/progs/vp/Makefile b/progs/vp/Makefile index 41d025c574..58a0dacb22 100644 --- a/progs/vp/Makefile +++ b/progs/vp/Makefile @@ -8,7 +8,7 @@ TOP = ../.. include $(TOP)/configs/current -LIBS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) $(APP_LIB_DEPS) +LIBS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLEW_LIB) -l$(GLU_LIB) -l$(GL_LIB) $(APP_LIB_DEPS) SOURCES = \ vp-tris.c diff --git a/progs/vp/SConscript b/progs/vp/SConscript new file mode 100644 index 0000000000..640c5dd847 --- /dev/null +++ b/progs/vp/SConscript @@ -0,0 +1,13 @@ +Import('env') + +if not env['GLUT']: + Return() + +env = env.Clone() + +env.Prepend(LIBS = ['$GLUT_LIB']) + +env.Program( + target = 'vp-tris', + source = ['vp-tris.c'], + ) diff --git a/progs/vp/vp-tris.c b/progs/vp/vp-tris.c index e1ddb2e14d..87cb12b984 100644 --- a/progs/vp/vp-tris.c +++ b/progs/vp/vp-tris.c @@ -9,25 +9,11 @@ #ifndef WIN32 #include #include -#define GL_GLEXT_PROTOTYPES -#else -#include #endif +#include #include -#ifdef WIN32 -static PFNGLBINDPROGRAMARBPROC glBindProgramARB = NULL; -static PFNGLGENPROGRAMSARBPROC glGenProgramsARB = NULL; -static PFNGLPROGRAMSTRINGARBPROC glProgramStringARB = NULL; -static PFNGLISPROGRAMARBPROC glIsProgramARB = NULL; - -static PFNGLBINDPROGRAMNVPROC glBindProgramNV = NULL; -static PFNGLGENPROGRAMSNVPROC glGenProgramsNV = NULL; -static PFNGLLOADPROGRAMNVPROC glLoadProgramNV = NULL; -static PFNGLISPROGRAMNVPROC glIsProgramNV = NULL; -#endif - static const char *filename = NULL; static GLuint nr_steps = 4; @@ -115,13 +101,6 @@ static void Init( void ) fprintf(stderr, "%.*s\n", sz, buf); if (strncmp( buf, "!!VP", 4 ) == 0) { -#ifdef WIN32 - glBindProgramNV = (PFNGLBINDPROGRAMNVPROC) wglGetProcAddress( "glBindProgramNV" ); - glGenProgramsNV = (PFNGLGENPROGRAMSNVPROC) wglGetProcAddress( "glGenProgramsNV" ); - glLoadProgramNV = (PFNGLLOADPROGRAMNVPROC) wglGetProcAddress( "glLoadProgramNV" ); - glIsProgramNV = (PFNGLISPROGRAMNVPROC) wglGetProcAddress( "glIsProgramNV" ); -#endif - glEnable( GL_VERTEX_PROGRAM_NV ); glGenProgramsNV( 1, &prognum ); glBindProgramNV( GL_VERTEX_PROGRAM_NV, prognum ); @@ -129,13 +108,6 @@ static void Init( void ) assert( glIsProgramNV( prognum ) ); } else { -#ifdef WIN32 - glBindProgramARB = (PFNGLBINDPROGRAMARBPROC) wglGetProcAddress( "glBindProgramARB" ); - glGenProgramsARB = (PFNGLGENPROGRAMSARBPROC) wglGetProcAddress( "glGenProgramsARB" ); - glProgramStringARB = (PFNGLPROGRAMSTRINGARBPROC) wglGetProcAddress( "glProgramStringARB" ); - glIsProgramARB = (PFNGLISPROGRAMARBPROC) wglGetProcAddress( "glIsProgramARB" ); -#endif - glEnable(GL_VERTEX_PROGRAM_ARB); glGenProgramsARB(1, &prognum); @@ -288,6 +260,7 @@ int main( int argc, char *argv[] ) glutInitWindowSize( 250, 250 ); glutInitDisplayMode( GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH ); glutCreateWindow(argv[argc-1]); + glewInit(); glutReshapeFunc( Reshape ); glutKeyboardFunc( Key ); glutDisplayFunc( Display ); -- cgit v1.2.3 From 9aa73cfae84c7710df97ce182d32bea8d3423ab7 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Sun, 1 Feb 2009 12:00:07 +0000 Subject: progs: Get more samples building on windows. --- progs/SConscript | 1 + progs/demos/SConscript | 26 ++++++++++++++++++++++---- progs/demos/fogcoord.c | 28 +++++++++++----------------- progs/demos/gloss.c | 2 ++ progs/demos/multiarb.c | 2 ++ progs/demos/rain.cxx | 2 -- progs/demos/stex3d.c | 4 +++- progs/demos/winpos.c | 18 ++++++++---------- progs/trivial/fs-tri.c | 39 ++++++++++++++++++--------------------- progs/util/SConscript | 15 +++++++++++++++ scons/generic.py | 40 +++++++++++++++++++++++----------------- 11 files changed, 105 insertions(+), 72 deletions(-) create mode 100644 progs/util/SConscript (limited to 'progs/SConscript') diff --git a/progs/SConscript b/progs/SConscript index ffb6de4f16..631923a38f 100644 --- a/progs/SConscript +++ b/progs/SConscript @@ -1,4 +1,5 @@ SConscript([ + 'util/SConscript', 'demos/SConscript', 'trivial/SConscript', 'vp/SConscript', diff --git a/progs/demos/SConscript b/progs/demos/SConscript index 112da7bedb..bc166dd789 100644 --- a/progs/demos/SConscript +++ b/progs/demos/SConscript @@ -1,11 +1,22 @@ -Import('env') +Import('*') if not env['GLUT']: Return() env = env.Clone() -env.Prepend(LIBS = ['$GLUT_LIB']) +env.Prepend(CPPPATH = [ + '../util', +]) + +env.Prepend(LIBS = [ + util, + '$GLUT_LIB' +]) + +if env['platform'] == 'windows': + env.Append(CPPDEFINES = ['NOMINMAX']) + env.Prepend(LIBS = ['winmm']) progs = [ 'arbfplight', @@ -38,7 +49,6 @@ progs = [ 'multiarb', 'paltex', 'pointblast', - 'rain', 'ray', 'readpix', 'reflect', @@ -65,7 +75,15 @@ progs = [ ] for prog in progs: - prog = env.Program( + env.Program( target = prog, source = prog + '.c', ) + +env.Program( + target = 'rain', + source = [ + 'rain.cxx', + 'particles.cxx', + ] +) diff --git a/progs/demos/fogcoord.c b/progs/demos/fogcoord.c index 00c73c6f04..6f50993c98 100644 --- a/progs/demos/fogcoord.c +++ b/progs/demos/fogcoord.c @@ -7,19 +7,16 @@ * Daniel Borca */ -#define GL_GLEXT_PROTOTYPES #include #include #include +#include #include #define DEPTH 5.0f -static PFNGLFOGCOORDFEXTPROC glFogCoordf_ext; static PFNGLFOGCOORDPOINTEREXTPROC glFogCoordPointer_ext; -static GLboolean have_fog_coord; - static GLfloat camz; static GLint fogMode; @@ -45,10 +42,11 @@ Reset(void) } -static void APIENTRY -glFogCoordf_nop (GLfloat f) +static void +glFogCoordf_ext (GLfloat f) { - (void)f; + if (fogCoord) + glFogCoordfEXT(f); } @@ -120,14 +118,11 @@ SetFogMode(GLint fogMode) static GLboolean SetFogCoord(GLboolean fogCoord) { - glFogCoordf_ext = glFogCoordf_nop; - - if (!have_fog_coord) { + if (!GLEW_EXT_fog_coord) { return GL_FALSE; } if (fogCoord) { - glFogCoordf_ext = (PFNGLFOGCOORDFEXTPROC)glutGetProcAddress("glFogCoordfEXT"); glFogi(GL_FOG_COORDINATE_SOURCE_EXT, GL_FOG_COORDINATE_EXT); } else { @@ -340,7 +335,7 @@ Key( unsigned char key, int x, int y ) SetFogMode(fogMode); break; case 'c': - fogCoord = SetFogCoord(fogCoord ^ GL_TRUE); + fogCoord = SetFogCoord(fogCoord ^ GL_TRUE); break; case 't': Texture = !Texture; @@ -372,8 +367,7 @@ Init(void) printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - have_fog_coord = glutExtensionSupported("GL_EXT_fog_coord"); - if (!have_fog_coord) { + if (!GLEW_EXT_fog_coord) { printf("GL_EXT_fog_coord not supported!\n"); } @@ -400,10 +394,9 @@ Init(void) glEnableClientState(GL_TEXTURE_COORD_ARRAY); glTexCoordPointer(2, GL_FLOAT, 0, texcoord_pointer); - if (have_fog_coord) { - glFogCoordPointer_ext = (PFNGLFOGCOORDPOINTEREXTPROC)glutGetProcAddress("glFogCoordPointerEXT"); + if (GLEW_EXT_fog_coord) { glEnableClientState(GL_FOG_COORDINATE_ARRAY_EXT); - glFogCoordPointer_ext(GL_FLOAT, 0, fogcoord_pointer); + glFogCoordPointerEXT(GL_FLOAT, 0, fogcoord_pointer); } Reset(); @@ -417,6 +410,7 @@ main( int argc, char *argv[] ) glutInitWindowSize( 600, 600 ); glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH ); glutCreateWindow(argv[0]); + glewInit(); glutReshapeFunc( Reshape ); glutKeyboardFunc( Key ); glutDisplayFunc( Display ); diff --git a/progs/demos/gloss.c b/progs/demos/gloss.c index 9974f0dab2..b2126e3267 100644 --- a/progs/demos/gloss.c +++ b/progs/demos/gloss.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include "readtex.h" @@ -438,6 +439,7 @@ int main( int argc, char *argv[] ) glutInitWindowSize(WinWidth, WinHeight); glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH ); glutCreateWindow(argv[0] ); + glewInit(); glutReshapeFunc( Reshape ); glutKeyboardFunc( Key ); glutDisplayFunc( Display ); diff --git a/progs/demos/multiarb.c b/progs/demos/multiarb.c index 451fd11efe..85c4e3a266 100644 --- a/progs/demos/multiarb.c +++ b/progs/demos/multiarb.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include "readtex.h" @@ -326,6 +327,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/demos/rain.cxx b/progs/demos/rain.cxx index 59b6471ef8..265d90cd95 100644 --- a/progs/demos/rain.cxx +++ b/progs/demos/rain.cxx @@ -24,8 +24,6 @@ extern "C" { #ifdef _WIN32 #include #include -#include "particles.cxx" -#include "readtex.c" #endif #ifdef XMESA diff --git a/progs/demos/stex3d.c b/progs/demos/stex3d.c index 83ae3684ae..c0bbea0960 100644 --- a/progs/demos/stex3d.c +++ b/progs/demos/stex3d.c @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include @@ -662,6 +662,8 @@ main(int argc, char **argv) exit(0); } + glewInit(); + init(); printHelp(); diff --git a/progs/demos/winpos.c b/progs/demos/winpos.c index b58e330864..13a9c7e9a8 100644 --- a/progs/demos/winpos.c +++ b/progs/demos/winpos.c @@ -11,7 +11,7 @@ #ifdef _WIN32 #include #endif -#define GL_GLEXT_PROTOTYPES +#include "GL/glew.h" #include "GL/glut.h" #include "readtex.h" @@ -29,8 +29,7 @@ static GLubyte *Image; static int ImgWidth, ImgHeight; static GLenum ImgFormat; -typedef void (APIENTRY * PFNWINDOWPOSFUNC)(GLfloat x, GLfloat y); -static PFNWINDOWPOSFUNC WindowPosFunc; +static PFNGLWINDOWPOS2FPROC WindowPosFunc; static void draw( void ) { @@ -71,19 +70,16 @@ static void reshape( int width, int height ) static void init( void ) { -#ifdef GL_ARB_window_pos - if (glutExtensionSupported("GL_ARB_window_pos")) { + if (GLEW_ARB_window_pos) { printf("Using GL_ARB_window_pos\n"); - WindowPosFunc = &glWindowPos2fARB; + WindowPosFunc = glWindowPos2fARB; } else -#elif defined(GL_MESA_window_pos) - if (glutExtensionSupported("GL_MESA_window_pos")) { + if (GLEW_MESA_window_pos) { printf("Using GL_MESA_window_pos\n"); - WindowPosFunc = &glWindowPos2fMESA; + WindowPosFunc = glWindowPos2fMESA; } else -#endif { printf("Sorry, GL_ARB/MESA_window_pos extension not available.\n"); exit(1); @@ -109,6 +105,8 @@ int main( int argc, char *argv[] ) exit(0); } + glewInit(); + init(); glutReshapeFunc( reshape ); diff --git a/progs/trivial/fs-tri.c b/progs/trivial/fs-tri.c index 3be4d42e54..6e86df1dcf 100644 --- a/progs/trivial/fs-tri.c +++ b/progs/trivial/fs-tri.c @@ -5,10 +5,8 @@ #include #include #include -#include +#include #include -#include -#include "extfuncs.h" static GLuint fragShader; @@ -56,9 +54,9 @@ Reshape(int width, int height) static void CleanUp(void) { - glDeleteShader_func(fragShader); - glDeleteShader_func(vertShader); - glDeleteProgram_func(program); + glDeleteShader(fragShader); + glDeleteShader(vertShader); + glDeleteProgram(program); glutDestroyWindow(win); } @@ -110,15 +108,15 @@ LoadAndCompileShader(GLuint shader, const char *text) { GLint stat; - glShaderSource_func(shader, 1, (const GLchar **) &text, NULL); + glShaderSource(shader, 1, (const GLchar **) &text, NULL); - glCompileShader_func(shader); + glCompileShader(shader); - glGetShaderiv_func(shader, GL_COMPILE_STATUS, &stat); + glGetShaderiv(shader, GL_COMPILE_STATUS, &stat); if (!stat) { GLchar log[1000]; GLsizei len; - glGetShaderInfoLog_func(shader, 1000, &len, log); + glGetShaderInfoLog(shader, 1000, &len, log); fprintf(stderr, "fslight: problem compiling shader:\n%s\n", log); exit(1); } @@ -129,11 +127,11 @@ static void CheckLink(GLuint prog) { GLint stat; - glGetProgramiv_func(prog, GL_LINK_STATUS, &stat); + glGetProgramiv(prog, GL_LINK_STATUS, &stat); if (!stat) { GLchar log[1000]; GLsizei len; - glGetProgramInfoLog_func(prog, 1000, &len, log); + glGetProgramInfoLog(prog, 1000, &len, log); fprintf(stderr, "Linker error:\n%s\n", log); } } @@ -165,24 +163,22 @@ Init(void) exit(1); } - GetExtensionFuncs(); - - fragShader = glCreateShader_func(GL_FRAGMENT_SHADER); + fragShader = glCreateShader(GL_FRAGMENT_SHADER); LoadAndCompileShader(fragShader, fragShaderText); #if 0 - vertShader = glCreateShader_func(GL_VERTEX_SHADER); + vertShader = glCreateShader(GL_VERTEX_SHADER); LoadAndCompileShader(vertShader, vertShaderText); #endif - program = glCreateProgram_func(); - glAttachShader_func(program, fragShader); + program = glCreateProgram(); + glAttachShader(program, fragShader); #if 0 - glAttachShader_func(program, vertShader); + glAttachShader(program, vertShader); #endif - glLinkProgram_func(program); + glLinkProgram(program); CheckLink(program); - glUseProgram_func(program); + glUseProgram(program); assert(glGetError() == 0); @@ -200,6 +196,7 @@ main(int argc, char *argv[]) glutInitWindowSize(200, 200); glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH); win = glutCreateWindow(argv[0]); + glewInit(); glutReshapeFunc(Reshape); glutKeyboardFunc(Key); glutSpecialFunc(SpecialKey); diff --git a/progs/util/SConscript b/progs/util/SConscript new file mode 100644 index 0000000000..8ad2466291 --- /dev/null +++ b/progs/util/SConscript @@ -0,0 +1,15 @@ +Import('env') + +env = env.Clone() + +util = env.StaticLibrary( + target = ['util'], + source = [ + 'readtex.c', + 'trackball.c', + 'showbuffer.c', + 'shaderutil.c', + ], +) + +Export('util') diff --git a/scons/generic.py b/scons/generic.py index df7ef42402..05f7356b76 100644 --- a/scons/generic.py +++ b/scons/generic.py @@ -303,7 +303,7 @@ def generate(env): #'_UNICODE', #'UNICODE', # http://msdn2.microsoft.com/en-us/library/6dwk3a1z.aspx, - 'WIN32_LEAN_AND_MEAN', + #'WIN32_LEAN_AND_MEAN', 'VC_EXTRALEAN', '_CRT_SECURE_NO_DEPRECATE', ] @@ -362,24 +362,26 @@ def generate(env): ]) # C compiler options - cflags = [] + cflags = [] # C + cxxflags = [] # C++ + ccflags = [] # C & C++ if gcc: if debug: - cflags += ['-O0', '-g3'] + ccflags += ['-O0', '-g3'] else: - cflags += ['-O3', '-g0'] + ccflags += ['-O3', '-g0'] if env['profile']: - cflags += ['-pg'] + ccflags += ['-pg'] if env['machine'] == 'x86': - cflags += [ + ccflags += [ '-m32', #'-march=pentium4', '-mmmx', '-msse', '-msse2', # enable SIMD intrinsics #'-mfpmath=sse', ] if env['machine'] == 'x86_64': - cflags += ['-m64'] - cflags += [ + ccflags += ['-m64'] + ccflags += [ '-Wall', '-Wmissing-prototypes', '-Wno-long-long', @@ -387,43 +389,46 @@ def generate(env): '-pedantic', '-fmessage-length=0', # be nice to Eclipse ] + cflags += [ + '-Wmissing-prototypes', + ] if msvc: # See also: # - http://msdn.microsoft.com/en-us/library/19z1t1wy.aspx # - cl /? if debug: - cflags += [ + ccflags += [ '/Od', # disable optimizations '/Oi', # enable intrinsic functions '/Oy-', # disable frame pointer omission ] else: - cflags += [ + ccflags += [ '/Ox', # maximum optimizations '/Oi', # enable intrinsic functions '/Ot', # favor code speed #'/fp:fast', # fast floating point ] if env['profile']: - cflags += [ + ccflags += [ '/Gh', # enable _penter hook function '/GH', # enable _pexit hook function ] - cflags += [ + ccflags += [ '/W3', # warning level #'/Wp64', # enable 64 bit porting warnings ] if env['machine'] == 'x86': - cflags += [ + ccflags += [ #'/QIfist', # Suppress _ftol #'/arch:SSE2', # use the SSE2 instructions ] if platform == 'windows': - cflags += [ + ccflags += [ # TODO ] if platform == 'winddk': - cflags += [ + ccflags += [ '/Zl', # omit default library name in .OBJ '/Zp8', # 8bytes struct member alignment '/Gy', # separate functions for linker @@ -442,7 +447,7 @@ def generate(env): ] if platform == 'wince': # See also C:\WINCE600\public\common\oak\misc\makefile.def - cflags += [ + ccflags += [ '/Zl', # omit default library name in .OBJ '/GF', # enable read-only string pooling '/GR-', # disable C++ RTTI @@ -459,8 +464,9 @@ def generate(env): # See http://scons.tigris.org/issues/show_bug.cgi?id=1656 env.EnsureSConsVersion(0, 98, 0) env['PDB'] = '${TARGET.base}.pdb' + env.Append(CCFLAGS = ccflags) env.Append(CFLAGS = cflags) - env.Append(CXXFLAGS = cflags) + env.Append(CXXFLAGS = cxxflags) if env['platform'] == 'windows' and msvc: # Choose the appropriate MSVC CRT -- cgit v1.2.3 From 8b9aa730c6cf91d13892ef8a68a2aeece4e627f6 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Tue, 10 Feb 2009 18:25:31 +0000 Subject: progs: Build rebook with scons too. --- progs/SConscript | 1 + progs/redbook/SConscript | 91 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 92 insertions(+) create mode 100644 progs/redbook/SConscript (limited to 'progs/SConscript') diff --git a/progs/SConscript b/progs/SConscript index 631923a38f..68a48b4728 100644 --- a/progs/SConscript +++ b/progs/SConscript @@ -2,5 +2,6 @@ SConscript([ 'util/SConscript', 'demos/SConscript', 'trivial/SConscript', + 'redbook/SConscript', 'vp/SConscript', ]) diff --git a/progs/redbook/SConscript b/progs/redbook/SConscript new file mode 100644 index 0000000000..242cb6647f --- /dev/null +++ b/progs/redbook/SConscript @@ -0,0 +1,91 @@ +Import('*') + +if not env['GLUT']: + Return() + +env = env.Clone() + +env.Prepend(CPPPATH = [ + '../util', +]) + +env.Prepend(LIBS = [ + util, + '$GLUT_LIB' +]) + +if env['platform'] == 'windows': + env.Append(CPPDEFINES = ['NOMINMAX']) + env.Prepend(LIBS = ['winmm']) + +progs = [ + 'aaindex', + 'aapoly', + 'aargb', + 'accanti', + 'accpersp', + 'alpha3D', + 'alpha', + 'anti', + 'bezcurve', + 'bezmesh', + 'checker', + 'clip', + 'colormat', + 'cube', + 'depthcue', + 'dof', + 'double', + 'drawf', + 'feedback', + 'fog', + 'fogindex', + 'font', + 'hello', + 'image', + 'light', + 'lines', + 'list', + 'material', + 'mipmap', + 'model', + 'movelight', + 'nurbs', + 'pickdepth', + 'picksquare', + 'plane', + 'planet', + 'polyoff', + 'polys', + 'quadric', + 'robot', + 'sccolorlight', + 'scenebamb', + 'scene', + 'sceneflat', + 'select', + 'smooth', + 'stencil', + 'stroke', + 'surface', + 'teaambient', + 'teapots', + 'tess', + 'tesswind', + 'texbind', + 'texgen', + 'texprox', + 'texsub', + 'texturesurf', + 'torus', + 'trim', + 'unproject', + 'varray', + 'wrap', +] + +for prog in progs: + env.Program( + target = prog, + source = prog + '.c', + ) -- cgit v1.2.3 From 52233f27bb99d21a085117990936d9c355e4ce08 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Tue, 10 Feb 2009 20:27:49 +0000 Subject: progs: Build samples dir with scons and glew. --- progs/SConscript | 3 ++- progs/samples/Makefile | 2 +- progs/samples/SConscript | 58 ++++++++++++++++++++++++++++++++++++++++++++++++ progs/samples/blendeq.c | 7 +++--- progs/samples/blendxor.c | 9 +++----- 5 files changed, 67 insertions(+), 12 deletions(-) create mode 100644 progs/samples/SConscript (limited to 'progs/SConscript') diff --git a/progs/SConscript b/progs/SConscript index 68a48b4728..6484c761fc 100644 --- a/progs/SConscript +++ b/progs/SConscript @@ -1,7 +1,8 @@ SConscript([ 'util/SConscript', 'demos/SConscript', - 'trivial/SConscript', 'redbook/SConscript', + 'samples/SConscript', + 'trivial/SConscript', 'vp/SConscript', ]) diff --git a/progs/samples/Makefile b/progs/samples/Makefile index 63dca07d2e..b300e38b9c 100644 --- a/progs/samples/Makefile +++ b/progs/samples/Makefile @@ -7,7 +7,7 @@ INCDIR = $(TOP)/include LIB_DEP = $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) $(TOP)/$(LIB_DIR)/$(GLU_LIB_NAME) $(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME) -LIBS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) $(APP_LIB_DEPS) +LIBS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLEW_LIB) -l$(GLU_LIB) -l$(GL_LIB) $(APP_LIB_DEPS) PROGS = accum bitmap1 bitmap2 blendeq blendxor copy cursor depth eval fog \ font line logo nurb olympic overlay point prim quad select \ diff --git a/progs/samples/SConscript b/progs/samples/SConscript new file mode 100644 index 0000000000..7a8a0d62d8 --- /dev/null +++ b/progs/samples/SConscript @@ -0,0 +1,58 @@ +Import('*') + +if not env['GLUT']: + Return() + +env = env.Clone() + +env.Prepend(CPPPATH = [ + '../util', +]) + +env.Prepend(LIBS = [ + util, + '$GLUT_LIB' +]) + +if env['platform'] == 'windows': + env.Append(CPPDEFINES = ['NOMINMAX']) + env.Prepend(LIBS = ['winmm']) + +progs = [ + 'accum', + 'bitmap1', + 'bitmap2', + 'blendeq', + 'blendxor', + 'copy', + 'cursor', + 'depth', + 'eval', + 'fog', + 'font', + 'line', + 'logo', + 'nurb', + #'oglinfo', + 'olympic', + 'overlay', + 'point', + 'prim', + 'quad', + 'rgbtoppm', + 'select', + 'shape', + 'sphere', + 'star', + 'stencil', + 'stretch', + 'texture', + 'tri', + 'wave', +] + +for prog in progs: + env.Program( + target = prog, + source = prog + '.c', + ) diff --git a/progs/samples/blendeq.c b/progs/samples/blendeq.c index d5143ecdf5..cd0474c5ce 100644 --- a/progs/samples/blendeq.c +++ b/progs/samples/blendeq.c @@ -11,10 +11,7 @@ #include #include #include -#ifdef _WIN32 -#include -#endif -#define GL_GLEXT_PROTOTYPES +#include #include GLenum doubleBuffer; @@ -274,6 +271,8 @@ int main(int argc, char **argv) exit(1); } + glewInit(); + /* Make sure blend_logic_op extension is there. */ s = (char *) glGetString(GL_EXTENSIONS); version = (char*) glGetString(GL_VERSION); diff --git a/progs/samples/blendxor.c b/progs/samples/blendxor.c index 5bc4aa9bea..057143651f 100644 --- a/progs/samples/blendxor.c +++ b/progs/samples/blendxor.c @@ -10,13 +10,8 @@ #include #endif #include -#ifdef _WIN32 -#include -#endif -#define GL_GLEXT_LEGACY -#define GL_GLEXT_PROTOTYPES +#include #include -#include GLenum doubleBuffer; @@ -176,6 +171,8 @@ int main(int argc, char **argv) exit(1); } + glewInit(); + /* Make sure blend_logic_op extension is there. */ s = (char *) glGetString(GL_EXTENSIONS); version = (char*) glGetString(GL_VERSION); -- cgit v1.2.3 From 96c773c77bf50140e7380d1358fd4528241719e8 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Sat, 14 Feb 2009 01:05:13 +0100 Subject: progs: Make fp-tri use glew and add scons target --- progs/SConscript | 1 + progs/fp/Makefile | 2 +- progs/fp/SConscript | 13 +++++++++++++ progs/fp/fp-tri.c | 16 +++++++++++++--- 4 files changed, 28 insertions(+), 4 deletions(-) create mode 100644 progs/fp/SConscript (limited to 'progs/SConscript') diff --git a/progs/SConscript b/progs/SConscript index 6484c761fc..544ea64750 100644 --- a/progs/SConscript +++ b/progs/SConscript @@ -5,4 +5,5 @@ SConscript([ 'samples/SConscript', 'trivial/SConscript', 'vp/SConscript', + 'fp/SConscript', ]) diff --git a/progs/fp/Makefile b/progs/fp/Makefile index ef6644cce2..681928cf26 100755 --- a/progs/fp/Makefile +++ b/progs/fp/Makefile @@ -8,7 +8,7 @@ TOP = ../.. include $(TOP)/configs/current -LIBS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) $(APP_LIB_DEPS) +LIBS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLEW_LIB) -l$(GLU_LIB) -l$(GL_LIB) $(APP_LIB_DEPS) SOURCES = \ tri-tex.c \ diff --git a/progs/fp/SConscript b/progs/fp/SConscript new file mode 100644 index 0000000000..e31fa32023 --- /dev/null +++ b/progs/fp/SConscript @@ -0,0 +1,13 @@ +Import('env') + +if not env['GLUT']: + Return() + +env = env.Clone() + +env.Prepend(LIBS = ['$GLUT_LIB']) + +env.Program( + target = 'fp-tri', + source = ['fp-tri.c'], + ) diff --git a/progs/fp/fp-tri.c b/progs/fp/fp-tri.c index 843f897871..b695901bcd 100644 --- a/progs/fp/fp-tri.c +++ b/progs/fp/fp-tri.c @@ -2,10 +2,14 @@ #include #include #include -#define GL_GLEXT_PROTOTYPES -#include + +#ifndef WIN32 #include #include +#endif + +#include +#include unsigned show_fps = 0; unsigned int frame_cnt = 0; @@ -15,11 +19,14 @@ static const char *filename = NULL; static void usage(char *name) { fprintf(stderr, "usage: %s [ options ] shader_filename\n", name); +#ifndef WIN32 fprintf(stderr, "\n" ); fprintf(stderr, "options:\n"); fprintf(stderr, " -fps show frames per second\n"); +#endif } +#ifndef WIN32 void alarmhandler (int sig) { if (sig == SIGALRM) { @@ -31,6 +38,7 @@ void alarmhandler (int sig) signal(SIGALRM, alarmhandler); alarm(5); } +#endif static void args(int argc, char *argv[]) { @@ -142,7 +150,6 @@ static void Display(void) glEnd(); glFlush(); - if (show_fps) { ++frame_cnt; glutPostRedisplay(); @@ -158,14 +165,17 @@ int main(int argc, char **argv) glutInitDisplayMode(GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH); args(argc, argv); glutCreateWindow(filename); + glewInit(); glutReshapeFunc(Reshape); glutKeyboardFunc(Key); glutDisplayFunc(Display); Init(); +#ifndef WIN32 if (show_fps) { signal(SIGALRM, alarmhandler); alarm(5); } +#endif glutMainLoop(); return 0; } -- cgit v1.2.3 From ce0ac9006a4ceb42d7f07061f264e3092d03e640 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Mon, 9 Mar 2009 17:10:12 +0000 Subject: vpglsl: build with scons and glew --- progs/SConscript | 1 + progs/vpglsl/Makefile | 2 +- progs/vpglsl/vp-tris.c | 48 ++++++++++++++++++++++++++---------------------- 3 files changed, 28 insertions(+), 23 deletions(-) (limited to 'progs/SConscript') diff --git a/progs/SConscript b/progs/SConscript index 544ea64750..1670f97bc7 100644 --- a/progs/SConscript +++ b/progs/SConscript @@ -5,5 +5,6 @@ SConscript([ 'samples/SConscript', 'trivial/SConscript', 'vp/SConscript', + 'vpglsl/SConscript', 'fp/SConscript', ]) diff --git a/progs/vpglsl/Makefile b/progs/vpglsl/Makefile index 313b4dfa22..3982aca565 100644 --- a/progs/vpglsl/Makefile +++ b/progs/vpglsl/Makefile @@ -7,7 +7,7 @@ TOP = ../.. include $(TOP)/configs/current -LIBS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) $(APP_LIB_DEPS) +LIBS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLEW_LIB) -l$(GLU_LIB) -l$(GL_LIB) $(APP_LIB_DEPS) SOURCES = \ vp-tris.c diff --git a/progs/vpglsl/vp-tris.c b/progs/vpglsl/vp-tris.c index 9108d3f197..9ae410bf98 100644 --- a/progs/vpglsl/vp-tris.c +++ b/progs/vpglsl/vp-tris.c @@ -4,7 +4,8 @@ #include #include #include -#define GL_GLEXT_PROTOTYPES + +#include #include static const char *filename = NULL; @@ -99,27 +100,29 @@ static void setup_uniforms() } - GLuint loc1f = glGetUniformLocationARB(program, "KernelValue1f"); - GLuint loc2f = glGetUniformLocationARB(program, "KernelValue2f"); - GLuint loc4f = glGetUniformLocationARB(program, "KernelValue4f"); - GLfloat vecKer[] = - { 1.0, 0.0, 0.0, 0.25, - 0.0, 1.0, 0.0, 0.25, - 0.0, 0.0, 1.0, 0.25, - 0.0, 0.0, 0.0, 0.25, - 0.5, 0.0, 0.0, 0.35, - 0.0, 0.5, 0.0, 0.35, - 0.0, 0.0, 0.5, 0.35, - 0.0, 0.0, 0.0, 0.35 - }; - if (loc1f >= 0) - glUniform1fv(loc1f, 16, vecKer); - - if (loc2f >= 0) - glUniform2fv(loc2f, 8, vecKer); - - if (loc4f >= 0) - glUniform4fv(loc4f, 4, vecKer); + { + GLuint loc1f = glGetUniformLocationARB(program, "KernelValue1f"); + GLuint loc2f = glGetUniformLocationARB(program, "KernelValue2f"); + GLuint loc4f = glGetUniformLocationARB(program, "KernelValue4f"); + GLfloat vecKer[] = + { 1.0, 0.0, 0.0, 0.25, + 0.0, 1.0, 0.0, 0.25, + 0.0, 0.0, 1.0, 0.25, + 0.0, 0.0, 0.0, 0.25, + 0.5, 0.0, 0.0, 0.35, + 0.0, 0.5, 0.0, 0.35, + 0.0, 0.0, 0.5, 0.35, + 0.0, 0.0, 0.0, 0.35 + }; + if (loc1f >= 0) + glUniform1fv(loc1f, 16, vecKer); + + if (loc2f >= 0) + glUniform2fv(loc2f, 8, vecKer); + + if (loc4f >= 0) + glUniform4fv(loc4f, 4, vecKer); + } } static void prepare_shaders() @@ -303,6 +306,7 @@ int main( int argc, char *argv[] ) glutInitWindowSize( 250, 250 ); glutInitDisplayMode( GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH ); glutCreateWindow(argv[0]); + glewInit(); glutReshapeFunc( Reshape ); glutKeyboardFunc( Key ); glutDisplayFunc( Display ); -- 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/SConscript') 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 From 1f118c2557e44b294f12ddc3e298be6caaa3efb4 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Wed, 18 Mar 2009 16:37:20 +0000 Subject: progs: Build the wgl examples with scons. --- progs/SConscript | 1 + progs/wgl/SConscript | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 progs/wgl/SConscript (limited to 'progs/SConscript') diff --git a/progs/SConscript b/progs/SConscript index 71db2831d6..71ebe5e0f3 100644 --- a/progs/SConscript +++ b/progs/SConscript @@ -8,4 +8,5 @@ SConscript([ 'vp/SConscript', 'vpglsl/SConscript', 'fp/SConscript', + 'wgl/SConscript', ]) diff --git a/progs/wgl/SConscript b/progs/wgl/SConscript new file mode 100644 index 0000000000..b7cf35b7fc --- /dev/null +++ b/progs/wgl/SConscript @@ -0,0 +1,23 @@ +Import('*') + +if env['platform'] != 'windows': + Return() + +env = env.Clone() + +env.Append(LIBS = [ + 'kernel32', + 'user32', + 'gdi32', +]) + +progs = [ + 'sharedtex_mt', + 'wglthreads', +] + +for prog in progs: + env.Program( + target = prog, + source = prog + '/' + prog + '.c', + ) -- cgit v1.2.3 From b799af91d5ffbee1481161fec29eb4c92b161272 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Mon, 29 Jun 2009 14:13:58 +0100 Subject: progs/glsl: compile with scons and glew Get most of these working with scons. --- progs/SConscript | 1 + progs/glsl/SConscript | 55 ++++++++++++++++++++++++++++++++++++++++++ progs/glsl/array.c | 3 ++- progs/glsl/bitmap.c | 2 ++ progs/glsl/brick.c | 2 ++ progs/glsl/bump.c | 1 + progs/glsl/convolutions.c | 3 +++ progs/glsl/deriv.c | 2 ++ progs/glsl/fragcoord.c | 2 ++ progs/glsl/identity.c | 2 ++ progs/glsl/linktest.c | 2 ++ progs/glsl/mandelbrot.c | 2 ++ progs/glsl/multinoise.c | 2 ++ progs/glsl/multitex.c | 2 ++ progs/glsl/noise.c | 2 ++ progs/glsl/pointcoord.c | 2 ++ progs/glsl/points.c | 2 ++ progs/glsl/samplers.c | 2 ++ progs/glsl/shadow_sampler.c | 2 ++ progs/glsl/skinning.c | 2 ++ progs/glsl/texaaline.c | 2 ++ progs/glsl/texdemo1.c | 2 ++ progs/glsl/toyball.c | 2 ++ progs/glsl/trirast.c | 2 ++ progs/glsl/twoside.c | 2 ++ progs/glsl/vert-or-frag-only.c | 2 ++ progs/glsl/vert-tex.c | 2 ++ 27 files changed, 106 insertions(+), 1 deletion(-) create mode 100644 progs/glsl/SConscript (limited to 'progs/SConscript') diff --git a/progs/SConscript b/progs/SConscript index 71ebe5e0f3..620dd30e69 100644 --- a/progs/SConscript +++ b/progs/SConscript @@ -1,6 +1,7 @@ SConscript([ 'util/SConscript', 'demos/SConscript', + 'glsl/SConscript', 'redbook/SConscript', 'samples/SConscript', 'tests/SConscript', diff --git a/progs/glsl/SConscript b/progs/glsl/SConscript new file mode 100644 index 0000000000..7a4549cd70 --- /dev/null +++ b/progs/glsl/SConscript @@ -0,0 +1,55 @@ +Import('*') + +if not env['GLUT']: + Return() + +env = env.Clone() + +env.Prepend(CPPPATH = [ + '../util', +]) + +env.Prepend(LIBS = [ + util, + '$GLUT_LIB' +]) + +if env['platform'] == 'windows': + env.Append(CPPDEFINES = ['NOMINMAX']) + env.Prepend(LIBS = ['winmm']) + +progs = [ + 'array', + 'bitmap', + 'brick', + 'bump', + 'convolutions', + 'deriv', + 'fragcoord', + 'identity', + 'linktest', + 'mandelbrot', + 'multinoise', + 'multitex', + 'noise', + 'noise2', + 'pointcoord', + 'points', + 'samplers', + 'shadow_sampler', + 'skinning', + 'texaaline', + 'texdemo1', + 'toyball', + 'trirast', + 'twoside', + 'vert-or-frag-only', + 'vert-tex', +] + +for prog in progs: + env.Program( + target = prog, + source = prog + '.c', + ) + diff --git a/progs/glsl/array.c b/progs/glsl/array.c index 46ef8043bc..6da15b2fcc 100644 --- a/progs/glsl/array.c +++ b/progs/glsl/array.c @@ -9,9 +9,9 @@ #include #include #include +#include #include #include -#include #include "extfuncs.h" #include "shaderutil.h" @@ -248,6 +248,7 @@ main(int argc, char *argv[]) glutInitWindowSize(500, 500); glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH); win = glutCreateWindow(argv[0]); + glewInit(); glutReshapeFunc(Reshape); glutKeyboardFunc(Key); glutSpecialFunc(SpecialKey); diff --git a/progs/glsl/bitmap.c b/progs/glsl/bitmap.c index d488ec6cb9..08fac15c89 100644 --- a/progs/glsl/bitmap.c +++ b/progs/glsl/bitmap.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -309,6 +310,7 @@ main(int argc, char *argv[]) glutInitWindowSize(WinWidth, WinHeight); glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH); Win = glutCreateWindow(argv[0]); + glewInit(); glutReshapeFunc(Reshape); glutKeyboardFunc(Key); glutSpecialFunc(SpecialKey); diff --git a/progs/glsl/brick.c b/progs/glsl/brick.c index 526ef0e2e3..607acd0597 100644 --- a/progs/glsl/brick.c +++ b/progs/glsl/brick.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -191,6 +192,7 @@ main(int argc, char *argv[]) glutInitWindowSize(400, 400); glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH); win = glutCreateWindow(argv[0]); + glewInit(); glutReshapeFunc(Reshape); glutKeyboardFunc(Key); glutSpecialFunc(SpecialKey); diff --git a/progs/glsl/bump.c b/progs/glsl/bump.c index 0ea1f8331f..c401e590f7 100644 --- a/progs/glsl/bump.c +++ b/progs/glsl/bump.c @@ -288,6 +288,7 @@ main(int argc, char *argv[]) glutInitWindowSize(400, 400); glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH); win = glutCreateWindow(argv[0]); + glewInit(); glutReshapeFunc(Reshape); glutKeyboardFunc(Key); glutSpecialFunc(SpecialKey); diff --git a/progs/glsl/convolutions.c b/progs/glsl/convolutions.c index ac71c68235..22ce7edcdc 100644 --- a/progs/glsl/convolutions.c +++ b/progs/glsl/convolutions.c @@ -5,6 +5,8 @@ * Author: Zack Rusin */ +#include + #define GL_GLEXT_PROTOTYPES #include "readtex.h" @@ -455,6 +457,7 @@ int main(int argc, char **argv) exit(1); } + glewInit(); init(); glutReshapeFunc(reshape); diff --git a/progs/glsl/deriv.c b/progs/glsl/deriv.c index e69f0b82c4..3fd674c331 100644 --- a/progs/glsl/deriv.c +++ b/progs/glsl/deriv.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -228,6 +229,7 @@ main(int argc, char *argv[]) glutInitWindowSize(200, 200); glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH); win = glutCreateWindow(argv[0]); + glewInit(); glutReshapeFunc(Reshape); glutKeyboardFunc(Key); glutSpecialFunc(SpecialKey); diff --git a/progs/glsl/fragcoord.c b/progs/glsl/fragcoord.c index 0b7561f3e4..509ad47e7f 100644 --- a/progs/glsl/fragcoord.c +++ b/progs/glsl/fragcoord.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -174,6 +175,7 @@ main(int argc, char *argv[]) glutInitWindowSize(WinWidth, WinHeight); glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE); win = glutCreateWindow(argv[0]); + glewInit(); glutReshapeFunc(Reshape); glutKeyboardFunc(Key); glutDisplayFunc(Redisplay); diff --git a/progs/glsl/identity.c b/progs/glsl/identity.c index 37579eb346..5ba7468cc4 100644 --- a/progs/glsl/identity.c +++ b/progs/glsl/identity.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -195,6 +196,7 @@ main(int argc, char *argv[]) glutInitWindowSize(200, 200); glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH); win = glutCreateWindow(argv[0]); + glewInit(); glutReshapeFunc(Reshape); glutKeyboardFunc(Key); glutSpecialFunc(SpecialKey); diff --git a/progs/glsl/linktest.c b/progs/glsl/linktest.c index 988d082341..fe5d1564e0 100644 --- a/progs/glsl/linktest.c +++ b/progs/glsl/linktest.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -245,6 +246,7 @@ main(int argc, char *argv[]) glutInitWindowSize(300, 300); glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH); Win = glutCreateWindow(argv[0]); + glewInit(); glutReshapeFunc(Reshape); glutKeyboardFunc(Key); glutDisplayFunc(Redisplay); diff --git a/progs/glsl/mandelbrot.c b/progs/glsl/mandelbrot.c index 24e1992665..eeea4eb52a 100644 --- a/progs/glsl/mandelbrot.c +++ b/progs/glsl/mandelbrot.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -206,6 +207,7 @@ main(int argc, char *argv[]) glutInitWindowSize(400, 400); glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH); win = glutCreateWindow(argv[0]); + glewInit(); glutReshapeFunc(Reshape); glutKeyboardFunc(Key); glutSpecialFunc(SpecialKey); diff --git a/progs/glsl/multinoise.c b/progs/glsl/multinoise.c index 2351863aff..400511508e 100644 --- a/progs/glsl/multinoise.c +++ b/progs/glsl/multinoise.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -270,6 +271,7 @@ main(int argc, char *argv[]) glutInitWindowSize(400, 400); glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH); win = glutCreateWindow(argv[0]); + glewInit(); glutReshapeFunc(Reshape); glutKeyboardFunc(Key); glutSpecialFunc(SpecialKey); diff --git a/progs/glsl/multitex.c b/progs/glsl/multitex.c index bbf58af055..724f15e1a3 100644 --- a/progs/glsl/multitex.c +++ b/progs/glsl/multitex.c @@ -28,6 +28,7 @@ #include #include #include +#include #include "GL/glut.h" #include "readtex.h" #include "extfuncs.h" @@ -334,6 +335,7 @@ main(int argc, char *argv[]) glutInitWindowSize(500, 400); glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE); glutCreateWindow(Demo); + glewInit(); glutReshapeFunc(Reshape); glutKeyboardFunc(key); glutSpecialFunc(specialkey); diff --git a/progs/glsl/noise.c b/progs/glsl/noise.c index bd8f50036b..83e4696fc9 100644 --- a/progs/glsl/noise.c +++ b/progs/glsl/noise.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -207,6 +208,7 @@ main(int argc, char *argv[]) glutInitWindowSize(400, 400); glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH); win = glutCreateWindow(argv[0]); + glewInit(); glutReshapeFunc(Reshape); glutKeyboardFunc(Key); glutSpecialFunc(SpecialKey); diff --git a/progs/glsl/pointcoord.c b/progs/glsl/pointcoord.c index b240077c25..aa01e2166d 100644 --- a/progs/glsl/pointcoord.c +++ b/progs/glsl/pointcoord.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -195,6 +196,7 @@ main(int argc, char *argv[]) glutInitWindowSize(WinWidth, WinHeight); glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE); win = glutCreateWindow(argv[0]); + glewInit(); glutReshapeFunc(Reshape); glutKeyboardFunc(Key); glutDisplayFunc(Redisplay); diff --git a/progs/glsl/points.c b/progs/glsl/points.c index 392dc4db85..1b346228aa 100644 --- a/progs/glsl/points.c +++ b/progs/glsl/points.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -248,6 +249,7 @@ main(int argc, char *argv[]) glutInitWindowSize(WinWidth, WinHeight); glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH); Win = glutCreateWindow(argv[0]); + glewInit(); glutReshapeFunc(Reshape); glutKeyboardFunc(Key); glutSpecialFunc(SpecialKey); diff --git a/progs/glsl/samplers.c b/progs/glsl/samplers.c index 3fb8577d5e..cbb264dad1 100644 --- a/progs/glsl/samplers.c +++ b/progs/glsl/samplers.c @@ -39,6 +39,7 @@ #include #include #include +#include #include "GL/glut.h" #include "readtex.h" #include "extfuncs.h" @@ -357,6 +358,7 @@ main(int argc, char *argv[]) glutInitWindowSize(500, 400); glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE); glutCreateWindow(Demo); + glewInit(); glutReshapeFunc(Reshape); glutKeyboardFunc(key); glutSpecialFunc(specialkey); diff --git a/progs/glsl/shadow_sampler.c b/progs/glsl/shadow_sampler.c index 2902b53552..673ad465ad 100644 --- a/progs/glsl/shadow_sampler.c +++ b/progs/glsl/shadow_sampler.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -329,6 +330,7 @@ main(int argc, char *argv[]) glutInitWindowSize(400, 300); glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE); win = glutCreateWindow(argv[0]); + glewInit(); glutReshapeFunc(Reshape); glutKeyboardFunc(Key); glutDisplayFunc(Redisplay); diff --git a/progs/glsl/skinning.c b/progs/glsl/skinning.c index 8a65d0667c..d7b968fed0 100644 --- a/progs/glsl/skinning.c +++ b/progs/glsl/skinning.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -266,6 +267,7 @@ main(int argc, char *argv[]) glutInitWindowSize(500, 500); glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH); win = glutCreateWindow(argv[0]); + glewInit(); glutReshapeFunc(Reshape); glutKeyboardFunc(Key); glutSpecialFunc(SpecialKey); diff --git a/progs/glsl/texaaline.c b/progs/glsl/texaaline.c index 0b3cc84958..6720941a6e 100644 --- a/progs/glsl/texaaline.c +++ b/progs/glsl/texaaline.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -359,6 +360,7 @@ main(int argc, char *argv[]) glutInitWindowSize(WinWidth, WinHeight); glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE); win = glutCreateWindow(argv[0]); + glewInit(); glutReshapeFunc(Reshape); glutKeyboardFunc(Key); glutDisplayFunc(Redisplay); diff --git a/progs/glsl/texdemo1.c b/progs/glsl/texdemo1.c index 96ddca1f32..08a87a5152 100644 --- a/progs/glsl/texdemo1.c +++ b/progs/glsl/texdemo1.c @@ -28,6 +28,7 @@ #include #include #include +#include #include "GL/glut.h" #include "readtex.h" #include "extfuncs.h" @@ -426,6 +427,7 @@ main(int argc, char *argv[]) glutInitWindowSize(500, 400); glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE); win = glutCreateWindow(Demo); + glewInit(); glutReshapeFunc(Reshape); glutKeyboardFunc(key); glutSpecialFunc(specialkey); diff --git a/progs/glsl/toyball.c b/progs/glsl/toyball.c index 37ad6bf291..2b644acb6d 100644 --- a/progs/glsl/toyball.c +++ b/progs/glsl/toyball.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -212,6 +213,7 @@ main(int argc, char *argv[]) glutInitWindowSize(400, 400); glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH); win = glutCreateWindow(argv[0]); + glewInit(); glutReshapeFunc(Reshape); glutKeyboardFunc(Key); glutSpecialFunc(SpecialKey); diff --git a/progs/glsl/trirast.c b/progs/glsl/trirast.c index 89df64fc71..3d4decaa2f 100644 --- a/progs/glsl/trirast.c +++ b/progs/glsl/trirast.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -247,6 +248,7 @@ main(int argc, char *argv[]) glutInitWindowSize(WinWidth, WinHeight); glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH); win = glutCreateWindow(argv[0]); + glewInit(); glutReshapeFunc(Reshape); glutKeyboardFunc(Key); glutDisplayFunc(Redisplay); diff --git a/progs/glsl/twoside.c b/progs/glsl/twoside.c index 06488bd175..9ebc4ec360 100644 --- a/progs/glsl/twoside.c +++ b/progs/glsl/twoside.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -293,6 +294,7 @@ main(int argc, char *argv[]) glutInitWindowSize(WinWidth, WinHeight); glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE); win = glutCreateWindow(argv[0]); + glewInit(); glutReshapeFunc(Reshape); glutKeyboardFunc(Key); glutDisplayFunc(Redisplay); diff --git a/progs/glsl/vert-or-frag-only.c b/progs/glsl/vert-or-frag-only.c index f6eedd8327..8e1612aca4 100644 --- a/progs/glsl/vert-or-frag-only.c +++ b/progs/glsl/vert-or-frag-only.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -181,6 +182,7 @@ main(int argc, char *argv[]) glutInitWindowSize(400, 200); glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH); Win = glutCreateWindow(argv[0]); + glewInit(); glutReshapeFunc(Reshape); glutKeyboardFunc(Key); glutDisplayFunc(Redisplay); diff --git a/progs/glsl/vert-tex.c b/progs/glsl/vert-tex.c index 9d00a61054..b74bf50679 100644 --- a/progs/glsl/vert-tex.c +++ b/progs/glsl/vert-tex.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -266,6 +267,7 @@ main(int argc, char *argv[]) glutInitWindowSize(500, 500); glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH); win = glutCreateWindow(argv[0]); + glewInit(); glutReshapeFunc(Reshape); glutKeyboardFunc(Key); glutSpecialFunc(SpecialKey); -- cgit v1.2.3