diff options
author | Thorvald Natvig <slicer@users.sourceforge.net> | 2010-01-26 15:38:38 +0300 |
---|---|---|
committer | Thorvald Natvig <slicer@users.sourceforge.net> | 2010-01-26 15:38:38 +0300 |
commit | e51a048fe9c259e0f1dbacadd686ddf63c229eeb (patch) | |
tree | 4fdc6e8e9717123fbe03eb4e98cb8aa0f99f4997 /overlay/opengl.cpp | |
parent | c00b9bfe9e20869e1acc92651ee8dafaa15479e7 (diff) |
Make Win32 OGL overlay work in windowed mode
Diffstat (limited to 'overlay/opengl.cpp')
-rw-r--r-- | overlay/opengl.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/overlay/opengl.cpp b/overlay/opengl.cpp index 053001911..084e29b5e 100644 --- a/overlay/opengl.cpp +++ b/overlay/opengl.cpp @@ -243,6 +243,15 @@ void Context::draw(HDC hdc) { width = oGetDeviceCaps(hdc, HORZRES); height = oGetDeviceCaps(hdc, VERTRES); + + HWND hwnd = WindowFromDC(hdc); + if (hwnd) { + RECT r; + if (GetClientRect(hwnd, &r)) { + width = r.right - r.left; + height = r.bottom - r.top; + } + } ods("OpenGL: DrawStart: Screen is %d x %d", width, height); |