Yuri D\'Elia\'s changes to the game mode window
git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@578 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
parent
ddda7ab09f
commit
a972964124
@ -291,10 +291,13 @@ static GLboolean fghChangeDisplayMode( GLboolean haveToTest )
|
|||||||
}
|
}
|
||||||
|
|
||||||
# else
|
# else
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* XXX warning fghChangeDisplayMode: missing XFree86 video mode extensions,
|
* XXX warning fghChangeDisplayMode: missing XFree86 video mode extensions,
|
||||||
* XXX game mode will not change screen resolution when activated
|
* XXX game mode will not change screen resolution when activated
|
||||||
*/
|
*/
|
||||||
|
success = GL_TRUE;
|
||||||
|
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
#elif TARGET_HOST_WIN32 || TARGET_HOST_WINCE
|
#elif TARGET_HOST_WIN32 || TARGET_HOST_WINCE
|
||||||
@ -435,24 +438,12 @@ int FGAPIENTRY glutEnterGameMode( void )
|
|||||||
|
|
||||||
#if TARGET_HOST_UNIX_X11
|
#if TARGET_HOST_UNIX_X11
|
||||||
|
|
||||||
/* Move the window up to the topleft corner */
|
|
||||||
XMoveWindow( fgDisplay.Display, fgStructure.CurrentWindow->Window.Handle, 0, 0 );
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Sync needed to avoid a real race, the Xserver must have really created
|
* Sync needed to avoid a real race, the Xserver must have really created
|
||||||
* the window before we can grab the pointer into it:
|
* the window before we can grab the pointer into it:
|
||||||
*/
|
*/
|
||||||
XSync( fgDisplay.Display, False );
|
XSync( fgDisplay.Display, False );
|
||||||
|
|
||||||
/* Move the Pointer to the middle of the fullscreen window */
|
|
||||||
XWarpPointer(
|
|
||||||
fgDisplay.Display,
|
|
||||||
None,
|
|
||||||
fgDisplay.RootWindow,
|
|
||||||
0, 0, 0, 0,
|
|
||||||
fgState.GameModeSize.X/2, fgState.GameModeSize.Y/2
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Grab the pointer to confine it into the window after the calls to
|
* Grab the pointer to confine it into the window after the calls to
|
||||||
* XWrapPointer() which ensure that the pointer really enters the window.
|
* XWrapPointer() which ensure that the pointer really enters the window.
|
||||||
@ -482,6 +473,15 @@ int FGAPIENTRY glutEnterGameMode( void )
|
|||||||
CurrentTime
|
CurrentTime
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/* Move the Pointer to the middle of the fullscreen window */
|
||||||
|
XWarpPointer(
|
||||||
|
fgDisplay.Display,
|
||||||
|
None,
|
||||||
|
fgDisplay.RootWindow,
|
||||||
|
0, 0, 0, 0,
|
||||||
|
fgState.GameModeSize.X/2, fgState.GameModeSize.Y/2
|
||||||
|
);
|
||||||
|
|
||||||
# ifdef X_XF86VidModeSetViewPort
|
# ifdef X_XF86VidModeSetViewPort
|
||||||
|
|
||||||
if( fgDisplay.DisplayModeValid )
|
if( fgDisplay.DisplayModeValid )
|
||||||
|
Reference in New Issue
Block a user