[osg-users] set proper size to window manager at startup

Gianni Ambrosio g.ambrosio+osg at gmail.com
Fri Apr 15 00:42:57 PDT 2016


Hi All,
I have a Qt application ad I have to initialize a WindowManager with some default width and height like follows:

osg::ref_ptr<osgWidget::WindowManager> wm = new osgWidget::WindowManager(view, 1280.0f, 1024.0f, MASK_2D, osgWidget::WindowManager::WM_USE_RENDERBINS);

When the Qt application starts up then the QWidget containing the OSG view is resized properly by the Qt framework but even if I use:

view->addEventHandler(new osgWidget::ResizeHandler(wm, camera));

an osgGA::GUIEventAdapter::RESIZE event is not raised at that point. That means, every OSG windows added to the WindowManager are not resized correctly. Only when the user interactiverly resizes the window of Qt application, then a osgGA::GUIEventAdapter::RESIZE is rised and, falling into ResizeHandler::handle() methodm the Window Manager is updated with proper width and height.

Now, which is the correct way you see to solve this issue?

Regards,
Gianni

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=66828#66828








More information about the osg-users mailing list