1// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
2// Copyright (C) 2016 Svenn-Arne Dragly.
3// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
4
5#ifndef QT3DRENDER_RENDER_OPENGL_GRAPHICSHELPERES3_H
6#define QT3DRENDER_RENDER_OPENGL_GRAPHICSHELPERES3_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists for the convenience
13// of other Qt classes. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <graphicshelperes2_p.h>
20
21QT_BEGIN_NAMESPACE
22
23namespace Qt3DRender {
24namespace Render {
25namespace OpenGL {
26
27class GraphicsHelperES3 : public GraphicsHelperES2
28{
29public:
30 GraphicsHelperES3();
31 ~GraphicsHelperES3();
32
33 // QGraphicHelperInterface interface
34 void bindBufferBase(GLenum target, GLuint index, GLuint buffer) override;
35 bool frameBufferNeedsRenderBuffer(const Attachment &attachment) override;
36 void bindFrameBufferAttachment(QOpenGLTexture *texture, const Attachment &attachment) override;
37 void bindFrameBufferObject(GLuint frameBufferId, FBOBindMode mode) override;
38 void bindUniformBlock(GLuint programId, GLuint uniformBlockIndex, GLuint uniformBlockBinding) override;
39 void blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) override;
40 void buildUniformBuffer(const QVariant &v, const ShaderUniform &description, QByteArray &buffer) override;
41 void drawBuffers(GLsizei n, const int *bufs) override;
42 void drawArraysInstanced(GLenum primitiveType, GLint first, GLsizei count, GLsizei instances) override;
43 void drawArraysInstancedBaseInstance(GLenum primitiveType, GLint first, GLsizei count, GLsizei instances, GLsizei baseInstance) override;
44 void drawElementsInstancedBaseVertexBaseInstance(GLenum primitiveType, GLsizei primitiveCount, GLint indexType, void *indices, GLsizei instances, GLint baseVertex = 0, GLint baseInstance = 0) override;
45 void readBuffer(GLenum mode) override;
46 void drawBuffer(GLenum mode) override;
47 void initializeHelper(QOpenGLContext *context, QAbstractOpenGLFunctions *functions) override;
48 char *mapBuffer(GLenum target, GLsizeiptr size) override;
49 std::vector<ShaderUniform> programUniformsAndLocations(GLuint programId) override;
50 std::vector<ShaderUniformBlock> programUniformBlocks(GLuint programId) override;
51 bool supportsFeature(Feature feature) const override;
52 GLboolean unmapBuffer(GLenum target) override;
53 void vertexAttribDivisor(GLuint index, GLuint divisor) override;
54 void vertexAttributePointer(GLenum shaderDataType, GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer) override;
55
56 UniformType uniformTypeFromGLType(GLenum glType) override;
57 uint uniformByteSize(const ShaderUniform &description) override;
58
59 void *fenceSync() override;
60 void clientWaitSync(void *sync, GLuint64 nanoSecTimeout) override;
61 void waitSync(void *sync) override;
62 bool wasSyncSignaled(void *sync) override;
63 void deleteSync(void *sync) override;
64
65protected:
66 QOpenGLExtraFunctions *m_extraFuncs = nullptr;
67};
68
69} // namespace OpenGL
70} // namespace Render
71} // namespace Qt3DRender
72
73QT_END_NAMESPACE
74
75#endif // QT3DRENDER_RENDER_OPENGL_GRAPHICSHELPERES3_H
76

source code of qt3d/src/plugins/renderers/opengl/graphicshelpers/graphicshelperes3_p.h