From: Nigel S. a. F. S. <ni...@ni...> - 2003-11-24 04:17:24
|
Hello, With some changes to the function fghReshapeWindowByHandle, a problem was introduced. On Windows, the width and height are adjusted to allow for the size of the GUI decoration. Unfortunately, these _adjusted_ numbers are also passed either to glViewport or the application resize callback handler. This results in the application being given incorrect OpenGL viewport dimensions. By introducing w and h variables in the win32 specific block, this problem is easily resolved: #elif TARGET_HOST_WIN32 { RECT winRect; int x, y; int w, h; GetWindowRect( window->Window.Handle, &winRect ); x = winRect.left; y = winRect.top; w = width; h = height; if ( window->Parent == NULL ) { /* * Adjust the size of the window to allow for the size of the * frame, if we are not a menu */ if ( ! window->IsMenu ) { w += GetSystemMetrics( SM_CXSIZEFRAME ) * 2; h += GetSystemMetrics( SM_CYSIZEFRAME ) * 2 + GetSystemMetrics( SM_CYCAPTION ); } } else { GetWindowRect( window->Parent->Window.Handle, &winRect ); x -= winRect.left + GetSystemMetrics( SM_CXSIZEFRAME ); y -= winRect.top + GetSystemMetrics( SM_CYSIZEFRAME ) + GetSystemMetrics( SM_CYCAPTION ); } MoveWindow( window->Window.Handle, x, y, w, h, TRUE ); } #endif |