Adapt to OpenGL related Qt6 QQuickWindow API changes
This commit is contained in:
parent
4009345e10
commit
95505eb044
1 changed files with 10 additions and 0 deletions
|
@ -27,6 +27,8 @@
|
|||
#include <QOpenGLFramebufferObject>
|
||||
#include <QTimer>
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
#include <QQuickOpenGLUtils>
|
||||
#include <QQuickRenderTarget>
|
||||
#include <private/qeventpoint_p.h> // for QMutableEventPoint
|
||||
#endif
|
||||
|
||||
|
@ -267,7 +269,11 @@ void OffscreenQuickView::update()
|
|||
return;
|
||||
}
|
||||
}
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
d->m_view->setRenderTarget(d->m_fbo.data());
|
||||
#else
|
||||
d->m_view->setRenderTarget(QQuickRenderTarget::fromOpenGLTexture(d->m_fbo->texture(), d->m_fbo->size()));
|
||||
#endif
|
||||
}
|
||||
|
||||
d->m_renderControl->polishItems();
|
||||
|
@ -275,7 +281,11 @@ void OffscreenQuickView::update()
|
|||
|
||||
d->m_renderControl->render();
|
||||
if (usingGl) {
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
d->m_view->resetOpenGLState();
|
||||
#else
|
||||
QQuickOpenGLUtils::resetOpenGLState();
|
||||
#endif
|
||||
}
|
||||
|
||||
if (d->m_useBlit) {
|
||||
|
|
Loading…
Reference in a new issue