summaryrefslogtreecommitdiffstats
path: root/examples/quick/scenegraph/rendernode/d3d12renderer.h
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@theqtcompany.com>2016-05-26 14:34:00 +0200
committerLaszlo Agocs <laszlo.agocs@theqtcompany.com>2016-05-31 12:42:16 +0000
commite1682b84bb09ce3b45237b964c820eb4b92857a2 (patch)
tree5cc2e28037a0443d71e6d0f8e7609f670d9f6ae0 /examples/quick/scenegraph/rendernode/d3d12renderer.h
parent519032e9e0faa52162ec67d1f35b8f66cd4576d3 (diff)
Refactor the rendernode example
By removing the Renderer abstraction it becomes easier to follow and understand. Change-Id: Iddacb461d51a75864983850660c5480985b3524f Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'examples/quick/scenegraph/rendernode/d3d12renderer.h')
-rw-r--r--examples/quick/scenegraph/rendernode/d3d12renderer.h23
1 files changed, 13 insertions, 10 deletions
diff --git a/examples/quick/scenegraph/rendernode/d3d12renderer.h b/examples/quick/scenegraph/rendernode/d3d12renderer.h
index 365b483422..a81db0f398 100644
--- a/examples/quick/scenegraph/rendernode/d3d12renderer.h
+++ b/examples/quick/scenegraph/rendernode/d3d12renderer.h
@@ -41,35 +41,38 @@
#ifndef D3D12RENDERER_H
#define D3D12RENDERER_H
-#include "customrenderitem.h"
#include <qsgrendernode.h>
#ifdef HAS_D3D12
+class QQuickItem;
+
#include <d3d12.h>
#include <wrl/client.h>
using namespace Microsoft::WRL;
-class D3D12Renderer : public CustomRenderer
+class D3D12RenderNode : public QSGRenderNode
{
public:
- D3D12Renderer(QQuickItem *item, QSGRenderNode *node);
- ~D3D12Renderer();
- void init() override;
- void render(const QSGRenderNode::RenderState *state) override;
+ D3D12RenderNode(QQuickItem *item);
+ ~D3D12RenderNode();
+
+ void render(const RenderState *state) override;
+ void releaseResources() override;
private:
+ void init();
+
QQuickItem *m_item;
- QSGRenderNode *m_node;
- ID3D12Device *m_device;
+ ID3D12Device *m_device = nullptr;
ComPtr<ID3D12PipelineState> pipelineState;
ComPtr<ID3D12RootSignature> rootSignature;
ComPtr<ID3D12Resource> vertexBuffer;
ComPtr<ID3D12Resource> constantBuffer;
D3D12_VERTEX_BUFFER_VIEW vertexBufferView;
- quint8 *vbPtr;
- quint8 *cbPtr;
+ quint8 *vbPtr = nullptr;
+ quint8 *cbPtr = nullptr;
};
#endif // HAS_D3D12