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

Merge branch 'featureMSAAOption' into 'master'

added option to set the MSAA sample count

See merge request !67
parents d93baa6e 68dc3b14
......@@ -387,6 +387,20 @@ bool coreProfile( ) {
return coreProfile_;
}
/// Store opengl MSAA sample count
void samples(int _samples) {
OpenFlipperSettings().setValue("Core/OpenGL/Samples",_samples);
}
/// Get opengl MSAA sample count
int samples() {
#if defined(ARCH_DARWIN) //Disable MSAA on OSX by default until workaround is found.
return OpenFlipperSettings().value("Core/OpenGL/Samples",0).toInt();
#else
return OpenFlipperSettings().value("Core/OpenGL/Samples",4).toInt();
#endif
}
/// Store opengl stereo mode setting
void glStereo( bool _glStereo ) {
glStereo_ = _glStereo;
......
......@@ -422,6 +422,14 @@ QString helpDirStr();
/// get opengl core profile setting
DLLEXPORT
bool coreProfile( );
/// Store opengl MSAA sample count
DLLEXPORT
void samples(int _samples);
/// Get opengl MSAA sample count
DLLEXPORT
int samples();
/// Store stereo support setting
DLLEXPORT
......
......@@ -217,7 +217,7 @@ CoreWidget( QVector<ViewMode*>& _viewModes,
#if (QT_VERSION >= QT_VERSION_CHECK(5,0,0))
format.setAlphaBufferSize(8);
format.setStencilBufferSize(8);
format.setSamples(0); // todo: get sample count from settings
format.setSamples(OpenFlipper::Options::samples());
#else
format.setAlpha(true);
format.setStencil(true);
......
......@@ -268,6 +268,9 @@ void OptionsWidget::showEvent ( QShowEvent * /*event*/ ) {
loggerInScene->setChecked( OpenFlipper::Options::loggerState() == OpenFlipper::Options::InScene);
enableLogFile->setChecked( OpenFlipperSettings().value("Core/Log/logFileEnabled",true).toBool() );
//OpenGL
samples_spinBox->setValue(OpenFlipper::Options::samples());
//Files
logFile->setText( OpenFlipperSettings().value("Core/Log/logFile").toString() );
maxRecentBox->setValue( OpenFlipperSettings().value("Core/File/MaxRecent",15).toInt() );
......@@ -580,6 +583,10 @@ void OptionsWidget::slotApply() {
OpenFlipperSettings().setValue("Core/Log/logFileEnabled",enableLogFile->isChecked());
OpenFlipperSettings().setValue("Core/Log/logFile",logFile->text());
//OpenGL settings
OpenFlipperSettings().setValue("Core/OpenGL/Samples",samples_spinBox->value());
//Paths settings
OpenFlipperSettings().setValue("Core/File/MaxRecent",maxRecentBox->value() ) ;
OpenFlipperSettings().setValue("Core/File/ReloadShaders",rbReloadShaders->isChecked() ) ;
ACG::ShaderCache::getInstance()->setTimeCheck(rbReloadShaders->isChecked());
......
......@@ -36,8 +36,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>721</width>
<height>957</height>
<width>671</width>
<height>894</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
......@@ -306,6 +306,37 @@
</item>
</layout>
</widget>
<widget class="QWidget" name="opengl">
<attribute name="title">
<string>OpenGL</string>
</attribute>
<widget class="QWidget" name="verticalLayoutWidget">
<property name="geometry">
<rect>
<x>10</x>
<y>9</y>
<width>201</width>
<height>51</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_28">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_27">
<item>
<widget class="QLabel" name="label_22">
<property name="text">
<string>MSAA Samples:</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="samples_spinBox"/>
</item>
</layout>
</item>
</layout>
</widget>
</widget>
<widget class="QWidget" name="paths">
<attribute name="title">
<string>Files</string>
......
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