X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2FCommon%2Ffreeglut_menu.c;h=2fc528be19f428f9d1571893b37cd2c5082d47d1;hb=90b777df737006ae0b92acfdd0efc29f7bec136c;hp=2a963e2165aa8ab46031f4bed3be9e0eddc06b71;hpb=d2f7ea29ea6d946f455f4363c3f058ff2bdfba35;p=freeglut diff --git a/src/Common/freeglut_menu.c b/src/Common/freeglut_menu.c index 2a963e2..2fc528b 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 fgPlatformGetGameModeVMaxExtent( 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; +GLvoid fgPlatformGetGameModeVMaxExtent( 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.pDisplay.Display, + window->Window.Handle, + fgDisplay.pDisplay.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 ) + fgPlatformGetGameModeVMaxExtent ( window, x, y ); else { *x = fgDisplay.ScreenWidth; @@ -779,14 +783,6 @@ int FGAPIENTRY glutCreateMenu( void(* callback)( int ) ) return fgCreateMenu( callback )->ID; } -#if TARGET_HOST_MS_WINDOWS -int FGAPIENTRY __glutCreateMenuWithExit( void(* callback)( int ), void (__cdecl *exit_function)(int) ) -{ - __glutExitFunc = exit_function; - return glutCreateMenu( callback ); -} -#endif - /* * Destroys a menu object, removing all references to it */