progs/tests: compile with SCons and glew

Also get mingw cross-compilation of these tests working
This commit is contained in:
Keith Whitwell
2009-03-10 13:11:23 +00:00
parent 225de01f83
commit a58065d4e2
93 changed files with 344 additions and 78 deletions

View File

@@ -3,6 +3,7 @@ SConscript([
'demos/SConscript',
'redbook/SConscript',
'samples/SConscript',
'tests/SConscript',
'trivial/SConscript',
'vp/SConscript',
'vpglsl/SConscript',

133
progs/tests/SConscript Normal file
View File

@@ -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',
)

View File

@@ -11,7 +11,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define GL_GLEXT_PROTOTYPES
#include <GL/glew.h>
#include <GL/glut.h>
#include "readtex.h"
@@ -442,6 +442,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 300, 300 );
glutInitWindowPosition( 0, 0 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glewInit();
glutCreateWindow(argv[0] );
Init( argc, argv );

View File

@@ -9,6 +9,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <GL/glew.h>
#include <GL/glut.h>
@@ -29,7 +30,7 @@ PrintString(const char *s)
static void
Polygon( GLint verts, GLfloat radius, GLfloat z )
doPolygon( GLint verts, GLfloat radius, GLfloat z )
{
int i;
for (i = 0; i < verts; i++) {
@@ -47,33 +48,33 @@ DrawObject( void )
glLineWidth(3.0);
glColor3f(1, 1, 1);
glBegin(GL_LINE_LOOP);
Polygon(12, 1.2, 0);
doPolygon(12, 1.2, 0);
glEnd();
glLineWidth(1.0);
glColor3f(1, 1, 1);
glBegin(GL_LINE_LOOP);
Polygon(12, 1.1, 0);
doPolygon(12, 1.1, 0);
glEnd();
glColor3f(1, 0, 0);
glBegin(GL_POLYGON);
Polygon(12, 0.4, 0.3);
doPolygon(12, 0.4, 0.3);
glEnd();
glColor3f(0, 1, 0);
glBegin(GL_POLYGON);
Polygon(12, 0.6, 0.2);
doPolygon(12, 0.6, 0.2);
glEnd();
glColor3f(0, 0, 1);
glBegin(GL_POLYGON);
Polygon(12, 0.8, 0.1);
doPolygon(12, 0.8, 0.1);
glEnd();
glColor3f(1, 1, 1);
glBegin(GL_POLYGON);
Polygon(12, 1.0, 0);
doPolygon(12, 1.0, 0);
glEnd();
}
@@ -225,6 +226,7 @@ main( int argc, char *argv[] )
glutInitDisplayMode( GLUT_RGB | GLUT_ALPHA | GLUT_DOUBLE |
GLUT_DEPTH | GLUT_MULTISAMPLE );
glutCreateWindow(argv[0]);
glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );

View File

@@ -37,9 +37,7 @@
#include <stdio.h>
#include <stdlib.h>
#define GL_GLEXT_PROTOTYPES
#include <GL/gl.h>
#include <GL/glext.h>
#include <GL/glew.h>
#include <GL/glut.h>
#define inline __inline__
@@ -127,6 +125,7 @@ int main( int argc, char *argv[] )
glutInitDisplayMode( GLUT_RGB );
glutCreateWindow( argv[0] );
glewInit();
if ( argc > 1 ) {
count = strtoul( argv[1], NULL, 0 );

View File

@@ -8,7 +8,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define GL_GLEXT_PROTOTYPES
#include <GL/glew.h>
#include <GL/glut.h>
static float Xrot = 0.0, Yrot = 0.0, Zrot = 0.0;
@@ -180,6 +180,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );

View File

@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define GL_GLEXT_PROTOTYPES
#include <GL/glew.h>
#include <GL/glut.h>
@@ -201,6 +201,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );

View File

@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define GL_GLEXT_PROTOTYPES
#include <GL/glew.h>
#include <GL/glut.h>
#include "readtex.c"
@@ -143,6 +143,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );

View File

@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define GL_GLEXT_PROTOTYPES
#include <GL/glew.h>
#include <GL/glut.h>
#include "readtex.c"
@@ -146,6 +146,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );

View File

@@ -46,6 +46,7 @@
*/
#include <stdlib.h>
#include <stdio.h>
#include <GL/glew.h>
#include <GL/glut.h>
GLubyte mipmapImage32[40][46][3];
@@ -175,6 +176,7 @@ int main(int argc, char** argv)
glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB | GLUT_DEPTH);
glutInitWindowSize (500, 500);
glutCreateWindow (argv[0]);
glewInit();
myinit();
glutReshapeFunc (myReshape);
glutDisplayFunc(display);

View File

@@ -8,6 +8,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <GL/glew.h>
#include <GL/glut.h>
#include "../util/readtex.c"
@@ -188,6 +189,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 400, 400 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );

View File

@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define GL_GLEXT_PROTOTYPES
#include <GL/glew.h>
#include <GL/glut.h>
static void Display( void )
@@ -155,6 +155,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );

View File

@@ -4,7 +4,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define GL_GLEXT_PROTOTYPES
#include <GL/glew.h>
#include <GL/glut.h>
static float Zrot = 0.0;
@@ -118,6 +118,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );

View File

@@ -7,7 +7,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define GL_GLEXT_PROTOTYPES
#include <GL/glew.h>
#include <GL/glut.h>
static float Xrot = 0.0, Yrot = 0.0, Zrot = 0.0;
@@ -174,6 +174,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );

View File

@@ -7,7 +7,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define GL_GLEXT_PROTOTYPES
#include <GL/glew.h>
#include <GL/glut.h>
static float Xrot = -60.0, Yrot = 0.0, Zrot = 0.0;
@@ -234,6 +234,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );

View File

@@ -34,6 +34,7 @@
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <GL/glew.h>
#include <GL/glut.h>
#include <GL/glext.h>
@@ -326,6 +327,7 @@ int main(int argc, char *argv[])
glutInitWindowSize(350, 350);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
glutCreateWindow("Array texture test");
glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);

View File

@@ -34,6 +34,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <GL/glew.h>
#include <GL/glut.h>
static int Width = 400;
@@ -200,6 +201,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( Width, Height );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow( "GL_EXT_blend_minmax test" );
glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );

View File

@@ -34,6 +34,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <GL/glew.h>
#include <GL/glut.h>
static int Width = 400;
@@ -169,6 +170,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( Width, Height );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow( "GL_NV_blend_square test" );
glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );

View File

@@ -3,10 +3,10 @@
*
*/
#define GL_GLEXT_PROTOTYPES
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <GL/glew.h>
#include <GL/glut.h>
#include "readtex.c"
@@ -183,6 +183,7 @@ main(int argc, char *argv[])
glutInitWindowSize(Width, Height);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
Win = glutCreateWindow(argv[0]);
glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);

View File

@@ -6,11 +6,11 @@
*/
#define GL_GLEXT_PROTOTYPES
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <GL/glew.h>
#include <GL/glut.h>
#define NUM_OBJECTS 10
@@ -428,6 +428,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 600, 300 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
Win = glutCreateWindow(argv[0]);
glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );

View File

@@ -39,6 +39,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <GL/glew.h>
#include <GL/glut.h>
static int Width = 400;
@@ -154,6 +155,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( Width, Height );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow( "Bug #3050 Test" );
glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );

View File

@@ -34,6 +34,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <GL/glew.h>
#include <GL/glut.h>
static int Width = 400;
@@ -119,6 +120,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( Width, Height );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow( "Bug #3101 Test" );
glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );

View File

@@ -36,6 +36,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <GL/glew.h>
#include <GL/glut.h>
#include <GL/glext.h>
@@ -264,6 +265,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 350, 350 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow( "Bug #3195 Test" );
glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );

View File

@@ -29,6 +29,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <GL/glew.h>
#include <GL/glut.h>
static GLenum Target = GL_TEXTURE_2D;
@@ -180,6 +181,7 @@ int main(int argc, char **argv)
glutInitDisplayMode(type);
win = glutCreateWindow("Tex test");
glewInit();
if (!win) {
exit(1);
}

View File

@@ -19,6 +19,7 @@
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <GL/glew.h>
#include <GL/glut.h>
@@ -386,6 +387,7 @@ main(int argc, char *argv[])
glutInitWindowSize(Width, Height);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
Win = glutCreateWindow(argv[0]);
glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Draw);

View File

@@ -5,11 +5,11 @@
* 26 Jan 2006
*/
#define GL_GLEXT_PROTOTYPES
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <GL/glew.h>
#include <GL/glut.h>
static GLint WinWidth = 1000, WinHeight = 800;
@@ -260,6 +260,7 @@ main(int argc, char *argv[])
glutInitWindowSize(WinWidth, WinHeight);
glutInitDisplayMode(mode);
glutCreateWindow(argv[0]);
glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);

View File

@@ -35,6 +35,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <GL/glew.h>
#include <GL/glut.h>
static const GLint tests[][8] = {
@@ -226,6 +227,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( Width, Height );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow( "GL_ARB_texture_env_crossbar test" );
glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );

View File

