Hello Heiko,

When I call:

Code:
_viewer.setUpViewInWindow( 100, 100, 1024, 768 );
osg::DisplaySettings::instance()->setNumMultiSamples(4);

it don't works. But if I use

Code:
osg::DisplaySettings::instance()->setNumMultiSamples(4);
_viewer.setUpViewInWindow( 100, 100, 1024, 768 );

it works. But why? Or is it a bug?

It's not a bug. Look at the code to osgViewer::View::setUpViewInWindow(...) and think about it. That method uses the osg::DisplaySettings to do its setup. But once the GraphicsContext is created using those settings, it won't take into account the fact that you've changed the settings... So if you set the multisampling before the creation of the GraphicsContext, it takes effect, but if you set it after, it doesn't.

If you want it to be visible whenever you set the multisampling on DisplaySettings, you'll have to manually recreate your GraphicsContexts (you can call setUpViewInWindow(...) again). This may have some other effects though (your models may lose their textures if you had enabled autoUnRefAfterApply, for example - search the archives for solutions to that).

Hope this helps,

J-S
--
______________________________________________________
Jean-Sebastien Guay    [email protected]
                               http://www.cm-labs.com/
                        http://whitestar02.webhop.org/
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to