Debian Codegraph @

tests/manual/rhi/triquadcube/texturedcuberenderer.h

raw
1 // Copyright (C) 2018 The Qt Company Ltd.
2 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4 #ifndef TEXTUREDCUBERENDERER_H
5 #define TEXTUREDCUBERENDERER_H
6
7 #include <rhi/qrhi.h>
8
9 class TexturedCubeRenderer
10 {
11 public:
12 void setRhi(QRhi *r) { m_r = r; }
13 void setSampleCount(int samples) { m_sampleCount = samples; }
14 void setTranslation(const QVector3D &v) { m_translation = v; }
15 void initResources(QRhiRenderPassDescriptor *rp);
16 void releaseResources();
17 void resize(const QSize &pixelSize);
18 void queueResourceUpdates(QRhiResourceUpdateBatch *resourceUpdates);
19 void queueDraw(QRhiCommandBuffer *cb, const QSize &outputSizeInPixels);
20
21 private:
22 QRhi *m_r;
23
24 QRhiBuffer *m_vbuf = nullptr;
25 bool m_vbufReady = false;
26 QRhiBuffer *m_ubuf = nullptr;
27 QImage m_image;
28 QRhiTexture *m_tex = nullptr;
29 QRhiSampler *m_sampler = nullptr;
30 QRhiShaderResourceBindings *m_srb = nullptr;
31 QRhiGraphicsPipeline *m_ps = nullptr;
32
33 QVector3D m_translation;
34 QMatrix4x4 m_proj;
35 float m_rotation = 0;
36 int m_sampleCount = 1; // no MSAA by default
37 };
38
39 #endif