Skip to content

PythonQt.Qt.QGLContext

QGLContext

PythonQtInstanceWrapper object

Native bases: PythonQtInstanceWrapper

Supplemental documentation: Qt 5 reference:

Detailed Description

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.

Source: https://doc.qt.io/archives/qt-5.15/qglcontext.html

Complete member index

Every captured member retains its own identity. Identical captured declaration text is linked once; this does not establish native inheritance or interchangeable objects.

Member Kind Signature Summary
BindOption attribute type Convert a number or string to an integer, or return 0 if no arguments are given. (shared captured text)
BindOptions attribute type Convert a number or string to an integer, or return 0 if no arguments are given. (shared captured text)
CanFlipNativePixmapBindOption attribute Any (shared captured text)
DefaultBindOption attribute Any (shared captured text)
InternalBindOption attribute Any (shared captured text)
InvertedYBindOption attribute Any (shared captured text)
LinearFilteringBindOption attribute Any (shared captured text)
MemoryManagedBindOption attribute Any (shared captured text)
MipmapBindOption attribute Any (shared captured text)
NoBindOption attribute Any (shared captured text)
PremultipliedAlphaBindOption attribute Any (shared captured text)
TemporarilyCachedBindOption attribute Any (shared captured text)
__init__ function (self, *args: Any, **kwargs: Any) -> None Native constructor; consult class documentation for supported overloads. (shared captured text)
areSharing function (self, context1: Any, context2: Any) -> bool X.areSharing(context1, context2) -> bool (shared captured text)
bindTexture function (self, image: Any, target: Any, format: Any, options: Any) -> int X.bindTexture(image, target, format, options) -> int (shared captured text)
chooseContext function (self, shareContext: Any) -> bool X.chooseContext(shareContext) -> bool (shared captured text)
className function (self, *args: Any, **kwargs: Any) -> Any Return the classname of the object (shared captured text)
colorIndex function (self, c: Any) -> int X.colorIndex(c) -> int (shared captured text)
contextHandle function (self) -> Any X.contextHandle() -> PythonQt.QtGui.QOpenGLContext (shared captured text)
create function (self, shareContext: Any) -> bool X.create(shareContext) -> bool (shared captured text)
currentContext function (self) -> Any X.currentContext() -> PythonQt.QtOpenGL.QGLContext (shared captured text)
delete function (self, *args: Any, **kwargs: Any) -> Any Deletes the C++ object (at your own risk, my friend!) (shared captured text)
deleteTexture function (self, tx_id: int) -> None Removes the texture identified by id from the texture cache, and calls glDeleteTextures() to delete the texture from the context. (shared captured text)
device function (self) -> Any X.device() -> PythonQt.QtGui.QPaintDevice (shared captured text)
deviceIsPixmap function (self) -> bool X.deviceIsPixmap() -> bool (shared captured text)
doneCurrent function (self) -> None Makes no GL context the current context. (shared captured text)
drawTexture function (self, point: Any, textureId: int, textureTarget: int) -> None X.drawTexture(point, textureId, textureTarget) (shared captured text)
format function (self) -> Any X.format() -> PythonQt.QtOpenGL.QGLFormat (shared captured text)
fromOpenGLContext function (self, platformContext: Any) -> Any X.fromOpenGLContext(platformContext) -> PythonQt.QtOpenGL.QGLContext (shared captured text)
functions function (self) -> Any X.functions() -> PythonQt.QtOpenGL.QGLFunctions (shared captured text)
help function (self, *args: Any, **kwargs: Any) -> Any Shows the help of available methods for this class (shared captured text)
inherits function (self, *args: Any, **kwargs: Any) -> Any Returns if the class inherits or is of given type name (shared captured text)
initialized function (self) -> bool X.initialized() -> bool (shared captured text)
isSharing function (self) -> bool X.isSharing() -> bool (shared captured text)
isValid function (self) -> bool X.isValid() -> bool (shared captured text)
makeCurrent function (self) -> None Makes this context the current OpenGL rendering context. (shared captured text)
moveToThread function (self, thread: Any) -> None Moves the [QGLContext](https://doc.qt.io/archives/qt-5.15/qglcontext.html) to the given thread. (shared captured text)
overlayTransparentColor function (self) -> Any X.overlayTransparentColor() -> PythonQt.QtGui.QColor (shared captured text)
requestedFormat function (self) -> Any X.requestedFormat() -> PythonQt.QtOpenGL.QGLFormat (shared captured text)
reset function (self) -> None Resets the context and makes it invalid. (shared captured text)
setFormat function (self, format: Any) -> None Sets a format for this context. (shared captured text)
setInitialized function (self, on: bool) -> None If on is true the context has been initialized, i.e. (shared captured text)
setTextureCacheLimit function (self, size: int) -> None This function sets the limit for the texture cache to size, expressed in kilobytes. (shared captured text)
setValid function (self, valid: bool) -> None (shared captured text)
setWindowCreated function (self, on: bool) -> None If on is true the context has had a window created for it. (shared captured text)
swapBuffers function (self) -> None Call this to finish a frame of OpenGL rendering, and make sure to call [makeCurrent](https://doc.qt.io/archives/qt-5.15/qglcontext.html#makeCurrent)() again before issuing any further OpenGL… (shared captured text)
textureCacheLimit function (self) -> int X.textureCacheLimit() -> int (shared captured text)
windowCreated function (self) -> bool X.windowCreated() -> bool (shared captured text)