* and the window rect from the client area given the style of the window
* (or a valid window pointer from which the style can be queried).
*/
-extern void fghComputeWindowRectFromClientArea_QueryWindow( const SFG_Window *window, RECT *clientRect, BOOL posIsOutside );
-extern RECT fghGetClientArea ( const SFG_Window *window, BOOL wantPosOutside );
+extern void fghComputeWindowRectFromClientArea_QueryWindow( RECT *clientRect, const SFG_Window *window, BOOL posIsOutside );
+extern void fghGetClientArea ( RECT *clientRect, const SFG_Window *window, BOOL wantPosOutside );
void fgPlatformReshapeWindow ( SFG_Window *window, int width, int height )
* For windowed mode, get the current position of the
* window and resize taking the size of the frame
* decorations into account.
+ *
+ * Note on maximizing behavior of Windows: the resize borders are off
+ * the screen such that the client area extends all the way from the
+ * leftmost corner to the rightmost corner to maximize screen real
+ * estate. A caption is still shown however to allow interaction with
+ * the window controls. This is default behavior of Windows that
+ * FreeGLUT sticks with. To alter, one would have to check if
+ * WS_MAXIMIZE style is set when a resize event is triggered, and
+ * then manually correct the windowRect to put the borders back on
+ * screen.
*/
/* "GetWindowRect" returns the pixel coordinates of the outside of the window */
if (window->Parent == NULL)
/* get the window rect from this to feed to SetWindowPos, correct for window decorations */
- fghComputeWindowRectFromClientArea_QueryWindow(window,&windowRect,TRUE);
+ fghComputeWindowRectFromClientArea_QueryWindow(&windowRect,window,TRUE);
else
{
/* correct rect for position client area of parent window
* for them.
*/
RECT parentRect;
- parentRect = fghGetClientArea( window->Parent, FALSE );
- windowRect.left -= parentRect.left;
- windowRect.right -= parentRect.left;
- windowRect.top -= parentRect.top;
- windowRect.bottom -= parentRect.top;
+ fghGetClientArea( &parentRect, window->Parent, FALSE );
+ OffsetRect(&windowRect,-parentRect.left,-parentRect.top);
}
/* Do the actual resizing */