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

QGLContext Class Reference

List of all members.

Detailed Description

The QGLContext class encapsulates an OpenGL rendering context.

An OpenGL rendering context is a complete set of OpenGL state variables. The rendering context's {QGL::FormatOption} {format} is set in the constructor, but it can also be set later with setFormat(). The format options that are actually set are returned by format(); the options you asked for are returned by requestedFormat(). Note that after a QGLContext object has been constructed, the actual OpenGL context must be created by explicitly calling the create() function. The makeCurrent() function makes this context the current rendering context. You can make no context current using doneCurrent(). The reset() function will reset the context and make it invalid.

You can examine properties of the context with, e.g. isValid(), isSharing(), initialized(), windowCreated() and overlayTransparentColor().

If you're using double buffering you can swap the screen contents with the off-screen buffer using swapBuffers().

Please note that QGLContext is not thread safe.

Definition at line 258 of file qgl.h.

Public Member Functions

GLuint bindTexture (const QString &fileName)
GLuint bindTexture (const QPixmap &pixmap, GLenum target=GL_TEXTURE_2D, GLint format=GL_RGBA)
GLuint bindTexture (const QImage &image, GLenum target=GL_TEXTURE_2D, GLint format=GL_RGBA)
virtual bool create (const QGLContext *shareContext=0)
void deleteTexture (GLuint tx_id)
QPaintDevice * device () const
virtual void 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
void * getProcAddress (const QString &proc) const
bool isSharing () const
bool isValid () const
virtual void makeCurrent ()
QColor overlayTransparentColor () const
 QGLContext (const QGLFormat &format)
 QGLContext (const QGLFormat &format, QPaintDevice *device)
QGLFormat requestedFormat () const
void reset ()
void setFormat (const QGLFormat &format)
virtual void swapBuffers () const
virtual ~QGLContext ()

Static Public Member Functions

static const QGLContextcurrentContext ()
static void setTextureCacheLimit (int size)
static int textureCacheLimit ()

Protected Member Functions

virtual bool chooseContext (const QGLContext *shareContext=0)
uint colorIndex (const QColor &c) const
bool deviceIsPixmap () const
void generateFontDisplayLists (const QFont &fnt, int listBase)
bool initialized () const
void setDevice (QPaintDevice *pDev)
void setInitialized (bool on)
void setValid (bool valid)
void setWindowCreated (bool on)
bool windowCreated () const

Static Protected Attributes

static QGLContextcurrentCtx = 0

Private Attributes

QGLContextPrivate * d_ptr


class QGLDrawable
class QGLGlyphCache
class QGLPixelBuffer
class QGLPixelBufferPrivate
class QGLWidget
class QGLWidgetPrivate
class QOpenGLPaintEngine
class QOpenGLPaintEnginePrivate

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

Generated by  Doxygen 1.6.0   Back to index