From: <sp...@us...> - 2008-11-20 11:59:36
|
Revision: 761 http://freeglut.svn.sourceforge.net/freeglut/?rev=761&view=rev Author: spanne Date: 2008-11-20 11:59:29 +0000 (Thu, 20 Nov 2008) Log Message: ----------- Yet another try to make the font definitions compile on all platforms. Modified Paths: -------------- trunk/freeglut/freeglut/src/freeglut_glutfont_definitions.c trunk/freeglut/freeglut/src/freeglut_internal.h Modified: trunk/freeglut/freeglut/src/freeglut_glutfont_definitions.c =================================================================== --- trunk/freeglut/freeglut/src/freeglut_glutfont_definitions.c 2008-11-17 14:50:08 UTC (rev 760) +++ trunk/freeglut/freeglut/src/freeglut_glutfont_definitions.c 2008-11-20 11:59:29 UTC (rev 761) @@ -40,7 +40,37 @@ * structure to match GLUT. */ -#include <GL/freeglut.h> +/* + * freeglut_internal.h uses some GL types, but including the GL header portably + * is a bit tricky, so we include freeglut_std.h here, which contains the + * necessary machinery. But this poses another problem, caused by the ugly + * original defintion of the font constants in "classic" GLUT: They are defined + * as void* externally, so we move them temporarily out of the way by AN EXTREME + * CPP HACK. + */ + +#define glutStrokeRoman glutStrokeRomanIGNOREME +#define glutStrokeMonoRoman glutStrokeMonoRomanIGNOREME +#define glutBitmap9By15 glutBitmap9By15IGNOREME +#define glutBitmap8By13 glutBitmap8By13IGNOREME +#define glutBitmapTimesRoman10 glutBitmapTimesRoman10IGNOREME +#define glutBitmapTimesRoman24 glutBitmapTimesRoman24IGNOREME +#define glutBitmapHelvetica10 glutBitmapHelvetica10IGNOREME +#define glutBitmapHelvetica12 glutBitmapHelvetica12IGNOREME +#define glutBitmapHelvetica18 glutBitmapHelvetica18IGNOREME + +#include <GL/freeglut_std.h> + +#undef glutStrokeRoman +#undef glutStrokeMonoRoman +#undef glutBitmap9By15 +#undef glutBitmap8By13 +#undef glutBitmapTimesRoman10 +#undef glutBitmapTimesRoman24 +#undef glutBitmapHelvetica10 +#undef glutBitmapHelvetica12 +#undef glutBitmapHelvetica18 + #include "freeglut_internal.h" #if TARGET_HOST_POSIX_X11 @@ -54,6 +84,15 @@ float bottom ; }; +struct freeglutBitmapFont +{ + const char *name ; + const int num_chars ; + const int first ; + const void *ch ; +}; + + struct freeglutStrokeFont glutStrokeRoman ; struct freeglutStrokeFont glutStrokeMonoRoman ; Modified: trunk/freeglut/freeglut/src/freeglut_internal.h =================================================================== --- trunk/freeglut/freeglut/src/freeglut_internal.h 2008-11-17 14:50:08 UTC (rev 760) +++ trunk/freeglut/freeglut/src/freeglut_internal.h 2008-11-20 11:59:29 UTC (rev 761) @@ -687,18 +687,6 @@ float xorig, yorig; /* Relative origin of the character */ }; -#if TARGET_HOST_POSIX_X11 - -struct freeglutBitmapFont -{ - const char *name ; - const int num_chars ; - const int first ; - const void *ch ; -}; - -#endif - /* The stroke font structures */ typedef struct tagSFG_StrokeVertex SFG_StrokeVertex; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |