Mesa (7.10): st/wgl: Allow to create pbuffers bigger than the desktop.
Jose Fonseca
jrfonseca at kemper.freedesktop.org
Sun Jun 12 08:25:01 UTC 2011
Module: Mesa
Branch: 7.10
Commit: 22bf0ec9912c5f5c0d5f12ea943eca4c67892588
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=22bf0ec9912c5f5c0d5f12ea943eca4c67892588
Author: José Fonseca <jfonseca at vmware.com>
Date: Tue May 3 19:09:53 2011 +0100
st/wgl: Allow to create pbuffers bigger than the desktop.
We use a hidden window for pbuffer contexts, but Windows limits window
sizes to the desktop size by default. This means that creating a big
pbuffer on a small resolution single monitor would truncate the pbuffer
size to the desktop.
This change overrides the windows maximum size, allow to create windows
arbitrarily large.
---
src/gallium/state_trackers/wgl/stw_ext_pbuffer.c | 26 +++++++++++++++++++++-
1 files changed, 25 insertions(+), 1 deletions(-)
diff --git a/src/gallium/state_trackers/wgl/stw_ext_pbuffer.c b/src/gallium/state_trackers/wgl/stw_ext_pbuffer.c
index fb5d5e8..424d8da 100644
--- a/src/gallium/state_trackers/wgl/stw_ext_pbuffer.c
+++ b/src/gallium/state_trackers/wgl/stw_ext_pbuffer.c
@@ -40,6 +40,30 @@
#include "stw_framebuffer.h"
+#define LARGE_WINDOW_SIZE 60000
+
+
+static LRESULT CALLBACK
+WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
+{
+ MINMAXINFO *pMMI;
+ switch (uMsg) {
+ case WM_GETMINMAXINFO:
+ // Allow to create a window bigger than the desktop
+ pMMI = (MINMAXINFO *)lParam;
+ pMMI->ptMaxSize.x = LARGE_WINDOW_SIZE;
+ pMMI->ptMaxSize.y = LARGE_WINDOW_SIZE;
+ pMMI->ptMaxTrackSize.x = LARGE_WINDOW_SIZE;
+ pMMI->ptMaxTrackSize.y = LARGE_WINDOW_SIZE;
+ break;
+ default:
+ break;
+ }
+
+ return DefWindowProc(hWnd, uMsg, wParam, lParam);
+}
+
+
HPBUFFERARB WINAPI
wglCreatePbufferARB(HDC _hDC,
int iPixelFormat,
@@ -109,7 +133,7 @@ wglCreatePbufferARB(HDC _hDC,
wc.hbrBackground = (HBRUSH) (COLOR_BTNFACE + 1);
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
- wc.lpfnWndProc = DefWindowProc;
+ wc.lpfnWndProc = WndProc;
wc.lpszClassName = "wglpbuffer";
wc.style = CS_OWNDC | CS_HREDRAW | CS_VREDRAW;
RegisterClass(&wc);
More information about the mesa-commit
mailing list