Qt: Fix display-related Qt6 build errors

This commit is contained in:
Vicki Pfau 2023-08-18 20:12:18 -07:00
parent f637b5b1e8
commit f5a6906ef8
2 changed files with 5 additions and 11 deletions

View File

@ -18,9 +18,9 @@
using namespace QGBA;
#if defined(BUILD_GL) || defined(BUILD_GLES2) || defined(BUILD_GLES3) || defined(USE_EPOXY)
QGBA::Display::Driver Display::s_driver = QGBA::Display::Driver::OPENGL;
QGBA::Display::Driver QGBA::Display::s_driver = QGBA::Display::Driver::OPENGL;
#else
QGBA::Display::Driver Display::s_driver = QGBA::Display::Driver::QT;
QGBA::Display::Driver QGBA::Display::s_driver = QGBA::Display::Driver::QT;
#endif
QGBA::Display* QGBA::Display::create(QWidget* parent) {

View File

@ -9,14 +9,8 @@
#include <QApplication>
#include <QMutexLocker>
#include <QOpenGLExtraFunctions>
#include <QOpenGLFunctions>
#ifdef QT_OPENGL_ES_2
#include <QOpenGLFunctions_ES2>
using QOpenGLFunctions_Baseline = QOpenGLFunctions_ES2;
#else
#include <QOpenGLFunctions_3_2_Core>
using QOpenGLFunctions_Baseline = QOpenGLFunctions_3_2_Core;
#endif
#include <QOpenGLPaintDevice>
#include <QResizeEvent>
#include <QScreen>
@ -122,7 +116,7 @@ bool mGLWidget::finalizeVAO() {
if (!context() || !m_vao) {
return false;
}
QOpenGLFunctions_Baseline* fn = context()->versionFunctions<QOpenGLFunctions_Baseline>();
QOpenGLExtraFunctions* fn = context()->extraFunctions();
if (!fn) {
return false;
}
@ -150,7 +144,7 @@ void mGLWidget::paintGL() {
m_refresh.start(10);
return;
}
QOpenGLFunctions_Baseline* fn = context()->versionFunctions<QOpenGLFunctions_Baseline>();
QOpenGLExtraFunctions* fn = context()->extraFunctions();
m_program->bind();
m_vao->bind();
fn->glBindTexture(GL_TEXTURE_2D, m_tex);