osg反走样

osg::ref_ptr<osg::GraphicsContext::Traits> traits = new osg::GraphicsContext::Traits;
    traits->windowDecoration = false;
    traits->x = x;
    traits->y = y;
    traits->width = w;
    traits->height = h;
    traits->doubleBuffer = true;
    traits->samples = 8;
    在窗口建立之前调用
    return new osgQt::GraphicsWindowQt(traits.get(),parent)

 

或者

osg::ref_ptr< osg::DisplaySettings > displaySettings = new osg::DisplaySettings;
displaySettings->setNumMultiSamples(16);
this->setDisplaySettings( displaySettings.get());

在窗口建立之前调用
posted @ 2017-03-20 15:40  北山愚公*  阅读(483)  评论(0编辑  收藏  举报