X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Ffreeglut_glutfont_definitions.c;h=454ecb738f152a678dbb13b5841c239c2776721f;hb=3c7c46e5846a39dde8be85c131e69cab1d8cb1ec;hp=81547748c0a775fa7b2a42fadd2cd1def514e3cf;hpb=fee0adb5bcfe989d4b9702f104008250a588902d;p=freeglut diff --git a/src/freeglut_glutfont_definitions.c b/src/freeglut_glutfont_definitions.c index 8154774..454ecb7 100644 --- a/src/freeglut_glutfont_definitions.c +++ b/src/freeglut_glutfont_definitions.c @@ -3,9 +3,10 @@ * * Bitmap and stroke fonts displaying. * - * Copyright (c) 2003 Stephen J. Baker (whether he wants it or not). All Rights Reserved. - * Written by John F. Fay , who releases the copyright over to the - * "freeglut" project lead. + * Copyright (c) 2003 Stephen J. Baker (whether he wants it or not). + * All Rights Reserved. + * Written by John F. Fay , who releases the + * copyright over to the "freeglut" project lead. * Creation date: Mon July 21 2003 * * Permission is hereby granted, free of charge, to any person obtaining a @@ -27,38 +28,69 @@ */ /* - * This file is necessary for the *nix version of "freeglut" because the original GLUT - * defined its font variables in rather an unusual way. Publicly, in "glut.h", they were - * defined as "void *". Privately, in one of the source code files, they were defined as - * pointers to a structure. Most compilers and linkers are satisfied with the "void *" - * and don't go any farther, but some of them balked. In particular, when compiling with - * "freeglut" and then trying to run using the GLUT ".so" library, some of them would give - * an error. So we are having to create this file to define the variables as pointers - * to an unusual structure to match GLUT. + * This file is necessary for the *nix version of "freeglut" because the + * original GLUT defined its font variables in rather an unusual way. + * Publicly, in "glut.h", they were defined as "void *". Privately, + * in one of the source code files, they were defined as pointers to a + * structure. Most compilers and linkers are satisfied with the "void *" + * and don't go any farther, but some of them balked. In particular, + * when compiling with "freeglut" and then trying to run using the GLUT + * ".so" library, some of them would give an error. So we are having to + * create this file to define the variables as pointers to an unusual + * structure to match GLUT. */ -#include "freeglut_internal.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 -#if TARGET_HOST_UNIX_X11 +#include + +#undef glutStrokeRoman +#undef glutStrokeMonoRoman +#undef glutBitmap9By15 +#undef glutBitmap8By13 +#undef glutBitmapTimesRoman10 +#undef glutBitmapTimesRoman24 +#undef glutBitmapHelvetica10 +#undef glutBitmapHelvetica12 +#undef glutBitmapHelvetica18 + +#include "freeglut_internal.h" -#define G_LOG_DOMAIN "freeglut-glutfont-definitions" +#if TARGET_HOST_POSIX_X11 struct freeglutStrokeFont -{ - const char *name ; - int num_chars ; - void *ch ; - float top ; - float bottom ; -} ; +{ + const char *name ; + int num_chars ; + void *ch ; + float top ; + float bottom ; +}; struct freeglutBitmapFont -{ - const char *name ; - const int num_chars ; - const int first ; - const void *ch ; -} ; +{ + const char *name ; + const int num_chars ; + const int first ; + const void *ch ; +}; struct freeglutStrokeFont glutStrokeRoman ;