@@ -15,6 +15,7 @@
#include <windows.h>
#endif
#define GL_GLEXT_LEGACY
#include <GL/glew.h>
#include <GL/glut.h>
#include <GL/glext.h>
@@ -129,6 +130,7 @@ int main( int argc, char **argv )
glutInitWindowSize( 250, 250 );
glutInitWindowPosition( 100, 100 );
glutCreateWindow( "CVA Test" );
glewInit();
/* Make sure the server supports GL 1.2 vertex arrays.
*/

View File

@@ -9,7 +9,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define GL_GLEXT_PROTOTYPES
#include <GL/glew.h>
#include <GL/glut.h>
@@ -81,6 +81,7 @@ find_line_column(const GLubyte *string, const GLubyte *pos,
#define NV_FRAGMENT_PROGRAM 4
struct breakpoint {
enum {PIXEL, LINE} type;
int x, y;
@@ -101,7 +102,7 @@ static void Debugger2(GLenum target, GLvoid *data)
{
static GLuint skipCount = 0;
const GLubyte *ln;
GLint pos, line, column;
GLint pos = 0, line, column;
GLint id;
int progType;
GLint len;
@@ -721,6 +722,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 200, 200 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );

View File

@@ -43,6 +43,7 @@
#include <windows.h>
#endif
#define GL_GLEXT_LEGACY
#include <GL/glew.h> /* OpenGL Utility Toolkit header */
#include <GL/glut.h> /* OpenGL Utility Toolkit header */
/* Some <math.h> files do not define M_PI... */
@@ -823,6 +824,7 @@ main(int argc, char **argv)
#endif
glutCreateWindow("Shadowy Leapin' Lizards");
glewInit();
if (glutGet(GLUT_WINDOW_STENCIL_SIZE) <= 1) {
printf("dinoshade: Sorry, I need at least 2 bits of stencil.\n");

View File

@@ -7,11 +7,11 @@
*/
#define GL_GLEXT_PROTOTYPES
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <GL/glew.h>
#include <GL/glut.h>
#include "extfuncs.h"
@@ -294,6 +294,7 @@ main(int argc, char *argv[])
glutInitWindowSize(Width, Height);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
Win = glutCreateWindow(argv[0]);
glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Display);

View File

@@ -26,6 +26,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <GL/glew.h>
#include <GL/glut.h>
static int Width = 400, Height = 400;
@@ -34,14 +35,14 @@ static float Xtrans = 0, Ytrans = 0;
static float Step = 0.125;
enum {
POINTS,
HLINES,
VLINES,
QUADS,
MODE_POINTS,
MODE_HLINES,
MODE_VLINES,
MODE_QUADS,
NUM_MODES
};
static int Mode = POINTS;
static int Mode = MODE_POINTS;
static void
@@ -58,7 +59,7 @@ Draw(void)
glPushMatrix();
glTranslatef(tx + Xtrans, ty + Ytrans, 0);
if (Mode == POINTS) {
if (Mode == MODE_POINTS) {
glBegin(GL_POINTS);
for (j = 0; j < Height; j += 2) {
for (i = 0; i < Width; i += 2) {
@@ -67,7 +68,7 @@ Draw(void)
}
glEnd();
}
else if (Mode == HLINES) {
else if (Mode == MODE_HLINES) {
glBegin(GL_LINES);
for (i = 0; i < Height; i += 2) {
glVertex2f(0, i);
@@ -75,7 +76,7 @@ Draw(void)
}
glEnd();
}
else if (Mode == VLINES) {
else if (Mode == MODE_VLINES) {
glBegin(GL_LINES);
for (i = 0; i < Width; i += 2) {
glVertex2f(i, 0 );
@@ -83,7 +84,7 @@ Draw(void)
}
glEnd();
}
else if (Mode == QUADS) {
else if (Mode == MODE_QUADS) {
glBegin(GL_QUADS);
for (j = 0; j < Height; j += 4) {
for (i = 0; i < Width; i += 4) {
@@ -189,6 +190,7 @@ main(int argc, char *argv[])
glutInitWindowSize(Width, Height);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
Win = glutCreateWindow(argv[0]);
glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);

View File

@@ -12,7 +12,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define GL_GLEXT_PROTOTYPES
#include <GL/glew.h>
#include <GL/glut.h>
#include <assert.h>
@@ -249,6 +249,7 @@ int main( int argc, char *argv[] )
glutInitWindowPosition( 0, 0 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow(argv[0] );
glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );

View File

@@ -6,11 +6,11 @@
*/
#define GL_GLEXT_PROTOTYPES
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <GL/glew.h>
#include <GL/glut.h>
static int Win;
@@ -202,6 +202,7 @@ main( int argc, char *argv[] )
glutInitWindowSize(Width, Height);
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
Win = glutCreateWindow(argv[0]);
glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );

View File

@@ -6,11 +6,11 @@
*/
#define GL_GLEXT_PROTOTYPES
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <GL/glew.h>
#include <GL/glut.h>
static int Win = 0;
@@ -191,6 +191,7 @@ main( int argc, char *argv[] )
glutInitWindowSize(Width, Height);
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
Win = glutCreateWindow(argv[0]);
glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );

View File

@@ -9,7 +9,7 @@
*/
#define GL_GLEXT_PROTOTYPES
#include <GL/glew.h>
#include <GL/glut.h>
#include <assert.h>
#include <stdio.h>
@@ -605,6 +605,7 @@ main(int argc, char *argv[])
glutInitWindowSize(Width, Height);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
Win = glutCreateWindow(argv[0]);
glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Display);

View File

@@ -6,10 +6,10 @@
*/
#define GL_GLEXT_PROTOTYPES
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <GL/glew.h>
#include <GL/glut.h>
#include "readtex.h"
@@ -194,6 +194,7 @@ main(int argc, char *argv[])
glutInitWindowSize(Width, Height);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
Win = glutCreateWindow(argv[0]);
glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Draw);

View File

@@ -8,6 +8,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <GL/glew.h>
#include <GL/glut.h>
#include "extfuncs.h"
#include "readtex.h"
@@ -230,6 +231,7 @@ main(int argc, char *argv[])
glutInitWindowSize(400, 400);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
glutCreateWindow(argv[0]);
glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Draw);

View File

@@ -30,10 +30,10 @@
* Test to exercise fog modes and for comparison with GL_EXT_fog_coord.
*/
#define GL_GLEXT_PROTOTYPES
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <GL/glew.h>
#include <GL/glut.h>
static int Width = 600;
@@ -190,6 +190,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( Width, Height );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );

View File

@@ -3,10 +3,10 @@
*/
#define GL_GLEXT_PROTOTYPES
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <GL/glew.h>
#include <GL/glut.h>
static int Width = 600;
@@ -93,6 +93,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( Width, Height );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );

View File

@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define GL_GLEXT_PROTOTYPES
#include <GL/glew.h>
#include <GL/glut.h>
@@ -216,6 +216,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );

View File

@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define GL_GLEXT_PROTOTYPES
#include <GL/glew.h>
#include <GL/glut.h>
#include "../util/readtex.c"
@@ -141,6 +141,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );

