Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qopenglframebufferobject_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 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 QOPENGLFRAMEBUFFEROBJECT_P_H
5#define QOPENGLFRAMEBUFFEROBJECT_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 purely as an
12// implementation detail. 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 <QtCore/qvarlengtharray.h>
20#include <private/qopenglcontext_p.h>
21#include <private/qopenglextensions_p.h>
22
24
26{
27public:
29 : ref(1),
30 samples(0),
32 target(GL_TEXTURE_2D),
34 {
35#if !QT_CONFIG(opengles2)
36 // There is nothing that says QOpenGLFramebufferObjectFormat needs a current
37 // context, so we need a fallback just to be safe, even though in practice there
38 // will usually be a current context.
40 const bool isES = ctx ? ctx->isOpenGLES() : QOpenGLContext::openGLModuleType() != QOpenGLContext::LibGL;
42#else
44#endif
45 }
57 {
58 return samples == other->samples &&
59 attachment == other->attachment &&
60 target == other->target &&
61 internal_format == other->internal_format &&
62 mipmap == other->mipmap;
63 }
64
71};
72
74{
75public:
80
83 GLenum texture_target, GLenum internal_format,
84 GLint samples = 0, bool mipmap = false);
85 void initTexture(int idx);
86 void initColorBuffer(int idx, GLint *samples);
88
100
109 QVarLengthArray<ColorAttachment, 8> colorAttachments;
110
111 inline GLuint fbo() const { return fbo_guard ? fbo_guard->id() : 0; }
112};
113
114Q_OPENGL_EXPORT QImage qt_gl_read_framebuffer(const QSize &size, bool alpha_format, bool include_alpha);
115
117
118#endif // QOPENGLFRAMEBUFFEROBJECT_P_H
\inmodule QtCore
Definition qatomic.h:112
\inmodule QtGui
Definition qimage.h:37
\inmodule QtGui
static OpenGLModuleType openGLModuleType()
Returns the underlying OpenGL implementation type.
static QOpenGLContext * currentContext()
Returns the last context which called makeCurrent in the current thread, or \nullptr,...
QOpenGLFramebufferObject::Attachment attachment
bool equals(const QOpenGLFramebufferObjectFormatPrivate *other)
QOpenGLFramebufferObjectFormatPrivate(const QOpenGLFramebufferObjectFormatPrivate *other)
The QOpenGLFramebufferObjectFormat class specifies the format of an OpenGL framebuffer object.
bool checkFramebufferStatus(QOpenGLContext *ctx) const
void initDepthStencilAttachments(QOpenGLContext *ctx, QOpenGLFramebufferObject::Attachment attachment)
QOpenGLSharedResourceGuard * fbo_guard
QOpenGLFramebufferObject::Attachment fbo_attachment
void init(QOpenGLFramebufferObject *q, const QSize &size, QOpenGLFramebufferObject::Attachment attachment, GLenum texture_target, GLenum internal_format, GLint samples=0, bool mipmap=false)
void initColorBuffer(int idx, GLint *samples)
QOpenGLFramebufferObjectFormat format
QOpenGLSharedResourceGuard * depth_buffer_guard
QVarLengthArray< ColorAttachment, 8 > colorAttachments
QOpenGLSharedResourceGuard * stencil_buffer_guard
The QOpenGLFramebufferObject class encapsulates an OpenGL framebuffer object.
Attachment
This enum type is used to configure the depth and stencil buffers attached to the framebuffer object ...
The QOpenGLSharedResourceGuard class is a convenience sub-class of QOpenGLSharedResource to be used t...
\inmodule QtCore
Definition qsize.h:25
EGLContext ctx
Combined button and popup list for selecting options.
typedef GLint(GL_APIENTRYP PFNGLGETPROGRAMRESOURCELOCATIONINDEXEXTPROC)(GLuint program
GLsizei samples
GLenum GLuint GLintptr GLsizeiptr size
[1]
typedef GLenum(GL_APIENTRYP PFNGLGETGRAPHICSRESETSTATUSKHRPROC)(void)
GLenum target
GLint ref
GLenum attachment
GLsizei GLenum internalFormat
GLdouble GLdouble GLdouble GLdouble q
Definition qopenglext.h:259
Q_OPENGL_EXPORT QImage qt_gl_read_framebuffer(const QSize &size, bool alpha_format, bool include_alpha)
#define GL_RGBA8
#define GLuint
#define GL_RGBA
unsigned int uint
Definition qtypes.h:34
QObject::connect nullptr
QSharedPointer< T > other(t)
[5]
ColorAttachment(const QSize &size, GLenum internalFormat)