QGLPixelBuffer

Inheritance diagram of QGLPixelBuffer

Synopsis

Functions

Static functions

Detailed Description

The PySide.QtOpenGL.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 PySide.QtGui.QPixmap .

There are three approaches to using this class:

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

See also

Pbuffers Example

class PySide.QtOpenGL.QGLPixelBuffer(size[, format=QGLFormat.defaultFormat()[, shareWidget=None]])
class PySide.QtOpenGL.QGLPixelBuffer(width, height[, format=QGLFormat.defaultFormat()[, shareWidget=None]])
Parameters:

Constructs an OpenGL pbuffer of the given size . If no format is specified, the default format is used. If the shareWidget parameter points to a valid PySide.QtOpenGL.QGLWidget , the pbuffer will share its context with shareWidget .

If you intend to bind this pbuffer as a dynamic texture, the width and height components of size must be powers of two (e.g., 512 x 128).

This is an overloaded function.

Constructs an OpenGL pbuffer with the width and height . If no format is specified, the default format is used. If the shareWidget parameter points to a valid PySide.QtOpenGL.QGLWidget , the pbuffer will share its context with shareWidget .

If you intend to bind this pbuffer as a dynamic texture, the width and height components of size must be powers of two (e.g., 512 x 128).

PySide.QtOpenGL.QGLPixelBuffer.bindTexture(fileName)
Parameters:fileName – unicode
Return type:long

This is an overloaded function.

Reads the DirectDrawSurface (DDS) compressed file fileName and generates a 2D GL texture from it.

Equivalent to calling QGLContext.bindTexture() .

PySide.QtOpenGL.QGLPixelBuffer.bindTexture(pixmap[, target=0x0DE1])
Parameters:
Return type:

long

PySide.QtOpenGL.QGLPixelBuffer.bindTexture(image[, target=0x0DE1])
Parameters:
Return type:

long

PySide.QtOpenGL.QGLPixelBuffer.bindToDynamicTexture(texture)
Parameters:texture – long
Return type:PySide.QtCore.bool
PySide.QtOpenGL.QGLPixelBuffer.deleteTexture(texture_id)
Parameters:texture_id – long
PySide.QtOpenGL.QGLPixelBuffer.doneCurrent()
Return type:PySide.QtCore.bool

Makes no context the current OpenGL context. Returns true on success; otherwise returns false.

PySide.QtOpenGL.QGLPixelBuffer.drawTexture(point, textureId[, textureTarget=0x0DE1])
Parameters:
PySide.QtOpenGL.QGLPixelBuffer.drawTexture(target, textureId[, textureTarget=0x0DE1])
Parameters:
PySide.QtOpenGL.QGLPixelBuffer.format()
Return type:PySide.QtOpenGL.QGLFormat

Returns the format of the pbuffer. The format may be different from the one that was requested.

PySide.QtOpenGL.QGLPixelBuffer.generateDynamicTexture()
Return type:long
PySide.QtOpenGL.QGLPixelBuffer.handle()
Return type:PySide.QtCore.Qt::HANDLE

Returns the native pbuffer handle.

static PySide.QtOpenGL.QGLPixelBuffer.hasOpenGLPbuffers()
Return type:PySide.QtCore.bool

Returns true if the OpenGL pbuffer extension is present on this system; otherwise returns false.

PySide.QtOpenGL.QGLPixelBuffer.isValid()
Return type:PySide.QtCore.bool

Returns true if this pbuffer is valid; otherwise returns false.

PySide.QtOpenGL.QGLPixelBuffer.makeCurrent()
Return type:PySide.QtCore.bool

Makes this pbuffer the current OpenGL rendering context. Returns true on success; otherwise returns false.

PySide.QtOpenGL.QGLPixelBuffer.releaseFromDynamicTexture()

Releases the pbuffer from any previously bound texture.

PySide.QtOpenGL.QGLPixelBuffer.size()
Return type:PySide.QtCore.QSize

Returns the size of the pbuffer.

PySide.QtOpenGL.QGLPixelBuffer.toImage()
Return type:PySide.QtGui.QImage

Returns the contents of the pbuffer as a PySide.QtGui.QImage .

PySide.QtOpenGL.QGLPixelBuffer.updateDynamicTexture(texture_id)
Parameters:texture_id – long