This commit is contained in:
朱子楚\zhuzi
2024-04-11 15:27:15 +08:00
parent 3f6ef13cd0
commit 531f659e59
4 changed files with 21 additions and 22 deletions

View File

@ -10,13 +10,10 @@ FluContentPage{
title: qsTr("OpenGL")
FluFrame{
anchors.fill: parent
OpenGLItem{
width: 320
height: 480
anchors.fill: parent
SequentialAnimation on t {
NumberAnimation { to: 1; duration: 2500; easing.type: Easing.InQuad }
NumberAnimation { to: 0; duration: 2500; easing.type: Easing.OutQuad }
@ -24,9 +21,6 @@ FluContentPage{
running: true
}
}
}
}

View File

@ -47,7 +47,7 @@ QOpenGLFramebufferObject *FBORenderer::createFramebufferObject(const QSize &size
}
void FBORenderer::render() {
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
glEnable(GL_DEPTH_TEST);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
program.bind();

View File

@ -12,11 +12,11 @@ Q_OBJECT
public:
explicit OpenGLItem(QQuickItem *parent = nullptr);
QQuickFramebufferObject::Renderer *createRenderer() const override;
[[nodiscard]] QQuickFramebufferObject::Renderer *createRenderer() const override;
void timerEvent(QTimerEvent *) override;
qreal t() const { return m_t; }
[[nodiscard]] qreal t() const { return m_t; }
void setT(qreal t);