summaryrefslogtreecommitdiffstats
path: root/tests/manual/rhi/rhiwidget/examplewidget.h
diff options
context:
space:
mode:
Diffstat (limited to 'tests/manual/rhi/rhiwidget/examplewidget.h')
-rw-r--r--tests/manual/rhi/rhiwidget/examplewidget.h66
1 files changed, 0 insertions, 66 deletions
diff --git a/tests/manual/rhi/rhiwidget/examplewidget.h b/tests/manual/rhi/rhiwidget/examplewidget.h
deleted file mode 100644
index 1b58eedc20..0000000000
--- a/tests/manual/rhi/rhiwidget/examplewidget.h
+++ /dev/null
@@ -1,66 +0,0 @@
-// Copyright (C) 2021 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-
-#ifndef EXAMPLEWIDGET_H
-#define EXAMPLEWIDGET_H
-
-#include "rhiwidget.h"
-#include <QtGui/private/qrhi_p.h>
-
-class ExampleRhiWidget : public QRhiWidget
-{
-public:
- ExampleRhiWidget(QWidget *parent = nullptr, Qt::WindowFlags f = {});
-
- void initialize(QRhi *rhi, QRhiTexture *outputTexture) override;
- void render(QRhiCommandBuffer *cb) override;
-
- void setCubeTextureText(const QString &s)
- {
- if (itemData.cubeText == s)
- return;
- itemData.cubeText = s;
- itemData.cubeTextDirty = true;
- update();
- }
-
- void setCubeRotation(float r)
- {
- if (itemData.cubeRotation == r)
- return;
- itemData.cubeRotation = r;
- itemData.cubeRotationDirty = true;
- update();
- }
-
-private:
- QRhi *m_rhi = nullptr;
- QRhiTexture *m_output = nullptr;
- QScopedPointer<QRhiRenderBuffer> m_ds;
- QScopedPointer<QRhiTextureRenderTarget> m_rt;
- QScopedPointer<QRhiRenderPassDescriptor> m_rp;
-
- struct {
- QRhiResourceUpdateBatch *resourceUpdates = nullptr;
- QScopedPointer<QRhiBuffer> vbuf;
- QScopedPointer<QRhiBuffer> ubuf;
- QScopedPointer<QRhiShaderResourceBindings> srb;
- QScopedPointer<QRhiGraphicsPipeline> ps;
- QScopedPointer<QRhiSampler> sampler;
- QScopedPointer<QRhiTexture> cubeTex;
- QMatrix4x4 mvp;
- } scene;
-
- void initScene();
- void updateMvp();
- void updateCubeTexture();
-
- struct {
- QString cubeText;
- bool cubeTextDirty = false;
- float cubeRotation = 0.0f;
- bool cubeRotationDirty = false;
- } itemData;
-};
-
-#endif