Commit 44ac98c9 authored by Martin Schultz's avatar Martin Schultz

removed stereo check, because failing the check might result in

acquiring a wrong opengl context
parent 15ebce8d
......@@ -207,72 +207,12 @@ CoreWidget( QVector<ViewMode*>& _viewModes,
splitter_ = new QSplitter(Qt::Vertical,toolSplitter_);
stackedWidget_ = new QStackedWidget(splitter_);
OFGLFormat format = OFGLFormat::defaultFormat();
#ifdef ARCH_DARWIN
format.setStereo(false);
#else
format.setStereo(OpenFlipper::Options::stereo());
#endif
#if (QT_VERSION >= QT_VERSION_CHECK(5,0,0))
format.setAlphaBufferSize(8);
format.setStencilBufferSize(8);
format.setSamples(OpenFlipper::Options::samples());
#else
format.setAlpha(true);
format.setStencil(true);
format.setSampleBuffers(true);
#endif
// Construct GL context & widget
baseLayout_ = new QtMultiViewLayout;
baseLayout_->setContentsMargins(0,0,0,0);
// ===============================================================================
// Test context capabilities ...
// If we get stereo buffers, we use them .. which might disable multisampling
// If we don't have stereo, we disable it to not interfere with multisampling
// ===============================================================================
#if (QT_VERSION >= QT_VERSION_CHECK(5, 4, 0))
OFGLWidget* test = new OFGLWidget();
test->setFormat(format);
#else
OFGLWidget* test = new OFGLWidget(format);
#endif
if ( ! test->format().stereo() ) {
// std::cerr << "No stereo ... disabling stereo for real context!" << std::endl;
format.setStereo(false);
}/* else {
std::cerr << "Stereo found ok" << std::endl;
}*/
delete test;
if (OpenFlipper::Options::coreProfile()) {
#if QT_VERSION >= 0x050000
// request the highest OpenGL version
// QT 5 should gracefully provide the next highest available version
format.setVersion(4, 0);
format.setProfile(OFGLFormat::CoreProfile);
#else
format.setProfile(OFGLFormat::CompatibilityProfile);
format.setOption(QSurfaceFormat::DeprecatedFunctions);
#endif
}
else {
format.setProfile(QSurfaceFormat::CompatibilityProfile);
format.setOption(QSurfaceFormat::DeprecatedFunctions);
}
#if (QT_VERSION >= QT_VERSION_CHECK(5, 4, 4))
if (OpenFlipper::Options::debug())
format.setOption(format.options() | QSurfaceFormat::DebugContext);
glWidget_ = new OFGLWidget();
glWidget_->setFormat(format);
glWidget_->makeCurrent();
#else
glWidget_ = new OFGLWidget(format, 0);
......
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