Splitting a little Windows-specific menu code into its own file

git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@996 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
fayjf 2012-01-23 02:46:16 +00:00
parent b5938bf572
commit 80f6707bf4
2 changed files with 58 additions and 18 deletions

View File

@ -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
*/
#if TARGET_HOST_POSIX_X11
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);
*x = fgState.GameModeSize.X + wx;
*y = fgState.GameModeSize.Y + wy;
}
#endif
static GLvoid fghGetVMaxExtent( SFG_Window* window, int* x, int* y )
{
if( fgStructure.GameModeWindow )
{
#if TARGET_HOST_POSIX_X11
int wx, wy;
Window 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 );
#endif
}
fghGetGameModeVMaxExtent ( window, x, y );
else
{
*x = fgDisplay.ScreenWidth;

View File

@ -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, <fayjf@sourceforge.net>
* 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 <GL/freeglut.h>
#include "freeglut_internal_mswin.h"
GLvoid fghGetGameModeVMaxExtent( SFG_Window* window, int* x, int* y )
{
*x = glutGet ( GLUT_SCREEN_WIDTH );
*y = glutGet ( GLUT_SCREEN_HEIGHT );
}