mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 09:38:07 +02:00
st/wgl: Adjust the pbuffer invisible window size.
Thanks to Brian Paul for diagnosing the issue.
This commit is contained in:
parent
81992010b5
commit
f4e392bf8d
1 changed files with 53 additions and 8 deletions
|
|
@ -52,6 +52,9 @@ wglCreatePbufferARB(HDC _hDC,
|
||||||
int useLargest = 0;
|
int useLargest = 0;
|
||||||
const struct stw_pixelformat_info *info;
|
const struct stw_pixelformat_info *info;
|
||||||
struct stw_framebuffer *fb;
|
struct stw_framebuffer *fb;
|
||||||
|
DWORD dwExStyle;
|
||||||
|
DWORD dwStyle;
|
||||||
|
RECT rect;
|
||||||
HWND hWnd;
|
HWND hWnd;
|
||||||
HDC hDC;
|
HDC hDC;
|
||||||
|
|
||||||
|
|
@ -113,15 +116,45 @@ wglCreatePbufferARB(HDC _hDC,
|
||||||
first = FALSE;
|
first = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
hWnd = CreateWindowEx(0,
|
dwExStyle = 0;
|
||||||
|
dwStyle = WS_CLIPSIBLINGS | WS_CLIPCHILDREN;
|
||||||
|
|
||||||
|
if (0) {
|
||||||
|
/*
|
||||||
|
* Don't hide the window -- useful for debugging what the application is
|
||||||
|
* drawing
|
||||||
|
*/
|
||||||
|
|
||||||
|
dwStyle |= WS_VISIBLE | WS_OVERLAPPEDWINDOW;
|
||||||
|
} else {
|
||||||
|
dwStyle |= WS_POPUPWINDOW;
|
||||||
|
}
|
||||||
|
|
||||||
|
rect.left = 0;
|
||||||
|
rect.top = 0;
|
||||||
|
rect.right = rect.left + iWidth;
|
||||||
|
rect.bottom = rect.top + iHeight;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The CreateWindowEx parameters are the total (outside) dimensions of the
|
||||||
|
* window, which can vary with Windows version and user settings. Use
|
||||||
|
* AdjustWindowRect to get the required total area for the given client area.
|
||||||
|
*
|
||||||
|
* AdjustWindowRectEx does not accept WS_OVERLAPPED style (which is defined
|
||||||
|
* as 0), which means we need to use some other style instead, e.g.,
|
||||||
|
* WS_OVERLAPPEDWINDOW or WS_POPUPWINDOW as above.
|
||||||
|
*/
|
||||||
|
|
||||||
|
AdjustWindowRectEx(&rect, dwStyle, FALSE, dwExStyle);
|
||||||
|
|
||||||
|
hWnd = CreateWindowEx(dwExStyle,
|
||||||
"wglpbuffer", /* wc.lpszClassName */
|
"wglpbuffer", /* wc.lpszClassName */
|
||||||
"wglpbuffer",
|
NULL,
|
||||||
#if 0 /* Useful for debugging what the application is drawing */
|
dwStyle,
|
||||||
WS_VISIBLE |
|
CW_USEDEFAULT, /* x */
|
||||||
#endif
|
CW_USEDEFAULT, /* y */
|
||||||
WS_CLIPSIBLINGS | WS_CLIPCHILDREN,
|
rect.right - rect.left, /* width */
|
||||||
CW_USEDEFAULT, CW_USEDEFAULT, /* x, y */
|
rect.bottom - rect.top, /* height */
|
||||||
iWidth, iHeight,
|
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
|
|
@ -130,6 +163,18 @@ wglCreatePbufferARB(HDC _hDC,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
/*
|
||||||
|
* Verify the client area size matches the specified size.
|
||||||
|
*/
|
||||||
|
|
||||||
|
GetClientRect(hWnd, &rect);
|
||||||
|
assert(rect.left == 0);
|
||||||
|
assert(rect.top == 0);
|
||||||
|
assert(rect.right - rect.left == iWidth);
|
||||||
|
assert(rect.bottom - rect.top == iHeight);
|
||||||
|
#endif
|
||||||
|
|
||||||
hDC = GetDC(hWnd);
|
hDC = GetDC(hWnd);
|
||||||
if (!hDC) {
|
if (!hDC) {
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue