Logo Search packages:      
Sourcecode: qt4-x11 version File versions

QGLPixelBuffer Class Reference

Inheritance diagram for QGLPixelBuffer:

List of all members.

Detailed Description

The QGLPixelBuffer class encapsulates an OpenGL pbuffer.

Rendering into a pbuffer is normally done using full hardware acceleration. This can be significantly faster than rendering into a QPixmap.

There are three approaches to using this class:

1 {We can draw into the pbuffer and convert it to a QImage using toImage().} This is normally much faster than calling QGLWidget::renderPixmap().

{We can draw into the pbuffer and copy the contents into an OpenGL texture using updateDynamicTexture().} This allows us to create dynamic textures and works on all systems with pbuffer support.

{On systems that support it, we can bind the pbuffer to an OpenGL texture.} The texture is then updated automatically when the pbuffer contents change, eliminating the need for additional copy operations. This is supported only on Windows and Mac OS X systems that provide the render_texture extension.

Pbuffers are provided by the OpenGL pbuffer extension; call hasOpenGLPbuffer() to find out if the system provides pbuffers.

See also:
{opengl/pbuffers}{Pbuffers Example}

Definition at line 51 of file qglpixelbuffer.h.

Public Types

enum  PaintDeviceMetric {
  PdmWidth = 1, PdmHeight, PdmWidthMM, PdmHeightMM,
  PdmNumColors, PdmDepth, PdmDpiX, PdmDpiY,
  PdmPhysicalDpiX, PdmPhysicalDpiY

Public Member Functions

GLuint bindTexture (const QString &fileName)
GLuint bindTexture (const QPixmap &pixmap, GLenum target=GL_TEXTURE_2D)
GLuint bindTexture (const QImage &image, GLenum target=GL_TEXTURE_2D)
bool bindToDynamicTexture (GLuint texture)
void deleteTexture (GLuint texture_id)
int depth () const
bool doneCurrent ()
void drawTexture (const QPointF &point, GLuint textureId, GLenum textureTarget=GL_TEXTURE_2D)
void drawTexture (const QRectF &target, GLuint textureId, GLenum textureTarget=GL_TEXTURE_2D)
QGLFormat format () const
GLuint generateDynamicTexture () const
Qt::HANDLE handle () const
int height () const
int heightMM () const
bool isValid () const
int logicalDpiX () const
int logicalDpiY () const
bool makeCurrent ()
int numColors () const
QPaintEnginepaintEngine () const
bool paintingActive () const
int physicalDpiX () const
int physicalDpiY () const
 QGLPixelBuffer (int width, int height, const QGLFormat &format=QGLFormat::defaultFormat(), QGLWidget *shareWidget=0)
 QGLPixelBuffer (const QSize &size, const QGLFormat &format=QGLFormat::defaultFormat(), QGLWidget *shareWidget=0)
void releaseFromDynamicTexture ()
QSize size () const
QImage toImage () const
void updateDynamicTexture (GLuint texture_id) const
int width () const
int widthMM () const
virtual ~QGLPixelBuffer ()

Static Public Member Functions

static bool hasOpenGLPbuffers ()

Protected Member Functions

int devType () const
int metric (PaintDeviceMetric metric) const

Protected Attributes

ushort painters

Private Attributes

QGLPixelBufferPrivate * d_ptr


class QGLDrawable
class QGLWindowSurface

Related Functions

(Note that these are not member functions.)

const Q_GUI_EXPORT QX11Infoqt_x11Info (const QPaintDevice *pd)

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index