![]() |
Home · All Classes · Main Classes · Grouped Classes · Modules · Functions | ![]() |
The QGLPbuffer class encapsulates an OpenGL pixel buffer. More...
#include <QGLPbuffer>
Inherits QPaintDevice.
This class was introduced in Qt 4.1.
The QGLPbuffer class encapsulates an OpenGL pixel buffer.
QGLPbuffer provides functionality for creating and managing an OpenGL pixel buffer (pbuffer). A pixel buffer can be rendered into using full hardware acceleration. This is usually much faster than rendering into a system pixmap, where software rendering is often used. Under Windows and on Mac OS X it is also possible to bind the pixel buffer directly as a texture using the render_texture extension, thus eliminating the need for additional copy operations to generate dynamic textures.
Note that when making use of the render_texture extension, the well known power-of-2 rule applies to the size of the buffer. If the size of the buffer is a non-power of 2 size, it can not be bound to a texture.
See also opengl/pbuffers.
Constructs an OpenGL pbuffer of the size size. If no format is specified the default format is used. If the shareWidget parameter points to a valid QGLWidget, the pbuffer will share its context with shareWidget.
Destroys the QGLPbuffer and frees its resources.
Binds the texture specified with texture_id to this buffer. Returns true on success, false otherwise.
This function uses the render_texture extension, which is currently not supported under X11. Under X11 you can achieve the same by copying the buffer contents to a texture after drawing into the buffer using copyToTexture().
For the bind() call to succeed on the Mac, the pbuffer needs a shared context, i.e. the QGLPbuffer have to be created with a share widget.
Generates and binds a 2D GL texture to the current context, based on image. The generated texture id is returned and can be used in later glBindTexture() calls.
The target parameter specifies the texture target. The format parameter sets the internal format for the texture.
Equivalent to calling QGLContext::bindTexture().
See also deleteTexture().
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
Generates and binds a 2D GL texture based on pixmap.
Equivalent to calling QGLContext::bindTexture().
See also deleteTexture().
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
Reads the DirectDrawSurface (DDS) compressed file fileName and generates a 2D GL texture from it.
Equivalent to calling QGLContext::bindTexture().
See also deleteTexture().
This is a convenience function that copies the buffer contents (using glCopyTexImage2D()) into the texture specified with texture_id, which has the internal format format. The default internal format is GL_RGBA8.
Removes the texture identified by texture_id from the texture cache.
Equivalent to calling QGLContext::deleteTexture().
Makes no context the current GL context. Returns true on success, false otherwise.
Returns the format of the pbuffer. The format may be different from the one that was requested.
This is a convenience function that generates and binds a 2D GL texture that is the same size as the buffer, using format as the internal texture format. The default internal format of the generated texture is GL_RGBA8. The generated texture id is returned.
Returns the native pbuffer handle.
Returns true if pbuffers are supported on this system, otherwise false.
Returns true if this buffer is valid.
Makes this pbuffer the current GL rendering context. Returns true on success, false otherwise.
Releases the buffer from any previously bound texture. Returns true on success, false otherwise.
This function uses the render_texture extension, which is currently not supported under X11.
Returns the size of the buffer.
Returns the contents of the buffer as a QImage.
Copyright © 2005 Trolltech | Trademarks | Qt 4.1.0-rc1 |