View File

@@ -36,6 +36,7 @@
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <GL/glew.h>
#include <GL/glut.h>
static int Width = 400;
@@ -386,6 +387,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( Width, Height );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow( "glInterleavedArrays test" );
glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );

View File

@@ -35,6 +35,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <GL/glew.h>
#include <GL/glut.h>
#include "readtex.h"
@@ -186,6 +187,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( Width, Height );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow( "GL_MESA_pack_invert test" );
glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );

View File

@@ -26,6 +26,7 @@
*/
#include <stdlib.h>
#include <GL/glew.h>
#include <GL/glut.h>
static int win_width, win_height;
@@ -164,6 +165,7 @@ main(int argc, char *argv[])
glutInitWindowSize(win_width, win_height);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
glutCreateWindow(argv[0]);
glewInit();
glutReshapeFunc(reshape);
glutKeyboardFunc(key);
glutDisplayFunc(display);

View File

@@ -13,6 +13,7 @@
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <GL/glew.h>
#include <GL/glut.h>
@@ -336,6 +337,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( WinWidth, WinHeight );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
Win = glutCreateWindow(argv[0]);
glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );

View File

@@ -9,13 +9,13 @@
*/
#define GL_GLEXT_PROTOTYPES
#include <assert.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <GL/glew.h>
#include <GL/glew.h>
#include <GL/glut.h>
static GLuint Win;
@@ -194,6 +194,7 @@ main(int argc, char *argv[])
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
Win = glutCreateWindow(argv[0]);
glewInit();
glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Display);

View File

@@ -10,9 +10,9 @@
*/
#define GL_GLEXT_PROTOTYPES
#include <stdio.h>
#include <stdlib.h>
#include <GL/glew.h>
#include <GL/glut.h>
static GLuint BufferID;
@@ -129,6 +129,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 300, 300 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
Win = glutCreateWindow(argv[0]);
glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );

View File

@@ -17,6 +17,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <GL/glew.h>
#include <GL/glut.h>
@@ -189,6 +190,7 @@ main(int argc, char *argv[])
glutInitWindowSize(Width, Height);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
glutCreateWindow(argv[0]);
glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(redraw);

View File

