[osg-users] OSG with QGLWidget and Anti Aliasing

359 views
Skip to first unread message

dominic...@bluewin.ch

unread,
Nov 10, 2009, 9:54:23 AM11/10/09
to osg-...@lists.openscenegraph.org
Hi there

I am absolutly new to the OSG stuff (and it's the first time I attend in
a mailing list) and trying to get my OSG work in a Qt environment. I
made my own OSG/Qt class, which inherits from QGLWidget and
osgViewer::Viewer. Most of the OSG stuff works, but I can't enable the
anti aliasing or the multi sampling.

I tried the following two configurations:

1.
ref_ptr< DisplaySettings > displaySettings = new DisplaySettings;
displaySettings->setNumMultiSamples(16);
modelView->setDisplaySettings( displaySettings.get() );

2.
osg::DisplaySettings::instance()->setNumMultiSamples(8);

But this didn't work. Does anybody had the same problems or have some
ideas to solve this problem. I attached my class and header files.

If I'm doing something wrong concerning the "mailing list rules", just
let me know.

Thanks a lot and regards
Dominic

qwtglwidget.cpp
qwtglwidget.h

Dominic Stalder

unread,
Nov 11, 2009, 5:23:34 AM11/11/09
to dominic...@bluewin.ch, OpenSceneGraph Users
Sorry, searched on the wrong framework. I could solve the problem in Qt
itself:

QGLFormat fmt;
QGLFormat::setDefaultFormat(fmt);
fmt.setSamples(4);
fmt.setSampleBuffers(true);

qglwidget->setFormat(fmt);

> ------------------------------------------------------------------------
>
> _______________________________________________
> osg-users mailing list
> osg-...@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

_______________________________________________
osg-users mailing list
osg-...@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply all
Reply to author
Forward
0 new messages