summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--progs/demos/bounce.c11
-rw-r--r--progs/demos/cubemap.c3
-rw-r--r--progs/demos/fire.c2
-rw-r--r--progs/demos/gloss.c10
-rw-r--r--progs/demos/glutfx.c10
-rw-r--r--progs/demos/ipers.c2
-rw-r--r--progs/demos/isosurf.c33
-rw-r--r--progs/demos/morph3d.c7
-rw-r--r--progs/demos/paltex.c20
-rw-r--r--progs/demos/pointblast.c28
-rw-r--r--progs/demos/shadow.c2
-rw-r--r--progs/demos/stex3d.c7
-rw-r--r--progs/demos/teapot.c2
-rw-r--r--progs/demos/terrain.c6
-rw-r--r--progs/demos/tessdemo.c37
-rw-r--r--progs/demos/texenv.c8
-rw-r--r--progs/demos/tunnel.c2
-rw-r--r--progs/demos/tunnel2.c2
-rw-r--r--progs/demos/winpos.c10
19 files changed, 89 insertions, 113 deletions
diff --git a/progs/demos/bounce.c b/progs/demos/bounce.c
index 876ce589dc9..1c0c550bea3 100644
--- a/progs/demos/bounce.c
+++ b/progs/demos/bounce.c
@@ -1,4 +1,4 @@
-/* $Id: bounce.c,v 1.1 1999/08/19 00:55:40 jtg Exp $ */
+/* $Id: bounce.c,v 1.2 2000/06/27 17:04:43 brianp Exp $ */
/*
* Bouncing ball demo. Color index mode only!
@@ -12,8 +12,11 @@
/*
* $Log: bounce.c,v $
- * Revision 1.1 1999/08/19 00:55:40 jtg
- * Initial revision
+ * Revision 1.2 2000/06/27 17:04:43 brianp
+ * fixed compiler warnings
+ *
+ * Revision 1.1.1.1 1999/08/19 00:55:40 jtg
+ * Imported sources
*
* Revision 3.3 1999/03/18 08:16:14 joukj
*
@@ -195,7 +198,7 @@ idle(void)
glutPostRedisplay();
}
-void
+static void
visible(int vis)
{
if (vis == GLUT_VISIBLE)
diff --git a/progs/demos/cubemap.c b/progs/demos/cubemap.c
index 268c431f147..56e7ea1457a 100644
--- a/progs/demos/cubemap.c
+++ b/progs/demos/cubemap.c
@@ -1,4 +1,4 @@
-/* $Id: cubemap.c,v 1.2 2000/06/13 18:45:54 brianp Exp $ */
+/* $Id: cubemap.c,v 1.3 2000/06/27 17:04:43 brianp Exp $ */
/*
* GL_ARB_texture_cube_map demo
@@ -37,6 +37,7 @@
#include <math.h>
+#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "GL/glut.h"
diff --git a/progs/demos/fire.c b/progs/demos/fire.c
index 056598d5c31..6bf39a57b78 100644
--- a/progs/demos/fire.c
+++ b/progs/demos/fire.c
@@ -151,7 +151,7 @@ gettime(void)
return (ris / (float) CLOCKS_PER_SEC);
}
-float
+static float
vrnd(void)
{
return (((float) rand()) / RAND_MAX);
diff --git a/progs/demos/gloss.c b/progs/demos/gloss.c
index 1c59484f547..ab0e25800b9 100644
--- a/progs/demos/gloss.c
+++ b/progs/demos/gloss.c
@@ -1,4 +1,4 @@
-/* $Id: gloss.c,v 1.3 1999/10/26 17:08:31 brianp Exp $ */
+/* $Id: gloss.c,v 1.4 2000/06/27 17:04:43 brianp Exp $ */
/*
* Specular reflection demo. The specular highlight is modulated by
@@ -245,7 +245,7 @@ static void Init( int argc, char *argv[] )
glMatrixMode(GL_TEXTURE);
glLoadIdentity();
- glScalef(8.0, 4.0, 2.0);
+ /*glScalef(8.0, 4.0, 2.0);*/
glMatrixMode(GL_MODELVIEW);
/* cylinder */
@@ -322,8 +322,14 @@ static void Init( int argc, char *argv[] )
glBindTexture(GL_TEXTURE_2D, SpecularTexture);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+#if 1
glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP);
glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP);
+#else
+ glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_NORMAL_MAP_NV);
+ glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_NORMAL_MAP_NV);
+ glTexGeni(GL_R, GL_TEXTURE_GEN_MODE, GL_NORMAL_MAP_NV);
+#endif
if (!LoadRGBMipmaps(SPECULAR_TEXTURE_FILE, GL_RGB)) {
printf("Error: couldn't load texture image file %s\n", SPECULAR_TEXTURE_FILE);
exit(1);
diff --git a/progs/demos/glutfx.c b/progs/demos/glutfx.c
index 278d726bcb8..6b9d9faf4e9 100644
--- a/progs/demos/glutfx.c
+++ b/progs/demos/glutfx.c
@@ -1,4 +1,4 @@
-/* $Id: glutfx.c,v 1.1 1999/08/19 00:55:40 jtg Exp $ */
+/* $Id: glutfx.c,v 1.2 2000/06/27 17:04:43 brianp Exp $ */
/*
* Example of how one might use GLUT with the 3Dfx driver in full-screen mode.
@@ -16,8 +16,11 @@
/*
* $Log: glutfx.c,v $
- * Revision 1.1 1999/08/19 00:55:40 jtg
- * Initial revision
+ * Revision 1.2 2000/06/27 17:04:43 brianp
+ * fixed compiler warnings
+ *
+ * Revision 1.1.1.1 1999/08/19 00:55:40 jtg
+ * Imported sources
*
* Revision 3.2 1999/03/28 18:18:33 brianp
* minor clean-up
@@ -164,7 +167,6 @@ int main( int argc, char *argv[] )
printf("NOTE: if you've got 3Dfx VooDoo hardware you must run this");
printf(" program as root.\n\n");
printf("Move the mouse. Press ESC to exit.\n\n");
- sleep(2);
#endif
/* Tell Mesa GLX to use 3Dfx driver in fullscreen mode. */
diff --git a/progs/demos/ipers.c b/progs/demos/ipers.c
index 76da4c01f13..8993d3fc222 100644
--- a/progs/demos/ipers.c
+++ b/progs/demos/ipers.c
@@ -85,7 +85,7 @@ initlight(void)
static void
initdlists(void)
{
- static slicetable[MAX_LOD][2] = {
+ static int slicetable[MAX_LOD][2] = {
{21, 10},
{18, 9},
{15, 8},
diff --git a/progs/demos/isosurf.c b/progs/demos/isosurf.c
index 0ae69d10104..a25848d50b1 100644
--- a/progs/demos/isosurf.c
+++ b/progs/demos/isosurf.c
@@ -1,4 +1,4 @@
-/* $Id: isosurf.c,v 1.5 2000/03/30 17:58:56 keithw Exp $ */
+/* $Id: isosurf.c,v 1.6 2000/06/27 17:04:43 brianp Exp $ */
/*
* Display an isosurface of 3-D wind speed volume.
@@ -25,41 +25,12 @@
* Other options are available via the popup menu.
*/
-/*
- * $Log: isosurf.c,v $
- * Revision 1.5 2000/03/30 17:58:56 keithw
- * Added stipple mode
- *
- * Revision 1.4 1999/10/21 16:39:06 brianp
- * added -info command line option
- *
- * Revision 1.3 1999/09/08 22:14:31 brianp
- * minor changes. always call compactify_arrays()
- *
- * Revision 1.2 1999/09/03 14:56:40 keithw
- * Fog, displaylist and zoom operations
- *
- * Revision 3.4 1999/04/24 01:10:47 keithw
- * clip planes, materials
- *
- * Revision 3.3 1999/03/31 19:42:14 keithw
- * support for cva
- *
- * Revision 3.1 1998/11/01 20:30:20 brianp
- * added benchmark feature (b key)
- *
- * Revision 3.0 1998/02/14 18:42:29 brianp
- * initial rev
- *
- */
-
-
-
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#define GL_GLEXT_LEGACY
#include "GL/glut.h"
#include "../util/readtex.c" /* I know, this is a hack. KW: me too. */
diff --git a/progs/demos/morph3d.c b/progs/demos/morph3d.c
index 006a44d4df3..fd9f6a7d700 100644
--- a/progs/demos/morph3d.c
+++ b/progs/demos/morph3d.c
@@ -1,7 +1,10 @@
-/* $Id: morph3d.c,v 1.3 1999/12/15 13:00:45 brianp Exp $ */
+/* $Id: morph3d.c,v 1.4 2000/06/27 17:04:43 brianp Exp $ */
/*
* $Log: morph3d.c,v $
+ * Revision 1.4 2000/06/27 17:04:43 brianp
+ * fixed compiler warnings
+ *
* Revision 1.3 1999/12/15 13:00:45 brianp
* moved #define to column 0
*
@@ -830,7 +833,7 @@ static void pinit(void)
}
-void INIT(void)
+static void INIT(void)
{
printf("Morph 3D - Shows morphing platonic polyhedra\n");
printf("Author: Marcelo Fernandes Vianna ([email protected])\n\n");
diff --git a/progs/demos/paltex.c b/progs/demos/paltex.c
index 3b5cd277a97..6ffac28c1ed 100644
--- a/progs/demos/paltex.c
+++ b/progs/demos/paltex.c
@@ -1,30 +1,14 @@
-/* $Id: paltex.c,v 1.2 1999/11/02 15:09:04 brianp Exp $ */
+/* $Id: paltex.c,v 1.3 2000/06/27 17:04:43 brianp Exp $ */
/*
* Paletted texture demo. Written by Brian Paul.
* This program is in the public domain.
*/
-/*
- * $Log: paltex.c,v $
- * Revision 1.2 1999/11/02 15:09:04 brianp
- * new texture image, cleaned-up code
- *
- * Revision 1.1.1.1 1999/08/19 00:55:40 jtg
- * Imported sources
- *
- * Revision 3.1 1999/03/28 18:20:49 brianp
- * minor clean-up
- *
- * Revision 3.0 1998/02/14 18:42:29 brianp
- * initial rev
- *
- */
-
-
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#define GL_GLEXT_LEGACY
#include <GL/glut.h>
diff --git a/progs/demos/pointblast.c b/progs/demos/pointblast.c
index a36046f585f..f6486fe55a4 100644
--- a/progs/demos/pointblast.c
+++ b/progs/demos/pointblast.c
@@ -13,8 +13,11 @@
/*
* $Log: pointblast.c,v $
- * Revision 1.1 1999/08/19 00:55:40 jtg
- * Initial revision
+ * Revision 1.2 2000/06/27 17:04:43 brianp
+ * fixed compiler warnings
+ *
+ * Revision 1.1.1.1 1999/08/19 00:55:40 jtg
+ * Imported sources
*
* Revision 3.3 1998/07/26 01:24:27 brianp
* removed include of gl.h
@@ -35,6 +38,7 @@
#include <stdlib.h>
#include <string.h>
#include <math.h> /* for cos(), sin(), and sqrt() */
+#define GL_GLEXT_LEGACY
#include <GL/glut.h>
/* Some <math.h> files do not define M_PI... */
@@ -100,7 +104,7 @@ static float float_rand(void) { return rand() / (float) RAND_MAX; }
/* Modeling units of ground extent in each X and Z direction. */
#define EDGE 12
-void
+static void
makePointList(void)
{
float angle, velocity, direction;
@@ -124,7 +128,7 @@ makePointList(void)
theTime = 0.0;
}
-void
+static void
updatePointList(void)
{
float distance;
@@ -167,7 +171,7 @@ updatePointList(void)
}
}
-void
+static void
idle(void)
{
updatePointList();
@@ -178,7 +182,7 @@ idle(void)
glutPostRedisplay();
}
-void
+static void
visible(int vis)
{
if (vis == GLUT_VISIBLE) {
@@ -190,7 +194,7 @@ visible(int vis)
}
}
-void
+static void
recalcModelView(void)
{
glPopMatrix();
@@ -199,7 +203,7 @@ recalcModelView(void)
newModel = 0;
}
-void
+static void
redraw(void)
{
int i;
@@ -247,7 +251,7 @@ redraw(void)
}
/* ARGSUSED2 */
-void
+static void
mouse(int button, int state, int x, int y)
{
/* Scene can be spun around Y axis using left
@@ -262,7 +266,7 @@ mouse(int button, int state, int x, int y)
}
/* ARGSUSED1 */
-void
+static void
mouseMotion(int x, int y)
{
if (moving) {
@@ -273,7 +277,7 @@ mouseMotion(int x, int y)
}
}
-void
+static void
menu(int option)
{
switch (option) {
@@ -347,7 +351,7 @@ menu(int option)
}
/* ARGSUSED1 */
-void
+static void
key(unsigned char c, int x, int y)
{
switch (c) {
diff --git a/progs/demos/shadow.c b/progs/demos/shadow.c
index a1b3fdeca7a..0f66b538d7f 100644
--- a/progs/demos/shadow.c
+++ b/progs/demos/shadow.c
@@ -48,6 +48,8 @@ OpenGL(TM) is a trademark of Silicon Graphics, Inc.
/* Rendering shadows using projective shadows. */
#include <GL/glut.h>
+#include "shadow.h"
+
enum {
X, Y, Z, W
diff --git a/progs/demos/stex3d.c b/progs/demos/stex3d.c
index 2350532c981..bab9035287b 100644
--- a/progs/demos/stex3d.c
+++ b/progs/demos/stex3d.c
@@ -1,4 +1,4 @@
-/* $Id: stex3d.c,v 1.4 2000/03/22 19:48:57 brianp Exp $ */
+/* $Id: stex3d.c,v 1.5 2000/06/27 17:04:43 brianp Exp $ */
/*-----------------------------
* stex3d.c GL example of the mesa 3d-texture extention to simulate procedural
@@ -17,6 +17,9 @@
/*
* $Log: stex3d.c,v $
+ * Revision 1.5 2000/06/27 17:04:43 brianp
+ * fixed compiler warnings
+ *
* Revision 1.4 2000/03/22 19:48:57 brianp
* converted from GL_EXT_texture3D to GL 1.2
*
@@ -385,7 +388,7 @@ void resize(int w, int h)
glTranslatef(0,0,-5);
}
-void cleanEverything(void)
+static void cleanEverything(void)
{
/* free(voxels); */
}
diff --git a/progs/demos/teapot.c b/progs/demos/teapot.c
index addee03a3da..c36865f4bc2 100644
--- a/progs/demos/teapot.c
+++ b/progs/demos/teapot.c
@@ -410,8 +410,6 @@ static void draw(void)
static void inittextures(void)
{
- GLenum gluerr;
-
glGenTextures(1,&t1id);
glBindTexture(GL_TEXTURE_2D,t1id);
diff --git a/progs/demos/terrain.c b/progs/demos/terrain.c
index b708ff826de..fbc88039069 100644
--- a/progs/demos/terrain.c
+++ b/progs/demos/terrain.c
@@ -125,7 +125,7 @@ reshape(int width, int height)
glLoadIdentity();
}
-int
+static int
clipstrip(float y, float *start, float *end)
{
float x1, x2, t1, t2, tmp;
@@ -254,7 +254,7 @@ printhelp(void)
"(No Joystick control available)");
}
-void
+static void
drawterrain(void)
{
int h, i, idx, ox, oy;
@@ -357,7 +357,7 @@ dojoy(void)
#endif
}
-void
+static void
drawscene(void)
{
static int count = 0;
diff --git a/progs/demos/tessdemo.c b/progs/demos/tessdemo.c
index b5a6d08c57e..2366eaca754 100644
--- a/progs/demos/tessdemo.c
+++ b/progs/demos/tessdemo.c
@@ -1,4 +1,4 @@
-/* $Id: tessdemo.c,v 1.6 2000/03/27 15:46:12 brianp Exp $ */
+/* $Id: tessdemo.c,v 1.7 2000/06/27 17:04:43 brianp Exp $ */
/*
* A demo of the GLU polygon tesselation functions written by Bogdan Sikorski.
@@ -51,7 +51,7 @@ static struct
-void GLCALLBACK error_callback( GLenum err )
+static void GLCALLBACK error_callback( GLenum err )
{
int len, i;
char const *str;
@@ -67,14 +67,14 @@ void GLCALLBACK error_callback( GLenum err )
}
}
-void GLCALLBACK begin_callback( GLenum mode )
+static void GLCALLBACK begin_callback( GLenum mode )
{
/* Allow multiple triangles to be output inside the begin/end pair. */
triangle_cnt = 0;
triangles[triangle_cnt].no = 0;
}
-void GLCALLBACK edge_callback( GLenum flag )
+static void GLCALLBACK edge_callback( GLenum flag )
{
/* Persist the edge flag across triangles. */
if ( flag == GL_TRUE )
@@ -91,7 +91,7 @@ void GLCALLBACK edge_callback( GLenum flag )
}
}
-void GLCALLBACK end_callback()
+static void GLCALLBACK end_callback()
{
GLint i;
@@ -126,7 +126,7 @@ void GLCALLBACK end_callback()
glEnd();
}
-void GLCALLBACK vertex_callback( void *data )
+static void GLCALLBACK vertex_callback( void *data )
{
GLsizei no;
GLfloat *p;
@@ -149,12 +149,11 @@ void GLCALLBACK vertex_callback( void *data )
}
}
-void GLCALLBACK combine_callback( GLdouble coords[3],
+static void GLCALLBACK combine_callback( GLdouble coords[3],
GLdouble *vertex_data[4],
GLfloat weight[4], void **data )
{
GLfloat *vertex;
- int i;
vertex = (GLfloat *) malloc( 2 * sizeof(GLfloat) );
@@ -165,13 +164,13 @@ void GLCALLBACK combine_callback( GLdouble coords[3],
}
-void set_screen_wh( GLsizei w, GLsizei h )
+static void set_screen_wh( GLsizei w, GLsizei h )
{
width = w;
height = h;
}
-void tesse( void )
+static void tesse( void )
{
GLUtesselator *tobj;
GLdouble data[3];
@@ -242,7 +241,7 @@ void tesse( void )
}
}
-void left_down( int x1, int y1 )
+static void left_down( int x1, int y1 )
{
GLfloat P[2];
GLuint point_cnt;
@@ -276,7 +275,7 @@ void left_down( int x1, int y1 )
contours[contour_cnt].point_cnt++;
}
-void middle_down( int x1, int y1 )
+static void middle_down( int x1, int y1 )
{
GLuint point_cnt;
(void) x1;
@@ -301,7 +300,7 @@ void middle_down( int x1, int y1 )
}
}
-void mouse_clicked( int button, int state, int x, int y )
+static void mouse_clicked( int button, int state, int x, int y )
{
x -= x%10;
y -= y%10;
@@ -321,7 +320,7 @@ void mouse_clicked( int button, int state, int x, int y )
}
}
-void display( void )
+static void display( void )
{
GLuint i,j;
GLuint point_cnt;
@@ -406,7 +405,7 @@ void display( void )
glColor3f( 1.0, 1.0, 0.0 );
}
-void clear( void )
+static void clear( void )
{
contour_cnt = 0;
contours[0].point_cnt = 0;
@@ -420,12 +419,12 @@ void clear( void )
list_start = 0;
}
-void quit( void )
+static void quit( void )
{
exit( 0 );
}
-void menu_selected( int entry )
+static void menu_selected( int entry )
{
switch ( entry )
{
@@ -443,7 +442,7 @@ void menu_selected( int entry )
glutPostRedisplay();
}
-void key_pressed( unsigned char key, int x, int y )
+static void key_pressed( unsigned char key, int x, int y )
{
(void) x;
(void) y;
@@ -467,7 +466,7 @@ void key_pressed( unsigned char key, int x, int y )
glutPostRedisplay();
}
-void myinit( void )
+static void myinit( void )
{
/* clear background to gray */
glClearColor( 0.4, 0.4, 0.4, 0.0 );
diff --git a/progs/demos/texenv.c b/progs/demos/texenv.c
index f6fac4bedb6..e5394ae487a 100644
--- a/progs/demos/texenv.c
+++ b/progs/demos/texenv.c
@@ -197,7 +197,7 @@ struct envModeInfo envModes[] =
#endif
};
-void checkErrors( void )
+static void checkErrors( void )
{
GLenum error;
@@ -265,7 +265,7 @@ static void initialize( void )
}
/* ARGSUSED1 */
-void keyboard( unsigned char c, int x, int y )
+static void keyboard( unsigned char c, int x, int y )
{
switch ( c ) {
case 'c':
@@ -296,7 +296,7 @@ void keyboard( unsigned char c, int x, int y )
}
/* ARGSUSED1 */
-void special( int key, int x, int y )
+static void special( int key, int x, int y )
{
switch ( key ) {
case GLUT_KEY_DOWN:
@@ -327,7 +327,7 @@ void special( int key, int x, int y )
glutPostRedisplay();
}
-void
+static void
reshape( int w, int h )
{
winWidth = w;
diff --git a/progs/demos/tunnel.c b/progs/demos/tunnel.c
index 3cced8b2a93..98484ee68da 100644
--- a/progs/demos/tunnel.c
+++ b/progs/demos/tunnel.c
@@ -69,8 +69,6 @@ static GLuint t1id, t2id;
static void
inittextures(void)
{
- GLenum gluerr;
-
glGenTextures(1, &t1id);
glBindTexture(GL_TEXTURE_2D, t1id);
diff --git a/progs/demos/tunnel2.c b/progs/demos/tunnel2.c
index b8cea412b02..cc660374e35 100644
--- a/progs/demos/tunnel2.c
+++ b/progs/demos/tunnel2.c
@@ -82,8 +82,6 @@ static GLuint t1id, t2id;
static void
inittextures(void)
{
- GLenum gluerr;
-
glGenTextures(1, &t1id);
glBindTexture(GL_TEXTURE_2D, t1id);
diff --git a/progs/demos/winpos.c b/progs/demos/winpos.c
index a3f931cfd34..7001165deef 100644
--- a/progs/demos/winpos.c
+++ b/progs/demos/winpos.c
@@ -1,4 +1,4 @@
-/* $Id: winpos.c,v 1.1 1999/08/19 00:55:40 jtg Exp $ */
+/* $Id: winpos.c,v 1.2 2000/06/27 17:04:43 brianp Exp $ */
/*
* Example of how to use the GL_MESA_window_pos extension.
@@ -8,8 +8,11 @@
/*
* $Log: winpos.c,v $
- * Revision 1.1 1999/08/19 00:55:40 jtg
- * Initial revision
+ * Revision 1.2 2000/06/27 17:04:43 brianp
+ * fixed compiler warnings
+ *
+ * Revision 1.1.1.1 1999/08/19 00:55:40 jtg
+ * Imported sources
*
* Revision 3.3 1999/03/28 18:24:37 brianp
* minor clean-up
@@ -30,6 +33,7 @@
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
+#define GL_GLEXT_LEGACY
#include "GL/glut.h"
#include "../util/readtex.c" /* a hack, I know */