CopperSpice API
1.9.1
|
The QOpenGLFramebufferObject class encapsulates an OpenGL framebuffer object. More...
Public Methods | |
QOpenGLFramebufferObject (const QSize &size, const QOpenGLFramebufferObjectFormat &format) | |
QOpenGLFramebufferObject (int width, int height, const QOpenGLFramebufferObjectFormat &format) | |
virtual | ~QOpenGLFramebufferObject () |
QSize | size () const |
QVector< QSize > | sizes () const |
GLuint | takeTexture () |
Static Public Methods | |
static bool | bindDefault () |
The QOpenGLFramebufferObject class encapsulates an OpenGL framebuffer object, defined by the GL_EXT_framebuffer_object extension. It provides a rendering surface that can be painted on with a QPainter with the help of QOpenGLPaintDevice, or rendered to using native OpenGL calls. This surface can be bound and used as a regular texture in your own OpenGL drawing code. By default, the QOpenGLFramebufferObject class generates a 2D OpenGL texture (using the GL_TEXTURE_2D target), which is used as the internal rendering target.
It is important to have a current OpenGL context when creating a QOpenGLFramebufferObject, otherwise initialization will fail.
QOpenGLFramebufferObject::QOpenGLFramebufferObject | ( | const QSize & | size, |
const QOpenGLFramebufferObjectFormat & | format | ||
) |
Constructs an OpenGL framebuffer object of the given size based on the supplied format.
QOpenGLFramebufferObject::QOpenGLFramebufferObject | ( | int | width, |
int | height, | ||
const QOpenGLFramebufferObjectFormat & | format | ||
) |
Constructs an OpenGL framebuffer object of the given width and height based on the supplied format.
|
virtual |
Destroys the framebuffer object and frees any allocated resources.
|
static |
Switches rendering back to the default windowing system provided framebuffer. Returns true if successful, otherwise false is returned.
QSize QOpenGLFramebufferObject::size | ( | ) | const |
Returns the size of the color and depth/stencil attachments attached to this framebuffer object.
Returns the sizes of all color attachments attached to this framebuffer object.
GLuint QOpenGLFramebufferObject::takeTexture | ( | ) |
Returns the texture id for the texture attached to this framebuffer object. The ownership of the texture is transferred to the caller.
If the framebuffer object is currently bound, an implicit release() will be done. During the next call to bind() a new texture will be created. If a multisample framebuffer object is used then there is no texture and the return value from this function will be invalid. Similarly, incomplete framebuffer objects will also return 0.