From e110bb60743e6a2d18500ed053bac920f121ab8a Mon Sep 17 00:00:00 2001 From: David Graeff Date: Fri, 12 Jan 2018 18:47:21 +0100 Subject: [PATCH] OpenGL3/ES does not have anti-aliasing hints as before. We need to set a multisampling value at the beginning. Remove antialiasing from config dialog therefore. --- openhantek/src/configdialog/DsoConfigScopePage.cpp | 6 +----- openhantek/src/configdialog/DsoConfigScopePage.h | 1 - openhantek/src/glscope.cpp | 18 ++++-------------- openhantek/src/main.cpp | 1 + 4 files changed, 6 insertions(+), 20 deletions(-) diff --git a/openhantek/src/configdialog/DsoConfigScopePage.cpp b/openhantek/src/configdialog/DsoConfigScopePage.cpp index 75fae68..2c7fdcf 100644 --- a/openhantek/src/configdialog/DsoConfigScopePage.cpp +++ b/openhantek/src/configdialog/DsoConfigScopePage.cpp @@ -5,11 +5,9 @@ DsoConfigScopePage::DsoConfigScopePage(DsoSettings *settings, QWidget *parent) : QWidget(parent), settings(settings) { // Initialize lists for comboboxes QStringList interpolationStrings; - interpolationStrings << tr("Off") << tr("Linear") << tr("Sinc"); + interpolationStrings << tr("Off") << tr("Linear"); // Initialize elements - antialiasingCheckBox = new QCheckBox(tr("Antialiasing")); - antialiasingCheckBox->setChecked(settings->view.antialiasing); interpolationLabel = new QLabel(tr("Interpolation")); interpolationComboBox = new QComboBox(); interpolationComboBox->addItems(interpolationStrings); @@ -21,7 +19,6 @@ DsoConfigScopePage::DsoConfigScopePage(DsoSettings *settings, QWidget *parent) : digitalPhosphorDepthSpinBox->setValue(settings->view.digitalPhosphorDepth); graphLayout = new QGridLayout(); - graphLayout->addWidget(antialiasingCheckBox, 0, 0, 1, 2); graphLayout->addWidget(interpolationLabel, 1, 0); graphLayout->addWidget(interpolationComboBox, 1, 1); graphLayout->addWidget(digitalPhosphorDepthLabel, 2, 0); @@ -39,7 +36,6 @@ DsoConfigScopePage::DsoConfigScopePage(DsoSettings *settings, QWidget *parent) : /// \brief Saves the new settings. void DsoConfigScopePage::saveSettings() { - settings->view.antialiasing = antialiasingCheckBox->isChecked(); settings->view.interpolation = (Dso::InterpolationMode)interpolationComboBox->currentIndex(); settings->view.digitalPhosphorDepth = digitalPhosphorDepthSpinBox->value(); } diff --git a/openhantek/src/configdialog/DsoConfigScopePage.h b/openhantek/src/configdialog/DsoConfigScopePage.h index bdeae8c..77f33bd 100644 --- a/openhantek/src/configdialog/DsoConfigScopePage.h +++ b/openhantek/src/configdialog/DsoConfigScopePage.h @@ -33,7 +33,6 @@ class DsoConfigScopePage : public QWidget { QGroupBox *graphGroup; QGridLayout *graphLayout; - QCheckBox *antialiasingCheckBox; QLabel *digitalPhosphorDepthLabel; QSpinBox *digitalPhosphorDepthSpinBox; QLabel *interpolationLabel; diff --git a/openhantek/src/glscope.cpp b/openhantek/src/glscope.cpp index b720831..0f51e5f 100644 --- a/openhantek/src/glscope.cpp +++ b/openhantek/src/glscope.cpp @@ -20,8 +20,11 @@ #include "viewconstants.h" #include "viewsettings.h" -// typedef QOpenGLFunctions_ES2 OPENGL_VER; +#if defined(QT_OPENGL_ES_2) +typedef QOpenGLFunctions_ES2 OPENGL_VER; +#else typedef QOpenGLFunctions_3_3_Core OPENGL_VER; +#endif GlScope *GlScope::createNormal(DsoSettingsScope *scope, DsoSettingsView *view, QWidget *parent) { GlScope *s = new GlScope(scope, view, parent); @@ -153,8 +156,6 @@ void GlScope::initializeGL() { gl->glEnable(GL_CULL_FACE); gl->glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - gl->glPointSize(1); - QColor bg = view->screen.background; gl->glClearColor((GLfloat)bg.redF(), (GLfloat)bg.greenF(), (GLfloat)bg.blueF(), (GLfloat)bg.alphaF()); @@ -203,12 +204,6 @@ void GlScope::paintGL() { m_program->bind(); - if (view->antialiasing) { - gl->glEnable(GL_POINT_SMOOTH); - gl->glEnable(GL_LINE_SMOOTH); - gl->glHint(GL_LINE_SMOOTH_HINT, GL_NICEST); - } - // Apply zoom settings via matrix transformation if (zoomed) { QMatrix4x4 m; @@ -227,9 +222,6 @@ void GlScope::paintGL() { ++historyIndex; } - gl->glDisable(GL_POINT_SMOOTH); - gl->glDisable(GL_LINE_SMOOTH); - if (zoomed) { m_program->setUniformValue(matrixLocation, pmvMatrix); } if (!this->zoomed) drawMarkers(); @@ -258,8 +250,6 @@ void GlScope::resizeGL(int width, int height) { void GlScope::drawGrid() { auto *gl = context()->versionFunctions(); - gl->glDisable(GL_POINT_SMOOTH); - gl->glDisable(GL_LINE_SMOOTH); gl->glLineWidth(1); // Grid diff --git a/openhantek/src/main.cpp b/openhantek/src/main.cpp index 5675ef3..572edf1 100644 --- a/openhantek/src/main.cpp +++ b/openhantek/src/main.cpp @@ -75,6 +75,7 @@ int main(int argc, char *argv[]) { // Prefer full desktop OpenGL without fixed pipeline QSurfaceFormat format; format.setProfile(QSurfaceFormat::CoreProfile); + format.setSamples(4); // Antia-Aliasing, Multisampling QSurfaceFormat::setDefaultFormat(format); QApplication openHantekApplication(argc, argv); -- libgit2 0.21.4