Task-number: QTBUG-113331 Change-Id: I8baa697b4997b05f52acdee0e08d3c368fde5bc2 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
31 lines
748 B
C++
31 lines
748 B
C++
// Copyright (C) 2023 The Qt Company Ltd.
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
|
|
|
#ifndef EXAMPLEWIDGET_H
|
|
#define EXAMPLEWIDGET_H
|
|
|
|
//![0]
|
|
#include <QRhiWidget>
|
|
#include <rhi/qrhi.h>
|
|
|
|
class ExampleRhiWidget : public QRhiWidget
|
|
{
|
|
public:
|
|
ExampleRhiWidget(QWidget *parent = nullptr) : QRhiWidget(parent) { }
|
|
|
|
void initialize(QRhiCommandBuffer *cb) override;
|
|
void render(QRhiCommandBuffer *cb) override;
|
|
|
|
private:
|
|
QRhi *m_rhi = nullptr;
|
|
std::unique_ptr<QRhiBuffer> m_vbuf;
|
|
std::unique_ptr<QRhiBuffer> m_ubuf;
|
|
std::unique_ptr<QRhiShaderResourceBindings> m_srb;
|
|
std::unique_ptr<QRhiGraphicsPipeline> m_pipeline;
|
|
QMatrix4x4 m_viewProjection;
|
|
float m_rotation = 0.0f;
|
|
};
|
|
//![0]
|
|
|
|
#endif
|