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