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

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, ...@@ -117,8 +117,8 @@ CoreWidget( QVector<ViewMode*>& _viewModes,
splitter_ = new QSplitter(Qt::Vertical,toolSplitter_); splitter_ = new QSplitter(Qt::Vertical,toolSplitter_);
stackedWidget_ = new QStackedWidget(splitter_); stackedWidget_ = new QStackedWidget(splitter_);
QGLFormat format; QGLFormat format = QGLFormat::defaultFormat();
QGLFormat::setDefaultFormat(format);
#ifdef ARCH_DARWIN #ifdef ARCH_DARWIN
format.setStereo(false); format.setStereo(false);
#else #else
...@@ -126,12 +126,32 @@ CoreWidget( QVector<ViewMode*>& _viewModes, ...@@ -126,12 +126,32 @@ CoreWidget( QVector<ViewMode*>& _viewModes,
#endif #endif
format.setAlpha(true); format.setAlpha(true);
format.setStencil(true); format.setStencil(true);
format.setSampleBuffers(true);
QGLFormat::setDefaultFormat(format);
// Construct GL context & widget // Construct GL context & widget
baseLayout_ = new QtMultiViewLayout; baseLayout_ = new QtMultiViewLayout;
baseLayout_->setContentsMargins(0,0,0,0); 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_); glView_ = new QtGLGraphicsView(stackedWidget_);
glScene_ = new QtGLGraphicsScene (&examiner_widgets_, baseLayout_); glScene_ = new QtGLGraphicsScene (&examiner_widgets_, baseLayout_);
...@@ -143,6 +163,7 @@ CoreWidget( QVector<ViewMode*>& _viewModes, ...@@ -143,6 +163,7 @@ CoreWidget( QVector<ViewMode*>& _viewModes,
glView_->setScene(glScene_); glView_->setScene(glScene_);
centerWidget_ = new QGraphicsWidget; centerWidget_ = new QGraphicsWidget;
glScene_->addItem(centerWidget_); glScene_->addItem(centerWidget_);
centerWidget_->setGeometry (glScene_->sceneRect ()); centerWidget_->setGeometry (glScene_->sceneRect ());
......
...@@ -117,11 +117,11 @@ static const char VIEW_MAGIC[] = ...@@ -117,11 +117,11 @@ static const char VIEW_MAGIC[] =
glViewer::glViewer( QtGLGraphicsScene* _scene, glViewer::glViewer( QtGLGraphicsScene* _scene,
QGLWidget* _glWidget, QGLWidget* _glWidget,
Viewer::ViewerProperties& _properties, Viewer::ViewerProperties& _properties,
QGraphicsWidget* _parent, QGraphicsWidget* _parent,
const char* /* _name */ , const char* /* _name */ ,
QStatusBar *_statusBar) : QStatusBar *_statusBar) :
QGraphicsWidget(_parent), QGraphicsWidget(_parent),
statusbar_(_statusBar), statusbar_(_statusBar),
glareaGrabbed_(false), glareaGrabbed_(false),
......
Supports Markdown
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