Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenFlipper-Free
OpenFlipper
Commits
68dc3b14
Commit
68dc3b14
authored
Mar 21, 2018
by
Martin Schultz
Browse files
added option to set the MSAA sample count
parent
965f7c08
Changes
5
Hide whitespace changes
Inline
Side-by-side
common/GlobalOptions.cc
View file @
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
;
...
...
common/GlobalOptions.hh
View file @
68dc3b14
...
...
@@ -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
...
...
widgets/coreWidget/CoreWidget.cc
View file @
68dc3b14
...
...
@@ -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
);
...
...
widgets/optionsWidget/optionsWidget.cc
View file @
68dc3b14
...
...
@@ -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
());
...
...
widgets/optionsWidget/optionsWidget.ui
View file @
68dc3b14
...
...
@@ -36,8 +36,8 @@
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
7
2
1
</width>
<height>
957
</height>
<width>
6
71
</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>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment