|  | Home · Overviews · Examples |

# QGLContext Class Reference
[com.trolltech.qt.opengl module]

The `QGLContext` class encapsulates an OpenGL rendering context. More...

## 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 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.