[Plib-cvs] plib/examples/src/ssg/tux WavingFlag.cxx,1.5,1.6 WavingFlagDemo.cxx,1.4,1.5 tux_example.c
Brought to you by:
sjbaker
From: Sebastian U. <ud...@us...> - 2002-09-01 06:58:03
|
Update of /cvsroot/plib/plib/examples/src/ssg/tux In directory usw-pr-cvs1:/tmp/cvs-serv6971/ssg/tux Modified Files: WavingFlag.cxx WavingFlagDemo.cxx tux_example.cxx Log Message: Mac OS-X compatibility; Minor cleanups Index: WavingFlag.cxx =================================================================== RCS file: /cvsroot/plib/plib/examples/src/ssg/tux/WavingFlag.cxx,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- WavingFlag.cxx 20 Dec 2001 15:55:48 -0000 1.5 +++ WavingFlag.cxx 1 Sep 2002 06:57:59 -0000 1.6 @@ -1,10 +1,20 @@ #ifdef WIN32 -#include <windows.h> +# include <windows.h> #else -#include <unistd.h> +# include <unistd.h> #endif -#include <GL/glut.h> -#include "plib/ssg.h" + +#ifdef FREEGLUT_IS_PRESENT +# include <GL/freeglut.h> +#else +# ifdef __APPLE__ +# include <GLUT/glut.h> +# else +# include <GL/glut.h> +# endif +#endif + +#include <plib/ssg.h> #include "WavingFlag.h" WavingFlag::WavingFlag( sgVec4 color, char *texture1, char *texture2, int s ) Index: WavingFlagDemo.cxx =================================================================== RCS file: /cvsroot/plib/plib/examples/src/ssg/tux/WavingFlagDemo.cxx,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- WavingFlagDemo.cxx 11 Jan 2001 00:04:37 -0000 1.4 +++ WavingFlagDemo.cxx 1 Sep 2002 06:57:59 -0000 1.5 @@ -1,10 +1,20 @@ #ifdef WIN32 -#include <windows.h> +# include <windows.h> #else -#include <unistd.h> +# include <unistd.h> #endif -#include <GL/glut.h> -#include "plib/ssg.h" + +#ifdef FREEGLUT_IS_PRESENT +# include <GL/freeglut.h> +#else +# ifdef __APPLE__ +# include <GLUT/glut.h> +# else +# include <GL/glut.h> +# endif +#endif + +#include <plib/ssg.h> #include "WavingFlag.h" @@ -16,7 +26,7 @@ The GLUT window reshape event */ -void reshape ( int w, int h ) +static void reshape ( int w, int h ) { glViewport ( 0, 0, w, h ) ; } @@ -27,14 +37,14 @@ The GLUT keyboard event */ -void keyboard ( unsigned char, int, int ) +static void keyboard ( unsigned char, int, int ) { exit ( 0 ) ; } -void idle () +static void idle () { static int lastTime = 0; int time = glutGet((GLenum)GLUT_ELAPSED_TIME); @@ -49,7 +59,7 @@ The GLUT redraw event */ -void redraw () +static void redraw () { sgCoord campos ; sgSetCoord ( & campos, 0.0f, -3.0f, 0.0f, 0.0f, 0.0f, 0.0f ) ; @@ -67,7 +77,7 @@ -void init_graphics () +static void init_graphics () { int fake_argc = 1 ; char *fake_argv[3] ; @@ -123,7 +133,7 @@ Load a simple database */ -void load_database () +static void load_database () { /* Set up the path to the data files @@ -157,3 +167,4 @@ glutMainLoop () ; return 0 ; } + Index: tux_example.cxx =================================================================== RCS file: /cvsroot/plib/plib/examples/src/ssg/tux/tux_example.cxx,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- tux_example.cxx 29 Sep 2000 17:29:03 -0000 1.3 +++ tux_example.cxx 1 Sep 2002 06:57:59 -0000 1.4 @@ -3,17 +3,26 @@ #include <ctype.h> #include <string.h> #ifdef WIN32 -#include <windows.h> +# include <windows.h> #else -#include <unistd.h> +# include <unistd.h> #endif #include <math.h> #include <plib/ssg.h> -#include <GL/glut.h> -ssgRoot *scene = NULL ; -ssgTransform *penguin = NULL ; -ssgTransform *pedestal = NULL ; +#ifdef FREEGLUT_IS_PRESENT +# include <GL/freeglut.h> +#else +# ifdef __APPLE__ +# include <GLUT/glut.h> +# else +# include <GL/glut.h> +# endif +#endif + +static ssgRoot *scene = NULL ; +static ssgTransform *penguin = NULL ; +static ssgTransform *pedestal = NULL ; /* @@ -21,7 +30,7 @@ for both Tux and the camera. */ -void update_motion () +static void update_motion () { static int frameno = 0 ; @@ -47,7 +56,7 @@ The GLUT window reshape event */ -void reshape ( int w, int h ) +static void reshape ( int w, int h ) { glViewport ( 0, 0, w, h ) ; } @@ -58,7 +67,7 @@ The GLUT keyboard event */ -void keyboard ( unsigned char, int, int ) +static void keyboard ( unsigned char, int, int ) { exit ( 0 ) ; } @@ -69,7 +78,7 @@ The GLUT redraw event */ -void redraw () +static void redraw () { update_motion () ; @@ -83,7 +92,7 @@ -void init_graphics () +static void init_graphics () { int fake_argc = 1 ; char *fake_argv[3] ; @@ -138,7 +147,7 @@ Load a simple database */ -void load_database () +static void load_database () { /* Set up the path to the data files |