1/****************************************************************************
2**
3** Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB).
4** Contact: https://www.qt.io/licensing/
5**
6** This file is part of the Qt3D module of the Qt Toolkit.
7**
8** $QT_BEGIN_LICENSE:GPL-EXCEPT$
9** Commercial License Usage
10** Licensees holding valid commercial Qt licenses may use this file in
11** accordance with the commercial license agreement provided with the
12** Software or, alternatively, in accordance with the terms contained in
13** a written agreement between you and The Qt Company. For licensing terms
14** and conditions see https://www.qt.io/terms-conditions. For further
15** information use the contact form at https://www.qt.io/contact-us.
16**
17** GNU General Public License Usage
18** Alternatively, this file may be used under the terms of the GNU
19** General Public License version 3 as published by the Free Software
20** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
21** included in the packaging of this file. Please review the following
22** information to ensure the GNU General Public License requirements will
23** be met: https://www.gnu.org/licenses/gpl-3.0.html.
24**
25** $QT_END_LICENSE$
26**
27****************************************************************************/
28
29#ifndef TESTRENDERER_H
30#define TESTRENDERER_H
31
32#include <Qt3DRender/private/abstractrenderer_p.h>
33
34QT_BEGIN_NAMESPACE
35
36class TestRenderer : public Qt3DRender::Render::AbstractRenderer
37{
38public:
39 TestRenderer();
40 ~TestRenderer();
41
42 void dumpInfo() const override {}
43 API api() const override { return AbstractRenderer::OpenGL; }
44 qint64 time() const override { return 0; }
45 void setTime(qint64 time) override { Q_UNUSED(time); }
46 void setNodeManagers(Qt3DRender::Render::NodeManagers *m) override { m_managers = m; }
47 void setServices(Qt3DCore::QServiceLocator *services) override { Q_UNUSED(services); }
48 void setSurfaceExposed(bool exposed) override { Q_UNUSED(exposed); }
49 Qt3DRender::Render::NodeManagers *nodeManagers() const override { return m_managers; }
50 Qt3DCore::QServiceLocator *services() const override { return nullptr; }
51 void initialize() override {}
52 void shutdown() override {}
53 void releaseGraphicsResources() override {}
54 void render() override {}
55 void doRender(bool scene3dBlocking = false) override { Q_UNUSED(scene3dBlocking); }
56 void cleanGraphicsResources() override {}
57 bool isRunning() const override { return true; }
58 bool shouldRender() override { return true; }
59 void skipNextFrame() override {}
60 QVector<Qt3DCore::QAspectJobPtr> preRenderingJobs() override { return QVector<Qt3DCore::QAspectJobPtr>(); }
61 QVector<Qt3DCore::QAspectJobPtr> renderBinJobs() override { return QVector<Qt3DCore::QAspectJobPtr>(); }
62 Qt3DCore::QAspectJobPtr pickBoundingVolumeJob() override { return Qt3DCore::QAspectJobPtr(); }
63 Qt3DCore::QAspectJobPtr rayCastingJob() override { return Qt3DCore::QAspectJobPtr(); }
64 Qt3DCore::QAspectJobPtr syncLoadingJobs() override { return Qt3DCore::QAspectJobPtr(); }
65 Qt3DCore::QAspectJobPtr expandBoundingVolumeJob() override { return Qt3DCore::QAspectJobPtr(); }
66 void setSceneRoot(Qt3DCore::QBackendNodeFactory *factory, Qt3DRender::Render::Entity *root) override { Q_UNUSED(factory); Q_UNUSED(root); }
67 Qt3DRender::Render::Entity *sceneRoot() const override { return nullptr; }
68 Qt3DRender::Render::FrameGraphNode *frameGraphRoot() const override { return nullptr; }
69 Qt3DCore::QAbstractFrameAdvanceService *frameAdvanceService() const override { return nullptr; }
70 void registerEventFilter(Qt3DCore::QEventFilterService *service) override { Q_UNUSED(service); }
71 void setSettings(Qt3DRender::Render::RenderSettings *settings) override { Q_UNUSED(settings); }
72 Qt3DRender::Render::RenderSettings *settings() const override { return nullptr; }
73
74 void markDirty(Qt3DRender::Render::AbstractRenderer::BackendNodeDirtySet changes, Qt3DRender::Render::BackendNode *node) override;
75 Qt3DRender::Render::AbstractRenderer::BackendNodeDirtySet dirtyBits() override;
76#if defined(QT_BUILD_INTERNAL)
77 void clearDirtyBits(Qt3DRender::Render::AbstractRenderer::BackendNodeDirtySet changes) override;
78#endif
79
80 void resetDirty();
81 QVariant executeCommand(const QStringList &args) override;
82 QOpenGLContext *shareContext() const override;
83
84 void setOffscreenSurfaceHelper(Qt3DRender::Render::OffscreenSurfaceHelper *helper) override;
85 QSurfaceFormat format() override;
86
87 void setOpenGLContext(QOpenGLContext *) override {}
88
89 void loadShader(Qt3DRender::Render::Shader *, Qt3DRender::Render::HShader) override {}
90
91protected:
92 Qt3DRender::Render::AbstractRenderer::BackendNodeDirtySet m_changes;
93 Qt3DRender::Render::NodeManagers *m_managers;
94};
95
96QT_END_NAMESPACE
97
98#endif // TESTRENDERER_H
99