1 | // Copyright (C) 2017 The Qt Company Ltd. |
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_OPENGL_RENDERBUFFER_P_H |
5 | #define QT3DRENDER_RENDER_OPENGL_RENDERBUFFER_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 <Qt3DRender/qabstracttexture.h> |
19 | |
20 | QT_BEGIN_NAMESPACE |
21 | |
22 | class QOpenGLContext; |
23 | |
24 | namespace Qt3DRender { |
25 | namespace Render { |
26 | namespace OpenGL { |
27 | |
28 | class Q_AUTOTEST_EXPORT RenderBuffer |
29 | { |
30 | public: |
31 | RenderBuffer(int width, int height, QAbstractTexture::TextureFormat format); |
32 | ~RenderBuffer(); |
33 | |
34 | int width() const { return m_size.width(); } |
35 | int height() const { return m_size.height(); } |
36 | QSize size() const { return m_size; } |
37 | QAbstractTexture::TextureFormat format() const { return m_format; } |
38 | GLuint renderBufferId() const { return m_renderBuffer; } |
39 | |
40 | void bind(); |
41 | void release(); |
42 | |
43 | private: |
44 | QSize m_size; |
45 | QAbstractTexture::TextureFormat m_format; |
46 | GLuint m_renderBuffer; |
47 | QOpenGLContext *m_context; |
48 | }; |
49 | |
50 | } // namespace OpenGL |
51 | } // namespace Render |
52 | } // namespace Qt3DRender |
53 | |
54 | QT_END_NAMESPACE |
55 | |
56 | #endif // QT3DRENDER_RENDER_OPENGL_RENDERBUFFER_P_H |
57 | |