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 | |
22 | QT_BEGIN_NAMESPACE |
23 | |
24 | class QMutex; |
25 | |
26 | namespace Qt3DRender |
27 | { |
28 | namespace Render { |
29 | |
30 | class TextureManager; |
31 | class AttachmentManager; |
32 | class GLTextureManager; |
33 | class EntityManager; |
34 | class NodeManagers; |
35 | class AbstractRenderer; |
36 | |
37 | class Q_3DRENDERSHARED_PRIVATE_EXPORT RenderBackendResourceAccessor |
38 | { |
39 | public: |
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 | |
51 | class Q_3DRENDERSHARED_PRIVATE_EXPORT ResourceAccessor : public RenderBackendResourceAccessor |
52 | { |
53 | public: |
54 | ResourceAccessor(AbstractRenderer *renderer, NodeManagers *mgr); |
55 | bool accessResource(ResourceType type, Qt3DCore::QNodeId nodeId, void **handle, QMutex **lock) final; |
56 | private: |
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 | |
66 | QT_END_NAMESPACE |
67 | |
68 | #endif // QT3DRENDER_RENDER_RESOURCEACCESSOR_P_H |
69 | |