@@ -51,6 +51,7 @@
*/
#include <stdlib.h>
#include <stdio.h>
#include <GL/glew.h>
#include <GL/glut.h>
static GLint BaseLevel = 0, MaxLevel = 8;
@@ -260,6 +261,7 @@ int main(int argc, char** argv)
glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB | GLUT_DEPTH);
glutInitWindowSize (600, 600);
glutCreateWindow (argv[0]);
glewInit();
myinit();
glutReshapeFunc (myReshape);
glutDisplayFunc(display);

View File

@@ -10,6 +10,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <GL/glew.h>
#include <GL/glut.h>
#include <GL/glext.h>
@@ -242,6 +243,7 @@ main(int argc, char *argv[])
glutInitWindowSize(WinWidth, WinHeight);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
Win = glutCreateWindow(argv[0]);
glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Display);

View File

@@ -13,6 +13,7 @@
#include <windows.h>
#endif
#define GL_GLEXT_LEGACY
#include <GL/glew.h>
#include <GL/glut.h>
#include "../util/readtex.c" /* I know, this is a hack. */
@@ -350,6 +351,7 @@ int main( int argc, char *argv[] )
glutInitWindowPosition( 0, 0 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow(argv[0] );
glewInit();
Init( argc, argv );

View File

@@ -16,6 +16,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "GL/glew.h"
#include "GL/glut.h"
static GLuint Window = 0;
@@ -221,6 +222,7 @@ int main( int argc, char *argv[] )
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
Window = glutCreateWindow("Texture Objects");
glewInit();
if (!Window) {
exit(1);
}

View File

@@ -25,6 +25,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <GL/glew.h>
#include <GL/glut.h>
@@ -145,6 +146,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 400, 400 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
Window[0] = glutCreateWindow(argv[0]);
glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display0 );
@@ -155,6 +157,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 400, 400 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
Window[1] = glutCreateWindow(argv[0]);
glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display1 );

View File

@@ -38,6 +38,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <GL/glew.h>
#include <GL/glut.h>
#include <GL/glext.h>
@@ -59,6 +60,7 @@ main( int argc, char ** argv )
glutInitWindowPosition( 0, 0 );
glutInitWindowSize( 300, 300 );
glutCreateWindow( "No S3TC Test" );
glewInit();
gl_version = strtod( (const char *) glGetString( GL_VERSION ), NULL );
if ( ! glutExtensionSupported( "GL_ARB_texture_compression" )

View File

@@ -8,6 +8,7 @@
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <GL/glew.h>
#include <GL/glut.h>
@@ -333,6 +334,7 @@ main(int argc, char *argv[])
glutInitWindowSize(700, 800);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
glutCreateWindow(argv[0]);
glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Draw);

View File

@@ -5,12 +5,12 @@
* 11 March 2004
*/
#define GL_GLEXT_PROTOTYPES
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <GL/glew.h>
#include <GL/glut.h>
#include "../util/readtex.c" /* a hack, I know */
@@ -287,6 +287,7 @@ main( int argc, char *argv[] )
glutInitWindowSize( 750, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow(argv[0]);
glewInit();
Init();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );

View File

@@ -35,6 +35,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <GL/glew.h>
#include <GL/glut.h>
#ifndef GL_EXT_gpu_program_parameters
@@ -274,6 +275,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( Width, Height );
glutInitDisplayMode( GLUT_RGB );
glutCreateWindow( "Program Parameters Test" );
glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );

View File

@@ -18,6 +18,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <GL/glew.h>
#include <GL/glut.h>
#if 0
#include "texture.h"
@@ -1005,6 +1006,7 @@ main(int argc, char **argv)
glutInitDisplayMode(GLUT_RGBA | GLUT_DEPTH | GLUT_DOUBLE);
(void) glutCreateWindow("projtex");
glewInit();
loadTexture = loadImageTextures;
drawObject = drawCube;

View File

@@ -3,10 +3,10 @@
*/
#define GL_GLEXT_PROTOTYPES
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <GL/glew.h>
#include <GL/glut.h>
#define NUM_QUADS 20
@@ -19,7 +19,7 @@ static GLuint Vbuffer = 0;
static GLfloat buf[NUM_QUADS * 6 * 4];
static GLboolean SwapBuffers = GL_TRUE;
static GLboolean doSwapBuffers = GL_TRUE;
static GLint Frames = 0, T0 = 0;
@@ -48,7 +48,7 @@ Draw(void)
glPopMatrix();
if (SwapBuffers)
if (doSwapBuffers)
glutSwapBuffers();
/*
else
@@ -91,7 +91,7 @@ Key(unsigned char key, int x, int y)
(void) y;
switch (key) {
case 's':
SwapBuffers = !SwapBuffers;
doSwapBuffers = !doSwapBuffers;
break;
case 'a':
Anim = !Anim;
@@ -246,6 +246,7 @@ main(int argc, char *argv[])
glutInitWindowSize(600, 600);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
Win = glutCreateWindow(argv[0]);
glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);

View File

@@ -5,13 +5,13 @@
* 21 June 2007
*/
#define GL_GLEXT_PROTOTYPES
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <GL/glew.h>
#include <GL/glut.h>
static int Win;
@@ -445,6 +445,7 @@ main(int argc, char *argv[])
glutInitWindowSize(Width, Height);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
Win = glutCreateWindow(argv[0]);
glewInit();
ParseArgs(argc, argv);
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);

