Cleanup to fgSetWindow(). The usual suspects:
* Removed tabs. * Made indentation consistant. * Killed off say-nothing-new comments. git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@274 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
parent
570e2aa0b6
commit
ba6ee1d34a
@ -215,50 +215,32 @@ GLboolean fgSetupPixelFormat( SFG_Window* window, GLboolean checkOnly,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Sets the OpenGL context and the fgStructure "Current Window" pointer to the window
|
* Sets the OpenGL context and the fgStructure "Current Window" pointer to
|
||||||
* structure passed in.
|
* the window structure passed in.
|
||||||
*/
|
*/
|
||||||
void fgSetWindow ( SFG_Window *window )
|
void fgSetWindow ( SFG_Window *window )
|
||||||
{
|
{
|
||||||
#if TARGET_HOST_UNIX_X11
|
#if TARGET_HOST_UNIX_X11
|
||||||
if ( window )
|
if ( window )
|
||||||
{
|
glXMakeCurrent(
|
||||||
/*
|
fgDisplay.Display,
|
||||||
* Make the selected window's GLX context the current one
|
window->Window.Handle,
|
||||||
*/
|
window->Window.Context
|
||||||
glXMakeCurrent(
|
);
|
||||||
fgDisplay.Display,
|
|
||||||
window->Window.Handle,
|
|
||||||
window->Window.Context
|
|
||||||
);
|
|
||||||
}
|
|
||||||
#elif TARGET_HOST_WIN32
|
#elif TARGET_HOST_WIN32
|
||||||
/*
|
if( fgStructure.Window )
|
||||||
* Release the previous' context's device context
|
ReleaseDC( fgStructure.Window->Window.Handle,
|
||||||
*/
|
fgStructure.Window->Window.Device );
|
||||||
if( fgStructure.Window != NULL )
|
|
||||||
ReleaseDC( fgStructure.Window->Window.Handle, fgStructure.Window->Window.Device );
|
|
||||||
|
|
||||||
if ( window )
|
if ( window )
|
||||||
{
|
{
|
||||||
/*
|
window->Window.Device = GetDC( window->Window.Handle );
|
||||||
* We will care about releasing the device context later
|
wglMakeCurrent(
|
||||||
*/
|
window->Window.Device,
|
||||||
window->Window.Device = GetDC( window->Window.Handle );
|
window->Window.Context
|
||||||
|
|
||||||
/*
|
|
||||||
* Set the new current context:
|
|
||||||
*/
|
|
||||||
wglMakeCurrent(
|
|
||||||
window->Window.Device,
|
|
||||||
window->Window.Context
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
|
||||||
* Remember that we have changed the current window state
|
|
||||||
*/
|
|
||||||
fgStructure.Window = window;
|
fgStructure.Window = window;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user