Skip to content

PythonQt.QtOpenGL.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.
BindOptions attribute type Convert a number or string to an integer, or return 0 if no arguments are given.
CanFlipNativePixmapBindOption attribute Any
DefaultBindOption attribute Any
InternalBindOption attribute Any
InvertedYBindOption attribute Any
LinearFilteringBindOption attribute Any
MemoryManagedBindOption attribute Any
MipmapBindOption attribute Any
NoBindOption attribute Any
PremultipliedAlphaBindOption attribute Any
TemporarilyCachedBindOption attribute Any
__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
bindTexture function (self, image: Any, target: Any, format: Any, options: Any) -> int X.bindTexture(image, target, format, options) -> int
chooseContext function (self, shareContext: Any) -> bool X.chooseContext(shareContext) -> bool
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
contextHandle function (self) -> Any X.contextHandle() -> PythonQt.QtGui.QOpenGLContext
create function (self, shareContext: Any) -> bool X.create(shareContext) -> bool
currentContext function (self) -> Any X.currentContext() -> PythonQt.QtOpenGL.QGLContext
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.
device function (self) -> Any X.device() -> PythonQt.QtGui.QPaintDevice
deviceIsPixmap function (self) -> bool X.deviceIsPixmap() -> bool
doneCurrent function (self) -> None Makes no GL context the current context.
drawTexture function (self, point: Any, textureId: int, textureTarget: int) -> None X.drawTexture(point, textureId, textureTarget)
format function (self) -> Any X.format() -> PythonQt.QtOpenGL.QGLFormat
fromOpenGLContext function (self, platformContext: Any) -> Any X.fromOpenGLContext(platformContext) -> PythonQt.QtOpenGL.QGLContext
functions function (self) -> Any X.functions() -> PythonQt.QtOpenGL.QGLFunctions
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
isSharing function (self) -> bool X.isSharing() -> bool
isValid function (self) -> bool X.isValid() -> bool
makeCurrent function (self) -> None Makes this context the current OpenGL rendering context.
moveToThread function (self, thread: Any) -> None Moves the [QGLContext](https://doc.qt.io/archives/qt-5.15/qglcontext.html) to the given thread.
overlayTransparentColor function (self) -> Any X.overlayTransparentColor() -> PythonQt.QtGui.QColor
requestedFormat function (self) -> Any X.requestedFormat() -> PythonQt.QtOpenGL.QGLFormat
reset function (self) -> None Resets the context and makes it invalid.
setFormat function (self, format: Any) -> None Sets a format for this context.
setInitialized function (self, on: bool) -> None If on is true the context has been initialized, i.e.
setTextureCacheLimit function (self, size: int) -> None This function sets the limit for the texture cache to size, expressed in kilobytes.
setValid function (self, valid: bool) -> None
setWindowCreated function (self, on: bool) -> None If on is true the context has had a window created for it.
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…
textureCacheLimit function (self) -> int X.textureCacheLimit() -> int
windowCreated function (self) -> bool X.windowCreated() -> bool