Hi all,
I've been trying to create an OSG window bigger than the screen on Windows 7
Unfortunately viewer.setupViewInWindow() will not allow the window's client
area to extend beyond the screen size.
I've been using this dirty hack to get my OSG window to the desired width,
height. Is there a cleaner way to do this?
// make absolutelly sure we get the requested client area in the window
{
osgViewer::GraphicsWindowWin32* gw =
dynamic_cast<osgViewer::GraphicsWindowWin32*> (
viewer->getCamera()->getGraphicsContext());
HWND window = gw->getHWND();
RECT wrect, crect;
GetWindowRect(window, &wrect);
fprintf(stderr, "***GetWindowRect: %d, %d, %d, %d\n", wrect.left,
wrect.top, wrect.right - wrect.left, wrect.bottom - wrect.top);
GetClientRect(window, &crect);
fprintf(stderr, "***GetClientRect: %d, %d, %d, %d\n", crect.left,
crect.top, crect.right - crect.left, crect.bottom - crect.top);
if (crect.right - crect.left < width || crect.bottom - crect.top <
height)
{
int dx = width - (crect.right - crect.left);
int dy = height - (crect.bottom - crect.top);
fprintf(stderr, "***Window size delta: %d, %d\n", dx, dy);
SetWindowPos(window, NULL, wrect.left, wrect.top, wrect.right -
wrect.left + dx, wrect.bottom - wrect.top + dy, SWP_NOSENDCHANGING);
GetClientRect(window, &crect);
fprintf(stderr, "***GetClientRect (Corrected): %d, %d, %d,
%d\n", crect.left, crect.top, crect.right - crect.left, crect.bottom -
crect.top);
}
}
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org