diff --git a/include/osgViewer/api/Carbon/GraphicsWindowCarbon b/include/osgViewer/api/Carbon/GraphicsWindowCarbon index 1e6014b1d..08d45d82c 100644 --- a/include/osgViewer/api/Carbon/GraphicsWindowCarbon +++ b/include/osgViewer/api/Carbon/GraphicsWindowCarbon @@ -81,6 +81,9 @@ class GraphicsWindowCarbon : public osgViewer::GraphicsWindow /** Check to see if any events have been generated.*/ virtual void checkEvents(); + /** Set the window's position and size.*/ + virtual void setWindowRectangle(int x, int y, int width, int height); + /** Set Window decoration.*/ virtual void setWindowDecoration(bool flag); diff --git a/include/osgViewer/api/Win32/GraphicsWindowWin32 b/include/osgViewer/api/Win32/GraphicsWindowWin32 index aa7455819..c67b353c5 100644 --- a/include/osgViewer/api/Win32/GraphicsWindowWin32 +++ b/include/osgViewer/api/Win32/GraphicsWindowWin32 @@ -60,6 +60,9 @@ class GraphicsWindowWin32 : public osgViewer::GraphicsWindow /** Check to see if any events have been generated.*/ virtual void checkEvents(); + /** Set the window's position and size.*/ + virtual void setWindowRectangle(int x, int y, int width, int height); + /** Set Window decoration.*/ virtual void setWindowDecoration(bool flag); diff --git a/src/osgViewer/GraphicsWindowCarbon.cpp b/src/osgViewer/GraphicsWindowCarbon.cpp index 55b2a2c6f..a6c68b74a 100644 --- a/src/osgViewer/GraphicsWindowCarbon.cpp +++ b/src/osgViewer/GraphicsWindowCarbon.cpp @@ -1060,6 +1060,11 @@ void GraphicsWindowCarbon::checkEvents() } +void GraphicsWindowCarbon::setWindowRectangle(int x, int y, int width, int height) +{ + // TODO: implement + osg::notify(osg::NOTICE)<<"GraphicsWindowCarbon::setWindowRectangle(..) not implemented."<mouseWarped(x,y); } +void GraphicsWindowWin32::setWindowRectangle(int x, int y, int width, int height) +{ + if (!::SetWindowPos(_hwnd, HWND_TOP, x, y, width, height, SWP_SHOWWINDOW | SWP_FRAMECHANGED)) + { + reportErrorForScreen("GraphicsWindowWin32::setWindowRectangle() - Unable to set new window position and size", _traits->screenNum, ::GetLastError()); + } +} + void GraphicsWindowWin32::useCursor( bool cursorOn ) { _traits->useCursor = cursorOn;