Update of /cvsroot/plib/plib/examples/src/fnt
In directory usw-pr-cvs1:/tmp/cvs-serv6971/fnt
Modified Files:
fnt_test.cxx slideshow.cxx
Log Message:
Mac OS-X compatibility; Minor cleanups
Index: fnt_test.cxx
===================================================================
RCS file: /cvsroot/plib/plib/examples/src/fnt/fnt_test.cxx,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- fnt_test.cxx 15 Aug 2002 00:38:06 -0000 1.6
+++ fnt_test.cxx 1 Sep 2002 06:57:58 -0000 1.7
@@ -3,17 +3,27 @@
#include <stdlib.h>
#include <string.h>
#ifdef WIN32
-#include <windows.h>
+# include <windows.h>
#else
-#include <unistd.h>
+# include <unistd.h>
#endif
#include <math.h>
-#include <GL/glut.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/fnt.h>
-fntRenderer *text ;
+static fntRenderer *text ;
-const char *font_names [] =
+static const char *font_names [] =
{
"Helvetica.txf", /* This is the default */
"Helvetica-Bold.txf",
@@ -74,17 +84,17 @@
NULL
} ;
-fntTexFont **font_list ;
+static fntTexFont **font_list ;
-int cur_font = 0 ;
-int max_font = 0 ;
+static int cur_font = 0 ;
+static int max_font = 0 ;
-void motionfn ( int, int )
+static void motionfn ( int, int )
{
glutPostRedisplay () ;
}
-void keyfn ( unsigned char key, int, int )
+static void keyfn ( unsigned char key, int, int )
{
cur_font++ ;
@@ -92,13 +102,13 @@
cur_font = 0 ;
}
-void mousefn ( int /*button*/, int /*updown*/, int /*x*/, int /*y*/ )
+static void mousefn ( int /*button*/, int /*updown*/, int /*x*/, int /*y*/ )
{
exit ( 0 ) ;
}
-int getWindowHeight () { return glutGet ( (GLenum) GLUT_WINDOW_HEIGHT ) ; }
-int getWindowWidth () { return glutGet ( (GLenum) GLUT_WINDOW_WIDTH ) ; }
+static int getWindowHeight () { return glutGet ( (GLenum) GLUT_WINDOW_HEIGHT ) ; }
+static int getWindowWidth () { return glutGet ( (GLenum) GLUT_WINDOW_WIDTH ) ; }
static void setOpenGLState ( void )
{
@@ -137,7 +147,7 @@
-void displayfn (void)
+static void displayfn (void)
{
setOpenGLState () ;
glClearColor ( 0.1f, 0.4f, 0.1f, 1.0f ) ;
Index: slideshow.cxx
===================================================================
RCS file: /cvsroot/plib/plib/examples/src/fnt/slideshow.cxx,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- slideshow.cxx 15 Aug 2002 00:37:47 -0000 1.6
+++ slideshow.cxx 1 Sep 2002 06:57:58 -0000 1.7
@@ -15,25 +15,35 @@
# include <unistd.h>
#endif
#include <math.h>
-#include <GL/glut.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/fnt.h>
-fntRenderer *text ;
-fntTexFont *font ;
+static fntRenderer *text ;
+static fntTexFont *font ;
-char *file ;
-char **line ;
-int *page ;
-int num_lines = 0 ;
-int num_pages = 0 ;
-int curr_page = 0 ;
+static char *file ;
+static char **line ;
+static int *page ;
+static int num_lines = 0 ;
+static int num_pages = 0 ;
+static int curr_page = 0 ;
-void motionfn ( int, int )
+static void motionfn ( int, int )
{
glutPostRedisplay () ;
}
-void keyfn ( unsigned char key, int, int )
+static void keyfn ( unsigned char key, int, int )
{
switch ( key )
{
@@ -59,13 +69,13 @@
if ( curr_page >= num_pages ) curr_page = num_pages-1 ;
}
-void mousefn ( int /*button*/, int /*updown*/, int /*x*/, int /*y*/ )
+static void mousefn ( int /*button*/, int /*updown*/, int /*x*/, int /*y*/ )
{
exit ( 0 ) ;
}
-int getWindowHeight () { return glutGet ( (GLenum) GLUT_WINDOW_HEIGHT ) ; }
-int getWindowWidth () { return glutGet ( (GLenum) GLUT_WINDOW_WIDTH ) ; }
+static int getWindowHeight () { return glutGet ( (GLenum) GLUT_WINDOW_HEIGHT ) ; }
+static int getWindowWidth () { return glutGet ( (GLenum) GLUT_WINDOW_WIDTH ) ; }
static void setOpenGLState ( void )
{
@@ -106,7 +116,7 @@
-void displayfn (void)
+static void displayfn (void)
{
setOpenGLState () ;
glClearColor ( 0.1f, 0.4f, 0.1f, 1.0f ) ;
|