View File

@@ -7,11 +7,11 @@
* gcc readrate.c -L/usr/X11R6/lib -lglut -lGLU -lGL -lX11 -o readrate
*/
#define GL_GLEXT_PROTOTYPES
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <GL/glew.h>
#include <GL/glut.h>
/* Hack, to test drawing instead of reading */
@@ -275,6 +275,7 @@ main(int argc, char *argv[])
glutInitWindowSize(MAX_WIDTH, MAX_HEIGHT);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH | GLUT_STENCIL);
glutCreateWindow(argv[0]);
glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);

View File

@@ -2,10 +2,10 @@
* Test rubber-band selection box w/ logicops and blend.
*/
#define GL_GLEXT_PROTOTYPES
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <GL/glew.h>
#include <GL/glut.h>
#include "readtex.c"
@@ -232,6 +232,7 @@ main(int argc, char *argv[])
glutInitWindowSize(Width, Height);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
Win = glutCreateWindow(argv[0]);
glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);

View File

@@ -3,10 +3,10 @@
*/
#define GL_GLEXT_PROTOTYPES
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <GL/glew.h>
#include <GL/glut.h>
static int Width = 600;
@@ -136,6 +136,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( Width, Height );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow(argv[0]);
glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );

View File

@@ -5,7 +5,7 @@
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#define GL_GLEXT_PROTOTYPES
#include <GL/glew.h>
#include <GL/glut.h>
static void assert_test(const char *file, int line, int cond, const char *msg)
@@ -323,6 +323,7 @@ int main(int argc, char **argv)
{
glutInit(&argc, argv);
glutCreateWindow("Mesa bug demo");
glewInit();
RUN_TEST(test_uniform_size_type);
RUN_TEST(test_attrib_size_type);

View File

@@ -33,6 +33,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <GL/glew.h>
#include <GL/glut.h>
static int use20syntax = 1;
@@ -288,6 +289,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( Width, Height );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH | GLUT_STENCIL );
glutCreateWindow( "GL_ATI_separate_stencil test" );
glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );

View File

@@ -34,6 +34,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <GL/glew.h>
#include <GL/glut.h>
static int Width = 550;
@@ -248,6 +249,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( Width, Height );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH | GLUT_STENCIL );
glutCreateWindow( "GL_EXT_stencil_wrap test" );
glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );

View File

@@ -8,6 +8,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <GL/glew.h>
#include <GL/glut.h>
GLboolean wrapping;
@@ -272,6 +273,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 400, 400 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_STENCIL );
glutCreateWindow(argv[0]);
glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );

View File

@@ -9,6 +9,7 @@
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include "GL/glew.h"
#include "GL/glut.h"
static GLuint Window = 0;
@@ -207,6 +208,7 @@ int main( int argc, char *argv[] )
glutInitDisplayMode( GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE );
Window = glutCreateWindow("Texture Objects");
glewInit();
if (!Window) {
exit(1);
}

View File

@@ -5,11 +5,11 @@
* 26 Jan 2006
*/
#define GL_GLEXT_PROTOTYPES
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <GL/glew.h>
#include <GL/glut.h>
static GLint WinWidth = 1024, WinHeight = 512;
@@ -337,6 +337,7 @@ main(int argc, char *argv[])
glutInitWindowSize(WinWidth, WinHeight);
glutInitDisplayMode(mode);
glutCreateWindow(argv[0]);
glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);

View File

@@ -7,6 +7,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "GL/glew.h"
#include "GL/glut.h"
static GLuint Window = 0;
@@ -124,6 +125,7 @@ int main( int argc, char *argv[] )
glutInitDisplayMode( GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE );
Window = glutCreateWindow("Texture Objects");
glewInit();
if (!Window) {
exit(1);
}

View File

