Commit 4cd5359a authored by Jan Möbius's avatar Jan Möbius

Request multiSampling buffer if possible

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@5846 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 08e77cdd
......@@ -117,8 +117,8 @@ CoreWidget( QVector<ViewMode*>& _viewModes,
splitter_ = new QSplitter(Qt::Vertical,toolSplitter_);
stackedWidget_ = new QStackedWidget(splitter_);
QGLFormat format;
QGLFormat::setDefaultFormat(format);
QGLFormat format = QGLFormat::defaultFormat();
#ifdef ARCH_DARWIN
format.setStereo(false);
#else
......@@ -126,12 +126,32 @@ CoreWidget( QVector<ViewMode*>& _viewModes,
#endif
format.setAlpha(true);
format.setStencil(true);
format.setSampleBuffers(true);
QGLFormat::setDefaultFormat(format);
// Construct GL context & widget
baseLayout_ = new QtMultiViewLayout;
baseLayout_->setContentsMargins(0,0,0,0);
glWidget_ = new QGLWidget(format);
// ===============================================================================
// Test context capabilities ...
// If we get stereo buffers, we use them .. which might disable multisampling
// If we dont have stereo, we disable it to not interfere with multisampling
// ===============================================================================
QGLWidget* test = new QGLWidget(format);
if ( ! test->format().stereo() ) {
// std::cerr << "No stereo ... disabling stereo for real context!" << std::endl;
format.setStereo(false);
QGLFormat::setDefaultFormat(format);
}/* else {
std::cerr << "Stereo found ok" << std::endl;
}*/
delete test;
glWidget_ = new QGLWidget(format,0);
glView_ = new QtGLGraphicsView(stackedWidget_);
glScene_ = new QtGLGraphicsScene (&examiner_widgets_, baseLayout_);
......@@ -143,6 +163,7 @@ CoreWidget( QVector<ViewMode*>& _viewModes,
glView_->setScene(glScene_);
centerWidget_ = new QGraphicsWidget;
glScene_->addItem(centerWidget_);
centerWidget_->setGeometry (glScene_->sceneRect ());
......
......@@ -117,11 +117,11 @@ static const char VIEW_MAGIC[] =
glViewer::glViewer( QtGLGraphicsScene* _scene,
QGLWidget* _glWidget,
QGLWidget* _glWidget,
Viewer::ViewerProperties& _properties,
QGraphicsWidget* _parent,
const char* /* _name */ ,
QStatusBar *_statusBar) :
QGraphicsWidget* _parent,
const char* /* _name */ ,
QStatusBar *_statusBar) :
QGraphicsWidget(_parent),
statusbar_(_statusBar),
glareaGrabbed_(false),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment