1// Copyright (C) 2017 The Qt Company Ltd and/or its subsidiary(-ies).
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QT3DRENDER_RENDER_RESOURCEACCESSOR_P_H
5#define QT3DRENDER_RENDER_RESOURCEACCESSOR_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists for the convenience
12// of other Qt classes. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <Qt3DCore/qnodeid.h>
19
20#include <private/qt3drender_global_p.h>
21
22QT_BEGIN_NAMESPACE
23
24class QMutex;
25
26namespace Qt3DRender
27{
28namespace Render {
29
30class TextureManager;
31class AttachmentManager;
32class GLTextureManager;
33class EntityManager;
34class NodeManagers;
35class AbstractRenderer;
36
37class Q_3DRENDERSHARED_PRIVATE_EXPORT RenderBackendResourceAccessor
38{
39public:
40 enum ResourceType {
41 OGLTextureWrite,
42 OGLTextureRead,
43 OutputAttachment,
44 EntityHandle,
45 };
46
47 virtual ~RenderBackendResourceAccessor();
48 virtual bool accessResource(ResourceType type, Qt3DCore::QNodeId nodeId, void **handle, QMutex **lock) = 0;
49};
50
51class Q_3DRENDERSHARED_PRIVATE_EXPORT ResourceAccessor : public RenderBackendResourceAccessor
52{
53public:
54 ResourceAccessor(AbstractRenderer *renderer, NodeManagers *mgr);
55 bool accessResource(ResourceType type, Qt3DCore::QNodeId nodeId, void **handle, QMutex **lock) final;
56private:
57 AbstractRenderer *m_renderer;
58 TextureManager *m_textureManager;
59 AttachmentManager *m_attachmentManager;
60 EntityManager *m_entityManager;
61};
62
63} // namespace Render
64} // namespace Qt3DRender
65
66QT_END_NAMESPACE
67
68#endif // QT3DRENDER_RENDER_RESOURCEACCESSOR_P_H
69

source code of qt3d/src/render/backend/resourceaccessor_p.h