Fixing bug report 3021598 by modifying "glutSetWindow" under Windows so that it only releases and gets the device context if the window is being set to a new window

git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@888 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
fayjf 2011-01-25 05:17:12 +00:00
parent b542912840
commit dc9123210d

View File

@ -812,17 +812,20 @@ void fgSetWindow ( SFG_Window *window )
); );
} }
#elif TARGET_HOST_MS_WINDOWS #elif TARGET_HOST_MS_WINDOWS
if( fgStructure.CurrentWindow ) if ( window != fgStructure.CurrentWindow )
ReleaseDC( fgStructure.CurrentWindow->Window.Handle,
fgStructure.CurrentWindow->Window.Device );
if ( window )
{ {
window->Window.Device = GetDC( window->Window.Handle ); if( fgStructure.CurrentWindow )
wglMakeCurrent( ReleaseDC( fgStructure.CurrentWindow->Window.Handle,
window->Window.Device, fgStructure.CurrentWindow->Window.Device );
window->Window.Context
); if ( window )
{
window->Window.Device = GetDC( window->Window.Handle );
wglMakeCurrent(
window->Window.Device,
window->Window.Context
);
}
} }
#endif #endif
fgStructure.CurrentWindow = window; fgStructure.CurrentWindow = window;