From: John F. Fay Date: Sun, 5 Feb 2012 14:01:34 +0000 (+0000) Subject: Moving the platform dependencies from the "freeglut_menu.c" file to the platform... X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=commitdiff_plain;h=6f1be614bfcc2312a92104b9d97319b06dbef7e8;p=freeglut Moving the platform dependencies from the "freeglut_menu.c" file to the platform-specific header files git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@1066 7f0cb862-5218-0410-a997-914c9d46530a --- diff --git a/src/Common/freeglut_menu.c b/src/Common/freeglut_menu.c index 8444d6e..4ea023a 100644 --- a/src/Common/freeglut_menu.c +++ b/src/Common/freeglut_menu.c @@ -53,11 +53,7 @@ * that that wasn't the original intent...if not, perhaps we need another * symbolic constant, FREEGLUT_MENU_ITEM_BORDER, or such.) */ -#if TARGET_HOST_MS_WINDOWS -#define FREEGLUT_MENU_FONT GLUT_BITMAP_8_BY_13 -#else -#define FREEGLUT_MENU_FONT GLUT_BITMAP_HELVETICA_18 -#endif +/* See platform-specific header files for menu font and color definitions */ #define FREEGLUT_MENU_HEIGHT (glutBitmapHeight(FREEGLUT_MENU_FONT) + \ FREEGLUT_MENU_BORDER) @@ -72,17 +68,10 @@ * too. These variables should be stuffed into global state and initialized * via the glutInit*() system. */ -#if TARGET_HOST_MS_WINDOWS -static float menu_pen_fore [4] = {0.0f, 0.0f, 0.0f, 1.0f}; -static float menu_pen_back [4] = {0.85f, 0.85f, 0.85f, 1.0f}; -static float menu_pen_hfore [4] = {1.0f, 1.0f, 1.0f, 1.0f}; -static float menu_pen_hback [4] = {0.15f, 0.15f, 0.45f, 1.0f}; -#else -static float menu_pen_fore [4] = {0.0f, 0.0f, 0.0f, 1.0f}; -static float menu_pen_back [4] = {0.70f, 0.70f, 0.70f, 1.0f}; -static float menu_pen_hfore [4] = {0.0f, 0.0f, 0.0f, 1.0f}; -static float menu_pen_hback [4] = {1.0f, 1.0f, 1.0f, 1.0f}; -#endif +static float menu_pen_fore [4] = FREEGLUT_MENU_PEN_FORE_COLORS ; +static float menu_pen_back [4] = FREEGLUT_MENU_PEN_BACK_COLORS ; +static float menu_pen_hfore [4] = FREEGLUT_MENU_PEN_HFORE_COLORS; +static float menu_pen_hback [4] = FREEGLUT_MENU_PEN_HBACK_COLORS; extern GLvoid fgPlatformGetGameModeVMaxExtent( SFG_Window* window, int* x, int* y ); diff --git a/src/mswin/freeglut_internal_mswin.h b/src/mswin/freeglut_internal_mswin.h index 8712ad9..b37ad8c 100644 --- a/src/mswin/freeglut_internal_mswin.h +++ b/src/mswin/freeglut_internal_mswin.h @@ -108,6 +108,14 @@ struct tagSFG_PlatformJoystick #endif +/* Menu font and color definitions */ +#define FREEGLUT_MENU_FONT GLUT_BITMAP_8_BY_13 + +#define FREEGLUT_MENU_PEN_FORE_COLORS {0.0f, 0.0f, 0.0f, 1.0f} +#define FREEGLUT_MENU_PEN_BACK_COLORS {0.85f, 0.85f, 0.85f, 1.0f} +#define FREEGLUT_MENU_PEN_HFORE_COLORS {1.0f, 1.0f, 1.0f, 1.0f} +#define FREEGLUT_MENU_PEN_HBACK_COLORS {0.15f, 0.15f, 0.45f, 1.0f} + /* Function to be called on exit */ extern void (__cdecl *__glutExitFunc)( int return_value ); diff --git a/src/x11/freeglut_internal_x11.h b/src/x11/freeglut_internal_x11.h index 72fd6dc..02472e7 100644 --- a/src/x11/freeglut_internal_x11.h +++ b/src/x11/freeglut_internal_x11.h @@ -198,6 +198,17 @@ struct tagSFG_PlatformJoystick }; +/* Menu font and color definitions */ +#define FREEGLUT_MENU_FONT GLUT_BITMAP_HELVETICA_18 + +#define FREEGLUT_MENU_PEN_FORE_COLORS {0.0f, 0.0f, 0.0f, 1.0f} +#define FREEGLUT_MENU_PEN_BACK_COLORS {0.70f, 0.70f, 0.70f, 1.0f} +#define FREEGLUT_MENU_PEN_HFORE_COLORS {0.0f, 0.0f, 0.0f, 1.0f} +#define FREEGLUT_MENU_PEN_HBACK_COLORS {1.0f, 1.0f, 1.0f, 1.0f} + + + + /* -- PRIVATE FUNCTION DECLARATIONS ---------------------------------------- */ /* spaceball device functions, defined in freeglut_spaceball.c */ int fgIsSpaceballXEvent( const XEvent *ev );