@@ -7,7 +7,7 @@
#include <stdlib.h>
#include <math.h>
#include <string.h>
#define GL_GLEXT_PROTOTYPES 1
#include <GL/glew.h>
#include <GL/glut.h>
#include "readtex.c" /* I know, this is a hack. */
@@ -371,6 +371,7 @@ int main( int argc, char *argv[] )
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
if (glutCreateWindow(argv[0]) <= 0) {
glewInit();
printf("Couldn't create window\n");
exit(0);
}

View File

@@ -3,9 +3,9 @@
*/
#define GL_GLEXT_PROTOTYPES
#include <assert.h>
#include <stdio.h>
#include <GL/glew.h>
#include <GL/glut.h>
#include <GL/glx.h>
#include "readtex.c"
@@ -258,6 +258,7 @@ main( int argc, char *argv[] )
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE);
glutCreateWindow(argv[0]);
glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );

View File

@@ -27,6 +27,7 @@
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <GL/glew.h>
#include <GL/glut.h>
const GLenum filter_modes[] = {
@@ -219,8 +220,8 @@ static void Init( void )
static void generate_tunnel( unsigned num_segs, GLfloat ** pos_data,
GLfloat ** tex_data )
{
const GLfloat far = 20.0f;
const GLfloat near = -90.0f;
const GLfloat far_distance = 20.0f;
const GLfloat near_distance = -90.0f;
const GLfloat far_tex = 30.0f;
const GLfloat near_tex = 0.0f;
const GLfloat angle_step = (2 * M_PI) / num_segs;
@@ -241,12 +242,12 @@ static void generate_tunnel( unsigned num_segs, GLfloat ** pos_data,
for ( i = 0 ; i < num_segs ; i++ ) {
position[0] = 2.5 * sinf( angle );
position[1] = 2.5 * cosf( angle );
position[2] = (i & 1) ? far : near;
position[2] = (i & 1) ? far_distance : near_distance;
position[3] = 1.0f;
position[4] = position[0];
position[5] = position[1];
position[6] = (i & 1) ? near : far;
position[6] = (i & 1) ? near_distance : far_distance;
position[7] = 1.0f;
position += 8;
@@ -264,12 +265,12 @@ static void generate_tunnel( unsigned num_segs, GLfloat ** pos_data,
position[0] = 2.5 * sinf( angle );
position[1] = 2.5 * cosf( angle );
position[2] = (i & 1) ? near : far;
position[2] = (i & 1) ? near_distance : far_distance;
position[3] = 1.0f;
position[4] = position[0];
position[5] = position[1];
position[6] = (i & 1) ? far : near;
position[6] = (i & 1) ? far_distance : near_distance;
position[7] = 1.0f;
position += 8;
@@ -381,6 +382,7 @@ int main( int argc, char ** argv )
glutInitWindowSize( 800, 600 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow( "Texture Filter Test" );
glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );

View File

@@ -6,6 +6,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <GL/glew.h>
#include <GL/glut.h>
#undef max
@@ -618,6 +619,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( winWidth, winHeight );
glutInitWindowPosition( 0, 0 );
glutCreateWindow( "Mixed texgen/non-texgen texture coordinate test" );
glewInit();
initialize();
instructions();

View File

@@ -9,6 +9,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <GL/glew.h>
#include <GL/glut.h>
#include "../util/readtex.c" /* I know, this is a hack. */
@@ -263,6 +264,7 @@ int main( int argc, char *argv[] )
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow(argv[0] );
glewInit();
Init(argc, argv);

View File

@@ -6,11 +6,11 @@
*/
#define GL_GLEXT_PROTOTYPES
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <GL/glew.h>
#include <GL/glut.h>
#include "readtex.h"
@@ -328,6 +328,7 @@ int main( int argc, char *argv[] )
glutInitWindowPosition( 0, 0 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow(argv[0] );
glewInit();
Init( argc, argv );

View File

@@ -8,10 +8,10 @@
*/
#define GL_GLEXT_PROTOTYPES
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <GL/glew.h>
#include <GL/glut.h>
@@ -294,6 +294,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 1000, 270 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow(argv[0]);
glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );

View File

@@ -26,6 +26,7 @@
*/
#include <stdlib.h>
#include <GL/glew.h>
#include <GL/glut.h>
static int win_width, win_height;
@@ -194,6 +195,7 @@ main(int argc, char *argv[])
glutInitWindowSize(win_width, win_height);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
glutCreateWindow(argv[0]);
glewInit();
glutReshapeFunc(reshape);
glutKeyboardFunc(key);
glutDisplayFunc(display);

View File

@@ -49,6 +49,7 @@ typedef void (* PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, GLuint *arrays);
typedef GLboolean (* PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array);
#else
#include <GL/glew.h>
#include <GL/glut.h>
#endif
@@ -166,6 +167,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( Width, Height );
glutInitDisplayMode( GLUT_RGB );
glutCreateWindow( "GL_APPLE_vertex_array_object demo" );
glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );

View File

@@ -49,6 +49,7 @@ typedef void (* PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, GLuint *arrays);
typedef GLboolean (* PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array);
#else
#include <GL/glew.h>
#include <GL/glut.h>
#endif
@@ -194,6 +195,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( Width, Height );
glutInitDisplayMode( GLUT_RGB );
glutCreateWindow( "GL_APPLE_vertex_array_object demo" );
glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );

View File

@@ -12,7 +12,7 @@
#include <stdlib.h>
#include <string.h>
#include <math.h>
#define GL_GLEXT_PROTOTYPES
#include "GL/glew.h"
#include "GL/glut.h"
#define MAXVERTS 10000
@@ -280,6 +280,7 @@ int main(int argc, char **argv)
glutInitWindowPosition(0, 0);
glutInitWindowSize(400, 400);
if (glutCreateWindow("Isosurface") <= 0) {
glewInit();
exit(0);
}
glutReshapeFunc(Reshape);

View File

@@ -10,7 +10,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#define GL_GLEXT_PROTOTYPES
#include <GL/glew.h>
#include <GL/glut.h>
@@ -222,6 +222,7 @@ main(int argc, char **argv)
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB | GLUT_DEPTH);
glutInitWindowPosition(0, 0);
glutCreateWindow(argv[0]);
glewInit();
myinit(argc, argv);
glutReshapeFunc(myReshape);
glutDisplayFunc(display);

View File

@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define GL_GLEXT_PROTOTYPES
#include <GL/glew.h>
#include <GL/glut.h>
@@ -161,6 +161,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );

View File

@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define GL_GLEXT_PROTOTYPES
#include <GL/glew.h>
#include <GL/glut.h>
@@ -140,6 +140,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 50, 50 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );

