diff options
author | Be <be@mixxx.org> | 2020-11-25 11:51:17 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-25 11:51:17 -0800 |
commit | 90832946baf5a36e3362c6774971db2b46ee5b68 (patch) | |
tree | f602d599402bb46d7f0264c38cd3239b9fd5e86b | |
parent | b1dda3152ee7e1abbc10eda941f5e7627e027e3c (diff) | |
parent | d9557c3157f1f460b455badb43e72424c19eb644 (diff) |
Merge pull request #3370 from Be-ing/angle
fix ANGLE OpenGL issues on Windows
-rw-r--r-- | CMakeLists.txt | 44 | ||||
-rw-r--r-- | src/waveform/waveformwidgetfactory.cpp | 3 | ||||
-rw-r--r-- | src/widget/wspinny.cpp | 3 |
3 files changed, 33 insertions, 17 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 4f7e16aabb..454bc40a62 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1130,21 +1130,6 @@ install( FILES_MATCHING PATTERN "*.qm" ) -if(WIN32) -install( - # I haven't seen a way to determine where the translations dir is, so I am making - # some assumptions here, and assuming that Qt5_DIR points to Qt-5.14.2/lib/cmake/Qt5 - # which is what my configuration tells me. - DIRECTORY - "${Qt5_DIR}/../../../translations" - DESTINATION - "${MIXXX_INSTALL_DATADIR}" - # QT 5 translations have been separated into several files, and most of the qt_xx.qm files - # contain just shortcuts to load the qtbase, qtmultimedia etc files. - FILES_MATCHING REGEX - "qt_.+\.qm|qtbase_.*\.qm|qtmultimedia_.*\.qm|qtscript_.*\.qm|qtxmlpatterns_.*\.qm" -) -endif() # Font files install( @@ -1736,8 +1721,6 @@ elseif(WIN32) # New libraries required by Qt5. dwmapi # qtwindows iphlpapi # qt5network - #libEGL # qt5opengl - #libGLESv2 # qt5opengl mpr # qt5core netapi32 # qt5core userenv # qt5core @@ -1798,6 +1781,32 @@ elseif(WIN32) endif() endif() +# Qt5_DIR is not set until now, so this cannot be moved above with the rest of the install commands +if(WIN32) + install( + # I haven't seen a way to determine where the translations dir is, so I am making + # some assumptions here, and assuming that Qt5_DIR points to Qt-5.14.2/lib/cmake/Qt5 + # which is what my configuration tells me. + DIRECTORY + "${Qt5_DIR}/../../../translations" + DESTINATION + "${MIXXX_INSTALL_DATADIR}" + # QT 5 translations have been separated into several files, and most of the qt_xx.qm files + # contain just shortcuts to load the qtbase, qtmultimedia etc files. + FILES_MATCHING REGEX + "qt_.+\.qm|qtbase_.*\.qm|qtmultimedia_.*\.qm|qtscript_.*\.qm|qtxmlpatterns_.*\.qm" + ) + + # ANGLE DLLs are dynamically linked even when the rest of Qt is built statically + install( + FILES + "${Qt5_DIR}/../../../bin/libEGL.dll" + "${Qt5_DIR}/../../../bin/libGLESv2.dll" + DESTINATION + "${MIXXX_INSTALL_DATADIR}" + ) +endif() + # QtScriptByteArray add_library(QtScriptByteArray STATIC EXCLUDE_FROM_ALL lib/qtscript-bytearray/bytearrayclass.cpp @@ -1849,6 +1858,7 @@ add_library(QueenMaryDsp STATIC EXCLUDE_FROM_ALL # lib/qm-dsp/maths/pca/pca.c # lib/qm-dsp/thread/Thread.cpp ) + target_compile_definitions(QueenMaryDsp PRIVATE kiss_fft_scalar=double) if(UNIX) target_compile_definitions(QueenMaryDsp PRIVATE USE_PTHREADS) diff --git a/src/waveform/waveformwidgetfactory.cpp b/src/waveform/waveformwidgetfactory.cpp index 6ab1089379..4078a571ee 100644 --- a/src/waveform/waveformwidgetfactory.cpp +++ b/src/waveform/waveformwidgetfactory.cpp @@ -713,6 +713,9 @@ void WaveformWidgetFactory::swap() { } QGLWidget* glw = qobject_cast<QGLWidget*>(pWaveformWidget->getWidget()); if (glw != nullptr) { + if (glw->context() != QGLContext::currentContext()) { + glw->makeCurrent(); + } glw->swapBuffers(); } //qDebug() << "swap x" << m_vsyncThread->elapsed(); diff --git a/src/widget/wspinny.cpp b/src/widget/wspinny.cpp index 406750c962..12c19cd5cd 100644 --- a/src/widget/wspinny.cpp +++ b/src/widget/wspinny.cpp @@ -403,6 +403,9 @@ void WSpinny::swap() { if (window == nullptr || !window->isExposed()) { return; } + if (context() != QGLContext::currentContext()) { + makeCurrent(); + } swapBuffers(); } |