-/* $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!
/*
* $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
*
glutPostRedisplay();
}
-void
+static void
visible(int vis)
{
if (vis == GLUT_VISIBLE)
-/* $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
#include <math.h>
+#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "GL/glut.h"
return (ris / (float) CLOCKS_PER_SEC);
}
-float
+static float
vrnd(void)
{
return (((float) rand()) / RAND_MAX);
-/* $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
glMatrixMode(GL_TEXTURE);
glLoadIdentity();
- glScalef(8.0, 4.0, 2.0);
+ /*glScalef(8.0, 4.0, 2.0);*/
glMatrixMode(GL_MODELVIEW);
/* cylinder */
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);
-/* $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.
/*
* $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
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. */
static void
initdlists(void)
{
- static slicetable[MAX_LOD][2] = {
+ static int slicetable[MAX_LOD][2] = {
{21, 10},
{18, 9},
{15, 8},
-/* $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.
* 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. */
-/* $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
*
}
-void INIT(void)
+static void INIT(void)
{
printf("Morph 3D - Shows morphing platonic polyhedra\n");
printf("Author: Marcelo Fernandes Vianna (vianna@cat.cbpf.br)\n\n");
-/* $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>
/*
* $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
#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... */
/* Modeling units of ground extent in each X and Z direction. */
#define EDGE 12
-void
+static void
makePointList(void)
{
float angle, velocity, direction;
theTime = 0.0;
}
-void
+static void
updatePointList(void)
{
float distance;
}
}
-void
+static void
idle(void)
{
updatePointList();
glutPostRedisplay();
}
-void
+static void
visible(int vis)
{
if (vis == GLUT_VISIBLE) {
}
}
-void
+static void
recalcModelView(void)
{
glPopMatrix();
newModel = 0;
}
-void
+static void
redraw(void)
{
int i;
}
/* ARGSUSED2 */
-void
+static void
mouse(int button, int state, int x, int y)
{
/* Scene can be spun around Y axis using left
}
/* ARGSUSED1 */
-void
+static void
mouseMotion(int x, int y)
{
if (moving) {
}
}
-void
+static void
menu(int option)
{
switch (option) {
}
/* ARGSUSED1 */
-void
+static void
key(unsigned char c, int x, int y)
{
switch (c) {
/* Rendering shadows using projective shadows. */
#include <GL/glut.h>
+#include "shadow.h"
+
enum {
X, Y, Z, W
-/* $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
/*
* $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
*
glTranslatef(0,0,-5);
}
-void cleanEverything(void)
+static void cleanEverything(void)
{
/* free(voxels); */
}
static void inittextures(void)
{
- GLenum gluerr;
-
glGenTextures(1,&t1id);
glBindTexture(GL_TEXTURE_2D,t1id);
glLoadIdentity();
}
-int
+static int
clipstrip(float y, float *start, float *end)
{
float x1, x2, t1, t2, tmp;
"(No Joystick control available)");
}
-void
+static void
drawterrain(void)
{
int h, i, idx, ox, oy;
#endif
}
-void
+static void
drawscene(void)
{
static int count = 0;
-/* $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.
-void GLCALLBACK error_callback( GLenum err )
+static void GLCALLBACK error_callback( GLenum err )
{
int len, i;
char const *str;
}
}
-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 )
}
}
-void GLCALLBACK end_callback()
+static void GLCALLBACK end_callback()
{
GLint i;
glEnd();
}
-void GLCALLBACK vertex_callback( void *data )
+static void GLCALLBACK vertex_callback( void *data )
{
GLsizei no;
GLfloat *p;
}
}
-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) );
}
-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];
}
}
-void left_down( int x1, int y1 )
+static void left_down( int x1, int y1 )
{
GLfloat P[2];
GLuint point_cnt;
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;
}
}
-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;
}
}
-void display( void )
+static void display( void )
{
GLuint i,j;
GLuint point_cnt;
glColor3f( 1.0, 1.0, 0.0 );
}
-void clear( void )
+static void clear( void )
{
contour_cnt = 0;
contours[0].point_cnt = 0;
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 )
{
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;
glutPostRedisplay();
}
-void myinit( void )
+static void myinit( void )
{
/* clear background to gray */
glClearColor( 0.4, 0.4, 0.4, 0.0 );
#endif
};
-void checkErrors( void )
+static void checkErrors( void )
{
GLenum error;
}
/* ARGSUSED1 */
-void keyboard( unsigned char c, int x, int y )
+static void keyboard( unsigned char c, int x, int y )
{
switch ( c ) {
case 'c':
}
/* ARGSUSED1 */
-void special( int key, int x, int y )
+static void special( int key, int x, int y )
{
switch ( key ) {
case GLUT_KEY_DOWN:
glutPostRedisplay();
}
-void
+static void
reshape( int w, int h )
{
winWidth = w;
static void
inittextures(void)
{
- GLenum gluerr;
-
glGenTextures(1, &t1id);
glBindTexture(GL_TEXTURE_2D, t1id);
static void
inittextures(void)
{
- GLenum gluerr;
-
glGenTextures(1, &t1id);
glBindTexture(GL_TEXTURE_2D, t1id);
-/* $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.
/*
* $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
#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 */