View File

@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define GL_GLEXT_PROTOTYPES
#include <GL/glew.h>
#include <GL/glut.h>
static float Zrot = 0.0;
@@ -111,6 +111,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );

View File

@@ -7,7 +7,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define GL_GLEXT_PROTOTYPES
#include <GL/glew.h>
#include <GL/glut.h>
static float Xrot = 0.0, Yrot = 0.0, Zrot = 0.0;
@@ -162,6 +162,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );

View File

@@ -7,7 +7,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define GL_GLEXT_PROTOTYPES
#include <GL/glew.h>
#include <GL/glut.h>
static float Xrot = -60.0, Yrot = 0.0, Zrot = 0.0;
@@ -224,6 +224,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );

View File

@@ -9,7 +9,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define GL_GLEXT_PROTOTYPES
#include <GL/glew.h>
#include <GL/glut.h>
#include "../util/readtex.c" /* I know, this is a hack. */
@@ -180,6 +180,7 @@ int main( int argc, char *argv[] )
glutInitWindowPosition( 0, 0 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow(argv[0] );
glewInit();
Init( argc, argv );

View File

@@ -9,7 +9,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define GL_GLEXT_PROTOTYPES
#include <GL/glew.h>
#include <GL/glut.h>
#include "../util/readtex.c" /* I know, this is a hack. */
@@ -219,6 +219,7 @@ int main( int argc, char *argv[] )
glutInitWindowPosition( 0, 0 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow(argv[0] );
glewInit();
Init( argc, argv );

View File

@@ -2,10 +2,10 @@
* Test Z compositing with glDrawPixels(GL_DEPTH_COMPONENT) and stencil test.
*/
#define GL_GLEXT_PROTOTYPES
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <GL/glew.h>
#include <GL/glut.h>
#include "../util/showbuffer.c"
@@ -211,6 +211,7 @@ main(int argc, char *argv[])
glutInitWindowSize(Width, Height);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH | GLUT_STENCIL);
Win = glutCreateWindow(argv[0]);
glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);

View File

@@ -10,10 +10,10 @@
* Press 'd' to view the Z buffer as a grayscale image.
*/
#define GL_GLEXT_PROTOTYPES
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <GL/glew.h>
#include <GL/glut.h>
#include "../util/showbuffer.c"
@@ -180,6 +180,7 @@ main(int argc, char *argv[])
glutInitWindowSize(400, 400);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
Win = glutCreateWindow(argv[0]);
glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);

View File

@@ -8,7 +8,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define GL_GLEXT_PROTOTYPES
#include <GL/glew.h>
#include <GL/glut.h>
static GLint WinWidth = 500, WinHeight = 500;
@@ -107,6 +107,7 @@ int main(int argc, char *argv[])
glutInitWindowSize(WinWidth, WinHeight);
glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE);
glutCreateWindow(argv[0]);
glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Display);