From: John F. Fay Date: Mon, 23 Jan 2012 02:46:16 +0000 (+0000) Subject: Splitting a little Windows-specific menu code into its own file X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=commitdiff_plain;h=9276442d096db4de1ba112672f80dbb822fbb3df;p=freeglut Splitting a little Windows-specific menu code into its own file git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@996 7f0cb862-5218-0410-a997-914c9d46530a --- diff --git a/src/Common/freeglut_menu.c b/src/Common/freeglut_menu.c index 2a963e2..91b2b83 100644 --- a/src/Common/freeglut_menu.c +++ b/src/Common/freeglut_menu.c @@ -84,6 +84,9 @@ 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 + +extern GLvoid fghGetGameModeVMaxExtent( SFG_Window* window, int* x, int* y ); + /* -- PRIVATE FUNCTIONS ---------------------------------------------------- */ /* @@ -139,27 +142,28 @@ static void fghDeactivateSubMenu( SFG_MenuEntry *menuEntry ) /* * Private function to get the virtual maximum screen extent */ -static GLvoid fghGetVMaxExtent( SFG_Window* window, int* x, int* y ) -{ - if( fgStructure.GameModeWindow ) - { #if TARGET_HOST_POSIX_X11 - int wx, wy; - Window w; +static GLvoid fghGetGameModeVMaxExtent( SFG_Window* window, int* x, int* y ) +{ + int wx, wy; + Window w; - XTranslateCoordinates( - fgDisplay.Display, - window->Window.Handle, - fgDisplay.RootWindow, - 0, 0, &wx, &wy, &w); + XTranslateCoordinates( + fgDisplay.Display, + window->Window.Handle, + fgDisplay.RootWindow, + 0, 0, &wx, &wy, &w); - *x = fgState.GameModeSize.X + wx; - *y = fgState.GameModeSize.Y + wy; -#else - *x = glutGet ( GLUT_SCREEN_WIDTH ); - *y = glutGet ( GLUT_SCREEN_HEIGHT ); + *x = fgState.GameModeSize.X + wx; + *y = fgState.GameModeSize.Y + wy; +} #endif - } + + +static GLvoid fghGetVMaxExtent( SFG_Window* window, int* x, int* y ) +{ + if( fgStructure.GameModeWindow ) + fghGetGameModeVMaxExtent ( window, x, y ); else { *x = fgDisplay.ScreenWidth; diff --git a/src/mswin/freeglut_menu_mswin.c b/src/mswin/freeglut_menu_mswin.c index e69de29..5d22b16 100644 --- a/src/mswin/freeglut_menu_mswin.c +++ b/src/mswin/freeglut_menu_mswin.c @@ -0,0 +1,36 @@ +/* + * freeglut_menu_mswin.c + * + * The Windows-specific mouse cursor related stuff. + * + * Copyright (c) 2012 Stephen J. Baker. All Rights Reserved. + * Written by John F. Fay, + * Creation date: Sun Jan 22, 2012 + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * PAWEL W. OLSZTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +#include +#include "freeglut_internal_mswin.h" + + +GLvoid fghGetGameModeVMaxExtent( SFG_Window* window, int* x, int* y ) +{ + *x = glutGet ( GLUT_SCREEN_WIDTH ); + *y = glutGet ( GLUT_SCREEN_HEIGHT ); +}