Commit e110bb60743e6a2d18500ed053bac920f121ab8a

Authored by David Graeff
Committed by David Gräff
1 parent a36eccc6

OpenGL3/ES does not have anti-aliasing hints as before. We need to set a multisa…

…mpling value at the beginning. Remove antialiasing from config dialog therefore.
openhantek/src/configdialog/DsoConfigScopePage.cpp
... ... @@ -5,11 +5,9 @@
5 5 DsoConfigScopePage::DsoConfigScopePage(DsoSettings *settings, QWidget *parent) : QWidget(parent), settings(settings) {
6 6 // Initialize lists for comboboxes
7 7 QStringList interpolationStrings;
8   - interpolationStrings << tr("Off") << tr("Linear") << tr("Sinc");
  8 + interpolationStrings << tr("Off") << tr("Linear");
9 9  
10 10 // Initialize elements
11   - antialiasingCheckBox = new QCheckBox(tr("Antialiasing"));
12   - antialiasingCheckBox->setChecked(settings->view.antialiasing);
13 11 interpolationLabel = new QLabel(tr("Interpolation"));
14 12 interpolationComboBox = new QComboBox();
15 13 interpolationComboBox->addItems(interpolationStrings);
... ... @@ -21,7 +19,6 @@ DsoConfigScopePage::DsoConfigScopePage(DsoSettings *settings, QWidget *parent) :
21 19 digitalPhosphorDepthSpinBox->setValue(settings->view.digitalPhosphorDepth);
22 20  
23 21 graphLayout = new QGridLayout();
24   - graphLayout->addWidget(antialiasingCheckBox, 0, 0, 1, 2);
25 22 graphLayout->addWidget(interpolationLabel, 1, 0);
26 23 graphLayout->addWidget(interpolationComboBox, 1, 1);
27 24 graphLayout->addWidget(digitalPhosphorDepthLabel, 2, 0);
... ... @@ -39,7 +36,6 @@ DsoConfigScopePage::DsoConfigScopePage(DsoSettings *settings, QWidget *parent) :
39 36  
40 37 /// \brief Saves the new settings.
41 38 void DsoConfigScopePage::saveSettings() {
42   - settings->view.antialiasing = antialiasingCheckBox->isChecked();
43 39 settings->view.interpolation = (Dso::InterpolationMode)interpolationComboBox->currentIndex();
44 40 settings->view.digitalPhosphorDepth = digitalPhosphorDepthSpinBox->value();
45 41 }
... ...
openhantek/src/configdialog/DsoConfigScopePage.h
... ... @@ -33,7 +33,6 @@ class DsoConfigScopePage : public QWidget {
33 33  
34 34 QGroupBox *graphGroup;
35 35 QGridLayout *graphLayout;
36   - QCheckBox *antialiasingCheckBox;
37 36 QLabel *digitalPhosphorDepthLabel;
38 37 QSpinBox *digitalPhosphorDepthSpinBox;
39 38 QLabel *interpolationLabel;
... ...
openhantek/src/glscope.cpp
... ... @@ -20,8 +20,11 @@
20 20 #include "viewconstants.h"
21 21 #include "viewsettings.h"
22 22  
23   -// typedef QOpenGLFunctions_ES2 OPENGL_VER;
  23 +#if defined(QT_OPENGL_ES_2)
  24 +typedef QOpenGLFunctions_ES2 OPENGL_VER;
  25 +#else
24 26 typedef QOpenGLFunctions_3_3_Core OPENGL_VER;
  27 +#endif
25 28  
26 29 GlScope *GlScope::createNormal(DsoSettingsScope *scope, DsoSettingsView *view, QWidget *parent) {
27 30 GlScope *s = new GlScope(scope, view, parent);
... ... @@ -153,8 +156,6 @@ void GlScope::initializeGL() {
153 156 gl->glEnable(GL_CULL_FACE);
154 157 gl->glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
155 158  
156   - gl->glPointSize(1);
157   -
158 159 QColor bg = view->screen.background;
159 160 gl->glClearColor((GLfloat)bg.redF(), (GLfloat)bg.greenF(), (GLfloat)bg.blueF(), (GLfloat)bg.alphaF());
160 161  
... ... @@ -203,12 +204,6 @@ void GlScope::paintGL() {
203 204  
204 205 m_program->bind();
205 206  
206   - if (view->antialiasing) {
207   - gl->glEnable(GL_POINT_SMOOTH);
208   - gl->glEnable(GL_LINE_SMOOTH);
209   - gl->glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
210   - }
211   -
212 207 // Apply zoom settings via matrix transformation
213 208 if (zoomed) {
214 209 QMatrix4x4 m;
... ... @@ -227,9 +222,6 @@ void GlScope::paintGL() {
227 222 ++historyIndex;
228 223 }
229 224  
230   - gl->glDisable(GL_POINT_SMOOTH);
231   - gl->glDisable(GL_LINE_SMOOTH);
232   -
233 225 if (zoomed) { m_program->setUniformValue(matrixLocation, pmvMatrix); }
234 226  
235 227 if (!this->zoomed) drawMarkers();
... ... @@ -258,8 +250,6 @@ void GlScope::resizeGL(int width, int height) {
258 250  
259 251 void GlScope::drawGrid() {
260 252 auto *gl = context()->versionFunctions<OPENGL_VER>();
261   - gl->glDisable(GL_POINT_SMOOTH);
262   - gl->glDisable(GL_LINE_SMOOTH);
263 253 gl->glLineWidth(1);
264 254  
265 255 // Grid
... ...
openhantek/src/main.cpp
... ... @@ -75,6 +75,7 @@ int main(int argc, char *argv[]) {
75 75 // Prefer full desktop OpenGL without fixed pipeline
76 76 QSurfaceFormat format;
77 77 format.setProfile(QSurfaceFormat::CoreProfile);
  78 + format.setSamples(4); // Antia-Aliasing, Multisampling
78 79 QSurfaceFormat::setDefaultFormat(format);
79 80 QApplication openHantekApplication(argc, argv);
80 81  
... ...