Commit 68dc3b14 authored by Martin Schultz's avatar Martin Schultz

added option to set the MSAA sample count

parent 965f7c08
...@@ -387,6 +387,20 @@ bool coreProfile( ) { ...@@ -387,6 +387,20 @@ bool coreProfile( ) {
return 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 /// Store opengl stereo mode setting
void glStereo( bool _glStereo ) { void glStereo( bool _glStereo ) {
glStereo_ = _glStereo; glStereo_ = _glStereo;
......
...@@ -422,6 +422,14 @@ QString helpDirStr(); ...@@ -422,6 +422,14 @@ QString helpDirStr();
/// get opengl core profile setting /// get opengl core profile setting
DLLEXPORT DLLEXPORT
bool coreProfile( ); bool coreProfile( );
/// Store opengl MSAA sample count
DLLEXPORT
void samples(int _samples);
/// Get opengl MSAA sample count
DLLEXPORT
int samples();
/// Store stereo support setting /// Store stereo support setting
DLLEXPORT DLLEXPORT
......
...@@ -217,7 +217,7 @@ CoreWidget( QVector<ViewMode*>& _viewModes, ...@@ -217,7 +217,7 @@ CoreWidget( QVector<ViewMode*>& _viewModes,
#if (QT_VERSION >= QT_VERSION_CHECK(5,0,0)) #if (QT_VERSION >= QT_VERSION_CHECK(5,0,0))
format.setAlphaBufferSize(8); format.setAlphaBufferSize(8);
format.setStencilBufferSize(8); format.setStencilBufferSize(8);
format.setSamples(0); // todo: get sample count from settings format.setSamples(OpenFlipper::Options::samples());
#else #else
format.setAlpha(true); format.setAlpha(true);
format.setStencil(true); format.setStencil(true);
......
...@@ -268,6 +268,9 @@ void OptionsWidget::showEvent ( QShowEvent * /*event*/ ) { ...@@ -268,6 +268,9 @@ void OptionsWidget::showEvent ( QShowEvent * /*event*/ ) {
loggerInScene->setChecked( OpenFlipper::Options::loggerState() == OpenFlipper::Options::InScene); loggerInScene->setChecked( OpenFlipper::Options::loggerState() == OpenFlipper::Options::InScene);
enableLogFile->setChecked( OpenFlipperSettings().value("Core/Log/logFileEnabled",true).toBool() ); enableLogFile->setChecked( OpenFlipperSettings().value("Core/Log/logFileEnabled",true).toBool() );
//OpenGL
samples_spinBox->setValue(OpenFlipper::Options::samples());
//Files //Files
logFile->setText( OpenFlipperSettings().value("Core/Log/logFile").toString() ); logFile->setText( OpenFlipperSettings().value("Core/Log/logFile").toString() );
maxRecentBox->setValue( OpenFlipperSettings().value("Core/File/MaxRecent",15).toInt() ); maxRecentBox->setValue( OpenFlipperSettings().value("Core/File/MaxRecent",15).toInt() );
...@@ -580,6 +583,10 @@ void OptionsWidget::slotApply() { ...@@ -580,6 +583,10 @@ void OptionsWidget::slotApply() {
OpenFlipperSettings().setValue("Core/Log/logFileEnabled",enableLogFile->isChecked()); OpenFlipperSettings().setValue("Core/Log/logFileEnabled",enableLogFile->isChecked());
OpenFlipperSettings().setValue("Core/Log/logFile",logFile->text()); 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/MaxRecent",maxRecentBox->value() ) ;
OpenFlipperSettings().setValue("Core/File/ReloadShaders",rbReloadShaders->isChecked() ) ; OpenFlipperSettings().setValue("Core/File/ReloadShaders",rbReloadShaders->isChecked() ) ;
ACG::ShaderCache::getInstance()->setTimeCheck(rbReloadShaders->isChecked()); ACG::ShaderCache::getInstance()->setTimeCheck(rbReloadShaders->isChecked());
......
...@@ -36,8 +36,8 @@ ...@@ -36,8 +36,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>721</width> <width>671</width>
<height>957</height> <height>894</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
...@@ -306,6 +306,37 @@ ...@@ -306,6 +306,37 @@
</item> </item>
</layout> </layout>
</widget> </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"> <widget class="QWidget" name="paths">
<attribute name="title"> <attribute name="title">
<string>Files</string> <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