QOpenGLFunctions#

The QOpenGLFunctions class provides cross-platform access to the OpenGL ES 2.0 API. More

Inherited by: QOpenGLExtraFunctions

Synopsis#

Functions#

Note

This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE

Detailed Description#

Warning

This section contains snippets that were automatically translated from C++ to Python and may contain errors.

OpenGL ES 2.0 defines a subset of the OpenGL specification that is common across many desktop and embedded OpenGL implementations. However, it can be difficult to use the functions from that subset because they need to be resolved manually on desktop systems.

QOpenGLFunctions provides a guaranteed API that is available on all OpenGL systems and takes care of function resolution on systems that need it. The recommended way to use QOpenGLFunctions is by direct inheritance:

class MyGLWindow(QWindow, QOpenGLFunctions):

    Q_OBJECT
# public
    MyGLWindow = explicit(QScreen screen = None)
# protected
    def initializeGL():
    def paintGL():
    m_context = QOpenGLContext()

def __init__(self, screen):
    super().__init__(screen)

    setSurfaceType(OpenGLSurface)
    create()
    # Create an OpenGL context
    m_context = QOpenGLContext()
    m_context.create()
    # Setup scene and render it
    initializeGL()
    paintGL()

def initializeGL(self):

    m_context.makeCurrent(self)
    initializeOpenGLFunctions()

The paintGL() function can then use any of the OpenGL ES 2.0 functions without explicit resolution, such as glActiveTexture() in the following example:

def paintGL(self):

    m_context.makeCurrent(self)
    glActiveTexture(GL_TEXTURE1)
    glBindTexture(GL_TEXTURE_2D, textureId)
    # ...
    m_context.swapBuffers(self)
    m_context.doneCurrent()

QOpenGLFunctions can also be used directly for ad-hoc invocation of OpenGL ES 2.0 functions on all platforms:

def glFuncs(QOpenGLContext.currentContext()):
glFuncs.glActiveTexture(GL_TEXTURE1)

An alternative approach is to query the context’s associated QOpenGLFunctions instance. This is somewhat faster than the previous approach due to avoiding the creation of a new instance, but the difference is fairly small since the internal data structures are shared, and function resolving happens only once for a given context, regardless of the number of QOpenGLFunctions instances initialized for it.

glFuncs = QOpenGLContext.currentContext().functions()
glFuncs.glActiveTexture(GL_TEXTURE1)

QOpenGLFunctions provides wrappers for all OpenGL ES 2.0 functions, including the common subset of OpenGL 1.x and ES 2.0. While such functions, for example glClear() or glDrawArrays() , can be called also directly, as long as the application links to the platform-specific OpenGL library, calling them via QOpenGLFunctions enables the possibility of dynamically loading the OpenGL implementation.

The hasOpenGLFeature() and openGLFeatures() functions can be used to determine if the OpenGL implementation has a major OpenGL ES 2.0 feature. For example, the following checks if non power of two textures are available:

def funcs(QOpenGLContext.currentContext()):
npot = funcs.hasOpenGLFeature(QOpenGLFunctions.NPOTTextures)
class PySide6.QtGui.QOpenGLFunctions#

PySide6.QtGui.QOpenGLFunctions(context)

Parameters:

contextPySide6.QtGui.QOpenGLContext

Constructs a default function resolver. The resolver cannot be used until initializeOpenGLFunctions() is called to specify the context.

Constructs a function resolver for context. If context is None, then the resolver will be created for the current QOpenGLContext .

The context or another context in the group must be current.

An object constructed in this way can only be used with context and other contexts that share with it. Use initializeOpenGLFunctions() to change the object’s context association.

PySide6.QtGui.QOpenGLFunctions.OpenGLFeature#

(inherits enum.Flag) This enum defines OpenGL and OpenGL ES features whose presence may depend on the implementation.

Constant

Description

QOpenGLFunctions.Multitexture

glActiveTexture() function is available.

QOpenGLFunctions.Shaders

Shader functions are available.

QOpenGLFunctions.Buffers

Vertex and index buffer functions are available.

QOpenGLFunctions.Framebuffers

Framebuffer object functions are available.

QOpenGLFunctions.BlendColor

glBlendColor() is available.

QOpenGLFunctions.BlendEquation

glBlendEquation() is available.

QOpenGLFunctions.BlendEquationSeparate

glBlendEquationSeparate() is available.

QOpenGLFunctions.BlendEquationAdvanced

Advanced blend equations are available.

QOpenGLFunctions.BlendFuncSeparate

glBlendFuncSeparate() is available.

QOpenGLFunctions.BlendSubtract

Blend subtract mode is available.

QOpenGLFunctions.CompressedTextures

Compressed texture functions are available.

QOpenGLFunctions.Multisample

glSampleCoverage() function is available.

QOpenGLFunctions.StencilSeparate

Separate stencil functions are available.

QOpenGLFunctions.NPOTTextures

Non power of two textures are available.

QOpenGLFunctions.NPOTTextureRepeat

Non power of two textures can use GL_REPEAT as wrap parameter.

QOpenGLFunctions.FixedFunctionPipeline

The fixed function pipeline is available.

QOpenGLFunctions.TextureRGFormats

The GL_RED and GL_RG texture formats are available.

QOpenGLFunctions.MultipleRenderTargets

Multiple color attachments to framebuffer objects are available.

PySide6.QtGui.QOpenGLFunctions.glActiveTexture(texture)#
Parameters:

texture – int

Convenience function that calls glActiveTexture(texture).

For more information, see the OpenGL ES 3.X documentation for glActiveTexture() .

PySide6.QtGui.QOpenGLFunctions.glAttachShader(program, shader)#
Parameters:
  • program – int

  • shader – int

Convenience function that calls glAttachShader(program, shader).

For more information, see the OpenGL ES 3.X documentation for glAttachShader() .

This convenience function will do nothing on OpenGL ES 1.x systems.

PySide6.QtGui.QOpenGLFunctions.glBindAttribLocation(program, index, name)#
Parameters:
  • program – int

  • index – int

  • name – str

Convenience function that calls glBindAttribLocation(program, index, name).

For more information, see the OpenGL ES 3.X documentation for glBindAttribLocation() .

This convenience function will do nothing on OpenGL ES 1.x systems.

PySide6.QtGui.QOpenGLFunctions.glBindBuffer(target, buffer)#
Parameters:
  • target – int

  • buffer – int

Convenience function that calls glBindBuffer(target, buffer).

For more information, see the OpenGL ES 3.X documentation for glBindBuffer() .

PySide6.QtGui.QOpenGLFunctions.glBindFramebuffer(target, framebuffer)#
Parameters:
  • target – int

  • framebuffer – int

Convenience function that calls glBindFramebuffer(target, framebuffer).

Note that Qt will translate a framebuffer argument of 0 to the currently bound QOpenGLContext ‘s defaultFramebufferObject().

For more information, see the OpenGL ES 3.X documentation for glBindFramebuffer() .

PySide6.QtGui.QOpenGLFunctions.glBindRenderbuffer(target, renderbuffer)#
Parameters:
  • target – int

  • renderbuffer – int

Convenience function that calls glBindRenderbuffer(target, renderbuffer).

For more information, see the OpenGL ES 3.X documentation for glBindRenderbuffer() .

PySide6.QtGui.QOpenGLFunctions.glBindTexture(target, texture)#
Parameters:
  • target – int

  • texture – int

Convenience function that calls glBindTexture(target, texture).

For more information, see the OpenGL ES 3.X documentation for glBindTexture() .

PySide6.QtGui.QOpenGLFunctions.glBlendColor(red, green, blue, alpha)#
Parameters:
  • red – float

  • green – float

  • blue – float

  • alpha – float

Convenience function that calls glBlendColor(red, green, blue, alpha).

For more information, see the OpenGL ES 3.X documentation for glBlendColor() .

PySide6.QtGui.QOpenGLFunctions.glBlendEquation(mode)#
Parameters:

mode – int

Convenience function that calls glBlendEquation(mode).

For more information, see the OpenGL ES 3.X documentation for glBlendEquation() .

PySide6.QtGui.QOpenGLFunctions.glBlendEquationSeparate(modeRGB, modeAlpha)#
Parameters:
  • modeRGB – int

  • modeAlpha – int

Convenience function that calls glBlendEquationSeparate(modeRGB, modeAlpha).

For more information, see the OpenGL ES 3.X documentation for glBlendEquationSeparate() .

PySide6.QtGui.QOpenGLFunctions.glBlendFunc(sfactor, dfactor)#
Parameters:
  • sfactor – int

  • dfactor – int

Convenience function that calls glBlendFunc(sfactor, dfactor).

For more information, see the OpenGL ES 3.X documentation for glBlendFunc() .

PySide6.QtGui.QOpenGLFunctions.glBlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha)#
Parameters:
  • srcRGB – int

  • dstRGB – int

  • srcAlpha – int

  • dstAlpha – int

Convenience function that calls glBlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha).

For more information, see the OpenGL ES 3.X documentation for glBlendFuncSeparate() .

PySide6.QtGui.QOpenGLFunctions.glCheckFramebufferStatus(target)#
Parameters:

target – int

Return type:

int

Convenience function that calls glCheckFramebufferStatus(target).

For more information, see the OpenGL ES 3.X documentation for glCheckFramebufferStatus() .

PySide6.QtGui.QOpenGLFunctions.glClear(mask)#
Parameters:

mask – int

Convenience function that calls glClear(mask).

For more information, see the OpenGL ES 3.X documentation for glClear() .

PySide6.QtGui.QOpenGLFunctions.glClearColor(red, green, blue, alpha)#
Parameters:
  • red – float

  • green – float

  • blue – float

  • alpha – float

Convenience function that calls glClearColor(red, green, blue, alpha).

For more information, see the OpenGL ES 3.X documentation for glClearColor() .

PySide6.QtGui.QOpenGLFunctions.glClearDepthf(depth)#
Parameters:

depth – float

Convenience function that calls glClearDepth(depth) on desktop OpenGL systems and glClearDepthf(depth) on embedded OpenGL ES systems.

For more information, see the OpenGL ES 3.X documentation for glClearDepthf() .

PySide6.QtGui.QOpenGLFunctions.glClearStencil(s)#
Parameters:

s – int

Convenience function that calls glClearStencil(s).

For more information, see the OpenGL ES 3.X documentation for glClearStencil() .

PySide6.QtGui.QOpenGLFunctions.glColorMask(red, green, blue, alpha)#
Parameters:
  • red – int

  • green – int

  • blue – int

  • alpha – int

Convenience function that calls glColorMask(red, green, blue, alpha).

For more information, see the OpenGL ES 3.X documentation for glColorMask() .

PySide6.QtGui.QOpenGLFunctions.glCompileShader(shader)#
Parameters:

shader – int

Convenience function that calls glCompileShader(shader).

For more information, see the OpenGL ES 3.X documentation for glCompileShader() .

This convenience function will do nothing on OpenGL ES 1.x systems.

PySide6.QtGui.QOpenGLFunctions.glCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data)#
Parameters:
  • target – int

  • level – int

  • internalformat – int

  • width – int

  • height – int

  • border – int

  • imageSize – int

  • datavoid

Convenience function that calls glCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data).

For more information, see the OpenGL ES 3.X documentation for glCompressedTexImage2D() .

PySide6.QtGui.QOpenGLFunctions.glCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data)#
Parameters:
  • target – int

  • level – int

  • xoffset – int

  • yoffset – int

  • width – int

  • height – int

  • format – int

  • imageSize – int

  • datavoid

Convenience function that calls glCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data).

For more information, see the OpenGL ES 3.X documentation for glCompressedTexSubImage2D() .

PySide6.QtGui.QOpenGLFunctions.glCopyTexImage2D(target, level, internalformat, x, y, width, height, border)#
Parameters:
  • target – int

  • level – int

  • internalformat – int

  • x – int

  • y – int

  • width – int

  • height – int

  • border – int

Convenience function that calls glCopyTexImage2D(target, level, internalformat, x, y, width, height, border).

For more information, see the OpenGL ES 3.X documentation for glCopyTexImage2D() .

PySide6.QtGui.QOpenGLFunctions.glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height)#
Parameters:
  • target – int

  • level – int

  • xoffset – int

  • yoffset – int

  • x – int

  • y – int

  • width – int

  • height – int

Convenience function that calls glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height).

For more information, see the OpenGL ES 3.X documentation for glCopyTexSubImage2D() .

PySide6.QtGui.QOpenGLFunctions.glCreateProgram()#
Return type:

int

Convenience function that calls glCreateProgram().

For more information, see the OpenGL ES 3.X documentation for glCreateProgram() .

This convenience function will do nothing on OpenGL ES 1.x systems.

PySide6.QtGui.QOpenGLFunctions.glCreateShader(type)#
Parameters:

type – int

Return type:

int

Convenience function that calls glCreateShader(type).

For more information, see the OpenGL ES 3.X documentation for glCreateShader() .

This convenience function will do nothing on OpenGL ES 1.x systems.

PySide6.QtGui.QOpenGLFunctions.glCullFace(mode)#
Parameters:

mode – int

Convenience function that calls glCullFace(mode).

For more information, see the OpenGL ES 3.X documentation for glCullFace() .

PySide6.QtGui.QOpenGLFunctions.glDeleteBuffers(n, buffers)#
Parameters:
  • n – int

  • buffersunsigned int

Convenience function that calls glDeleteBuffers(n, buffers).

For more information, see the OpenGL ES 3.X documentation for glDeleteBuffers() .

PySide6.QtGui.QOpenGLFunctions.glDeleteFramebuffers(n, framebuffers)#
Parameters:
  • n – int

  • framebuffersunsigned int

Convenience function that calls glDeleteFramebuffers(n, framebuffers).

For more information, see the OpenGL ES 3.X documentation for glDeleteFramebuffers() .

PySide6.QtGui.QOpenGLFunctions.glDeleteProgram(program)#
Parameters:

program – int

Convenience function that calls glDeleteProgram(program).

For more information, see the OpenGL ES 3.X documentation for glDeleteProgram() .

This convenience function will do nothing on OpenGL ES 1.x systems.

PySide6.QtGui.QOpenGLFunctions.glDeleteRenderbuffers(n, renderbuffers)#
Parameters:
  • n – int

  • renderbuffersunsigned int

Convenience function that calls glDeleteRenderbuffers(n, renderbuffers).

For more information, see the OpenGL ES 3.X documentation for glDeleteRenderbuffers() .

PySide6.QtGui.QOpenGLFunctions.glDeleteShader(shader)#
Parameters:

shader – int

Convenience function that calls glDeleteShader(shader).

For more information, see the OpenGL ES 3.X documentation for glDeleteShader() .

This convenience function will do nothing on OpenGL ES 1.x systems.

PySide6.QtGui.QOpenGLFunctions.glDeleteTextures(n, textures)#
Parameters:
  • n – int

  • texturesunsigned int

Convenience function that calls glDeleteTextures(n, textures).

For more information, see the OpenGL ES 3.X documentation for glDeleteTextures() .

PySide6.QtGui.QOpenGLFunctions.glDepthFunc(func)#
Parameters:

func – int

Convenience function that calls glDepthFunc(func).

For more information, see the OpenGL ES 3.X documentation for glDepthFunc() .

PySide6.QtGui.QOpenGLFunctions.glDepthMask(flag)#
Parameters:

flag – int

Convenience function that calls glDepthMask(flag).

For more information, see the OpenGL ES 3.X documentation for glDepthMask() .

PySide6.QtGui.QOpenGLFunctions.glDepthRangef(zNear, zFar)#
Parameters:
  • zNear – float

  • zFar – float

Convenience function that calls glDepthRange(zNear, zFar) on desktop OpenGL systems and glDepthRangef(zNear, zFar) on embedded OpenGL ES systems.

For more information, see the OpenGL ES 3.X documentation for glDepthRangef() .

PySide6.QtGui.QOpenGLFunctions.glDetachShader(program, shader)#
Parameters:
  • program – int

  • shader – int

Convenience function that calls glDetachShader(program, shader).

For more information, see the OpenGL ES 3.X documentation for glDetachShader() .

This convenience function will do nothing on OpenGL ES 1.x systems.

PySide6.QtGui.QOpenGLFunctions.glDisable(cap)#
Parameters:

cap – int

Convenience function that calls glDisable(cap).

For more information, see the OpenGL ES 3.X documentation for glDisable() .

PySide6.QtGui.QOpenGLFunctions.glDisableVertexAttribArray(index)#
Parameters:

index – int

Convenience function that calls glDisableVertexAttribArray(index).

For more information, see the OpenGL ES 3.X documentation for glDisableVertexAttribArray() .

This convenience function will do nothing on OpenGL ES 1.x systems.

PySide6.QtGui.QOpenGLFunctions.glDrawArrays(mode, first, count)#
Parameters:
  • mode – int

  • first – int

  • count – int

Convenience function that calls glDrawArrays(mode, first, count).

For more information, see the OpenGL ES 3.X documentation for glDrawArrays() .

PySide6.QtGui.QOpenGLFunctions.glDrawElements(mode, count, type, indices)#
Parameters:
  • mode – int

  • count – int

  • type – int

  • indicesvoid

Convenience function that calls glDrawElements(mode, count, type, indices).

For more information, see the OpenGL ES 3.X documentation for glDrawElements() .

PySide6.QtGui.QOpenGLFunctions.glEnable(cap)#
Parameters:

cap – int

Convenience function that calls glEnable(cap).

For more information, see the OpenGL ES 3.X documentation for glEnable() .

PySide6.QtGui.QOpenGLFunctions.glEnableVertexAttribArray(index)#
Parameters:

index – int

Convenience function that calls glEnableVertexAttribArray(index).

For more information, see the OpenGL ES 3.X documentation for glEnableVertexAttribArray() .

This convenience function will do nothing on OpenGL ES 1.x systems.

PySide6.QtGui.QOpenGLFunctions.glFinish()#

Convenience function that calls glFinish().

For more information, see the OpenGL ES 3.X documentation for glFinish() .

PySide6.QtGui.QOpenGLFunctions.glFlush()#

Convenience function that calls glFlush().

For more information, see the OpenGL ES 3.X documentation for glFlush() .

PySide6.QtGui.QOpenGLFunctions.glFramebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer)#
Parameters:
  • target – int

  • attachment – int

  • renderbuffertarget – int

  • renderbuffer – int

Convenience function that calls glFramebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer).

For more information, see the OpenGL ES 3.X documentation for glFramebufferRenderbuffer() .

PySide6.QtGui.QOpenGLFunctions.glFramebufferTexture2D(target, attachment, textarget, texture, level)#
Parameters:
  • target – int

  • attachment – int

  • textarget – int

  • texture – int

  • level – int

Convenience function that calls glFramebufferTexture2D(target, attachment, textarget, texture, level).

For more information, see the OpenGL ES 3.X documentation for glFramebufferTexture2D() .

PySide6.QtGui.QOpenGLFunctions.glFrontFace(mode)#
Parameters:

mode – int

Convenience function that calls glFrontFace(mode).

For more information, see the OpenGL ES 3.X documentation for glFrontFace() .

PySide6.QtGui.QOpenGLFunctions.glGenBuffers(n, buffers)#
Parameters:
  • n – int

  • buffersunsigned int

Convenience function that calls glGenBuffers(n, buffers).

For more information, see the OpenGL ES 3.X documentation for glGenBuffers() .

PySide6.QtGui.QOpenGLFunctions.glGenFramebuffers(n, framebuffers)#
Parameters:
  • n – int

  • framebuffersunsigned int

Convenience function that calls glGenFramebuffers(n, framebuffers).

For more information, see the OpenGL ES 3.X documentation for glGenFramebuffers() .

PySide6.QtGui.QOpenGLFunctions.glGenRenderbuffers(n, renderbuffers)#
Parameters:
  • n – int

  • renderbuffersunsigned int

Convenience function that calls glGenRenderbuffers(n, renderbuffers).

For more information, see the OpenGL ES 3.X documentation for glGenRenderbuffers() .

PySide6.QtGui.QOpenGLFunctions.glGenTextures(n, textures)#
Parameters:
  • n – int

  • texturesunsigned int

Convenience function that calls glGenTextures(n, textures).

For more information, see the OpenGL ES 3.X documentation for glGenTextures() .

PySide6.QtGui.QOpenGLFunctions.glGenerateMipmap(target)#
Parameters:

target – int

Convenience function that calls glGenerateMipmap(target).

For more information, see the OpenGL ES 3.X documentation for glGenerateMipmap() .

PySide6.QtGui.QOpenGLFunctions.glGetAttachedShaders(program, maxcount, count, shaders)#
Parameters:
  • program – int

  • maxcount – int

  • count – int

  • shadersunsigned int

Convenience function that calls glGetAttachedShaders(program, maxcount, count, shaders).

For more information, see the OpenGL ES 3.X documentation for glGetAttachedShaders() .

This convenience function will do nothing on OpenGL ES 1.x systems.

PySide6.QtGui.QOpenGLFunctions.glGetAttribLocation(program, name)#
Parameters:
  • program – int

  • name – str

Return type:

int

Convenience function that calls glGetAttribLocation(program, name).

For more information, see the OpenGL ES 3.X documentation for glGetAttribLocation() .

This convenience function will do nothing on OpenGL ES 1.x systems.

PySide6.QtGui.QOpenGLFunctions.glGetBooleanv(pname)#
Parameters:

pname – int

Return type:

PyObject

Convenience function that calls glGetBooleanv(pname, params).

For more information, see the OpenGL ES 3.X documentation for glGetBooleanv() .

PySide6.QtGui.QOpenGLFunctions.glGetBufferParameteriv(target, pname, params)#
Parameters:
  • target – int

  • pname – int

  • params – int

Convenience function that calls glGetBufferParameteriv(target, pname, params).

For more information, see the OpenGL ES 3.X documentation for glGetBufferParameteriv() .

PySide6.QtGui.QOpenGLFunctions.glGetError()#
Return type:

int

Convenience function that calls glGetError().

For more information, see the OpenGL ES 3.X documentation for glGetError() .

PySide6.QtGui.QOpenGLFunctions.glGetFloatv(arg__1)#
Parameters:

arg__1 – int

Return type:

object

PySide6.QtGui.QOpenGLFunctions.glGetFloatv(pname, params)
Parameters:
  • pname – int

  • params – float

Convenience function that calls glGetFloatv(pname, params).

For more information, see the OpenGL ES 3.X documentation for glGetFloatv() .

PySide6.QtGui.QOpenGLFunctions.glGetFramebufferAttachmentParameteriv(target, attachment, pname, params)#
Parameters:
  • target – int

  • attachment – int

  • pname – int

  • params – int

Convenience function that calls glGetFramebufferAttachmentParameteriv(target, attachment, pname, params).

For more information, see the OpenGL ES 3.X documentation for glGetFramebufferAttachmentParameteriv() .

PySide6.QtGui.QOpenGLFunctions.glGetIntegerv(arg__1)#
Parameters:

arg__1 – int

Return type:

object

PySide6.QtGui.QOpenGLFunctions.glGetIntegerv(pname, params)
Parameters:
  • pname – int

  • params – int

Convenience function that calls glGetIntegerv(pname, params).

For more information, see the OpenGL ES 3.X documentation for glGetIntegerv() .

PySide6.QtGui.QOpenGLFunctions.glGetProgramiv(program, pname, params)#
Parameters:
  • program – int

  • pname – int

  • params – int

Convenience function that calls glGetProgramiv(program, pname, params).

For more information, see the OpenGL ES 3.X documentation for glGetProgramiv() .

This convenience function will do nothing on OpenGL ES 1.x systems.

PySide6.QtGui.QOpenGLFunctions.glGetRenderbufferParameteriv(target, pname, params)#
Parameters:
  • target – int

  • pname – int

  • params – int

Convenience function that calls glGetRenderbufferParameteriv(target, pname, params).

For more information, see the OpenGL ES 3.X documentation for glGetRenderbufferParameteriv() .

PySide6.QtGui.QOpenGLFunctions.glGetShaderPrecisionFormat(shadertype, precisiontype, range, precision)#
Parameters:
  • shadertype – int

  • precisiontype – int

  • range – int

  • precision – int

Convenience function that calls glGetShaderPrecisionFormat(shadertype, precisiontype, range, precision).

For more information, see the OpenGL ES 3.X documentation for glGetShaderPrecisionFormat() .

This convenience function will do nothing on OpenGL ES 1.x systems.

PySide6.QtGui.QOpenGLFunctions.glGetShaderSource(shader)#
Parameters:

shader – int

Return type:

str

PySide6.QtGui.QOpenGLFunctions.glGetShaderiv(shader, pname, params)#
Parameters:
  • shader – int

  • pname – int

  • params – int

Convenience function that calls glGetShaderiv(shader, pname, params).

For more information, see the OpenGL ES 3.X documentation for glGetShaderiv() .

This convenience function will do nothing on OpenGL ES 1.x systems.

PySide6.QtGui.QOpenGLFunctions.glGetString(name)#
Parameters:

name – int

Return type:

QString

Convenience function that calls glGetString(name).

For more information, see the OpenGL ES 3.X documentation for glGetString() .

PySide6.QtGui.QOpenGLFunctions.glGetTexParameterfv(target, pname, params)#
Parameters:
  • target – int

  • pname – int

  • params – float

Convenience function that calls glGetTexParameterfv(target, pname, params).

For more information, see the OpenGL ES 3.X documentation for glGetTexParameterfv() .

PySide6.QtGui.QOpenGLFunctions.glGetTexParameteriv(target, pname, params)#
Parameters:
  • target – int

  • pname – int

  • params – int

Convenience function that calls glGetTexParameteriv(target, pname, params).

For more information, see the OpenGL ES 3.X documentation for glGetTexParameteriv() .

PySide6.QtGui.QOpenGLFunctions.glGetUniformLocation(program, name)#
Parameters:
  • program – int

  • name – str

Return type:

int

Convenience function that calls glGetUniformLocation(program, name).

For more information, see the OpenGL ES 3.X documentation for glGetUniformLocation() .

This convenience function will do nothing on OpenGL ES 1.x systems.

PySide6.QtGui.QOpenGLFunctions.glGetUniformfv(program, location, params)#
Parameters:
  • program – int

  • location – int

  • params – float

Convenience function that calls glGetUniformfv(program, location, params).

For more information, see the OpenGL ES 3.X documentation for glGetUniformfv() .

This convenience function will do nothing on OpenGL ES 1.x systems.

PySide6.QtGui.QOpenGLFunctions.glGetUniformiv(program, location, params)#
Parameters:
  • program – int

  • location – int

  • params – int

Convenience function that calls glGetUniformiv(program, location, params).

For more information, see the OpenGL ES 3.X documentation for glGetUniformiv() .

This convenience function will do nothing on OpenGL ES 1.x systems.

PySide6.QtGui.QOpenGLFunctions.glGetVertexAttribfv(index, pname, params)#
Parameters:
  • index – int

  • pname – int

  • params – float

Convenience function that calls glGetVertexAttribfv(index, pname, params).

For more information, see the OpenGL ES 3.X documentation for glGetVertexAttribfv() .

This convenience function will do nothing on OpenGL ES 1.x systems.

PySide6.QtGui.QOpenGLFunctions.glGetVertexAttribiv(index, pname, params)#
Parameters:
  • index – int

  • pname – int

  • params – int

Convenience function that calls glGetVertexAttribiv(index, pname, params).

For more information, see the OpenGL ES 3.X documentation for glGetVertexAttribiv() .

This convenience function will do nothing on OpenGL ES 1.x systems.

PySide6.QtGui.QOpenGLFunctions.glHint(target, mode)#
Parameters:
  • target – int

  • mode – int

Convenience function that calls glHint(target, mode).

For more information, see the OpenGL ES 3.X documentation for glHint() .

PySide6.QtGui.QOpenGLFunctions.glIsBuffer(buffer)#
Parameters:

buffer – int

Return type:

int

Convenience function that calls glIsBuffer(buffer).

For more information, see the OpenGL ES 3.X documentation for glIsBuffer() .

PySide6.QtGui.QOpenGLFunctions.glIsEnabled(cap)#
Parameters:

cap – int

Return type:

int

Convenience function that calls glIsEnabled(cap).

For more information, see the OpenGL ES 3.X documentation for glIsEnabled() .

PySide6.QtGui.QOpenGLFunctions.glIsFramebuffer(framebuffer)#
Parameters:

framebuffer – int

Return type:

int

Convenience function that calls glIsFramebuffer(framebuffer).

For more information, see the OpenGL ES 3.X documentation for glIsFramebuffer() .

PySide6.QtGui.QOpenGLFunctions.glIsProgram(program)#
Parameters:

program – int

Return type:

int

Convenience function that calls glIsProgram(program).

For more information, see the OpenGL ES 3.X documentation for glIsProgram() .

This convenience function will do nothing on OpenGL ES 1.x systems.

PySide6.QtGui.QOpenGLFunctions.glIsRenderbuffer(renderbuffer)#
Parameters:

renderbuffer – int

Return type:

int

Convenience function that calls glIsRenderbuffer(renderbuffer).

For more information, see the OpenGL ES 3.X documentation for glIsRenderbuffer() .

PySide6.QtGui.QOpenGLFunctions.glIsShader(shader)#
Parameters:

shader – int

Return type:

int

Convenience function that calls glIsShader(shader).

For more information, see the OpenGL ES 3.X documentation for glIsShader() .

This convenience function will do nothing on OpenGL ES 1.x systems.

PySide6.QtGui.QOpenGLFunctions.glIsTexture(texture)#
Parameters:

texture – int

Return type:

int

Convenience function that calls glIsTexture(texture).

For more information, see the OpenGL ES 3.X documentation for glIsTexture() .

PySide6.QtGui.QOpenGLFunctions.glLineWidth(width)#
Parameters:

width – float

Convenience function that calls glLineWidth(width).

For more information, see the OpenGL ES 3.X documentation for glLineWidth() .

PySide6.QtGui.QOpenGLFunctions.glLinkProgram(program)#
Parameters:

program – int

Convenience function that calls glLinkProgram(program).

For more information, see the OpenGL ES 3.X documentation for glLinkProgram() .

This convenience function will do nothing on OpenGL ES 1.x systems.

PySide6.QtGui.QOpenGLFunctions.glPixelStorei(pname, param)#
Parameters:
  • pname – int

  • param – int

Convenience function that calls glPixelStorei(pname, param).

For more information, see the OpenGL ES 3.X documentation for glPixelStorei() .

PySide6.QtGui.QOpenGLFunctions.glPolygonOffset(factor, units)#
Parameters:
  • factor – float

  • units – float

Convenience function that calls glPolygonOffset(factor, units).

For more information, see the OpenGL ES 3.X documentation for glPolygonOffset() .

PySide6.QtGui.QOpenGLFunctions.glReadPixels(x, y, width, height, format, type, pixels)#
Parameters:
  • x – int

  • y – int

  • width – int

  • height – int

  • format – int

  • type – int

  • pixelsvoid

Convenience function that calls glReadPixels(x, y, width, height, format, type, pixels).

For more information, see the OpenGL ES 3.X documentation for glReadPixels() .

PySide6.QtGui.QOpenGLFunctions.glReleaseShaderCompiler()#

Convenience function that calls glReleaseShaderCompiler().

For more information, see the OpenGL ES 3.X documentation for glReleaseShaderCompiler() .

This convenience function will do nothing on OpenGL ES 1.x systems.

PySide6.QtGui.QOpenGLFunctions.glRenderbufferStorage(target, internalformat, width, height)#
Parameters:
  • target – int

  • internalformat – int

  • width – int

  • height – int

Convenience function that calls glRenderbufferStorage(target, internalformat, width, height).

For more information, see the OpenGL ES 3.X documentation for glRenderbufferStorage() .

PySide6.QtGui.QOpenGLFunctions.glSampleCoverage(value, invert)#
Parameters:
  • value – float

  • invert – int

Convenience function that calls glSampleCoverage(value, invert).

For more information, see the OpenGL ES 3.X documentation for glSampleCoverage() .

PySide6.QtGui.QOpenGLFunctions.glScissor(x, y, width, height)#
Parameters:
  • x – int

  • y – int

  • width – int

  • height – int

Convenience function that calls glScissor(x, y, width, height).

For more information, see the OpenGL ES 3.X documentation for glScissor() .

PySide6.QtGui.QOpenGLFunctions.glShaderBinary(n, shaders, binaryformat, binary, length)#
Parameters:
  • n – int

  • shadersunsigned int

  • binaryformat – int

  • binaryvoid

  • length – int

Convenience function that calls glShaderBinary(n, shaders, binaryformat, binary, length).

For more information, see the OpenGL ES 3.X documentation for glShaderBinary() .

This convenience function will do nothing on OpenGL ES 1.x systems.

PySide6.QtGui.QOpenGLFunctions.glShaderSource(shader, source)#
Parameters:
  • shader – int

  • source – str

PySide6.QtGui.QOpenGLFunctions.glStencilFunc(func, ref, mask)#
Parameters:
  • func – int

  • ref – int

  • mask – int

Convenience function that calls glStencilFunc(func, ref, mask).

For more information, see the OpenGL ES 3.X documentation for glStencilFunc() .

PySide6.QtGui.QOpenGLFunctions.glStencilFuncSeparate(face, func, ref, mask)#
Parameters:
  • face – int

  • func – int

  • ref – int

  • mask – int

Convenience function that calls glStencilFuncSeparate(face, func, ref, mask).

For more information, see the OpenGL ES 3.X documentation for glStencilFuncSeparate() .

PySide6.QtGui.QOpenGLFunctions.glStencilMask(mask)#
Parameters:

mask – int

Convenience function that calls glStencilMask(mask).

For more information, see the OpenGL ES 3.X documentation for glStencilMask() .

PySide6.QtGui.QOpenGLFunctions.glStencilMaskSeparate(face, mask)#
Parameters:
  • face – int

  • mask – int

Convenience function that calls glStencilMaskSeparate(face, mask).

For more information, see the OpenGL ES 3.X documentation for glStencilMaskSeparate() .

PySide6.QtGui.QOpenGLFunctions.glStencilOp(fail, zfail, zpass)#
Parameters:
  • fail – int

  • zfail – int

  • zpass – int

Convenience function that calls glStencilOp(fail, zfail, zpass).

For more information, see the OpenGL ES 3.X documentation for glStencilOp() .

PySide6.QtGui.QOpenGLFunctions.glStencilOpSeparate(face, fail, zfail, zpass)#
Parameters:
  • face – int

  • fail – int

  • zfail – int

  • zpass – int

Convenience function that calls glStencilOpSeparate(face, fail, zfail, zpass).

For more information, see the OpenGL ES 3.X documentation for glStencilOpSeparate() .

PySide6.QtGui.QOpenGLFunctions.glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels)#
Parameters:
  • target – int

  • level – int

  • internalformat – int

  • width – int

  • height – int

  • border – int

  • format – int

  • type – int

  • pixelsvoid

Convenience function that calls glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels).

For more information, see the OpenGL ES 3.X documentation for glTexImage2D() .

PySide6.QtGui.QOpenGLFunctions.glTexParameterf(target, pname, param)#
Parameters:
  • target – int

  • pname – int

  • param – float

Convenience function that calls glTexParameterf(target, pname, param).

For more information, see the OpenGL ES 3.X documentation for glTexParameterf() .

PySide6.QtGui.QOpenGLFunctions.glTexParameterfv(target, pname, params)#
Parameters:
  • target – int

  • pname – int

  • params – float

Convenience function that calls glTexParameterfv(target, pname, params).

For more information, see the OpenGL ES 3.X documentation for glTexParameterfv() .

PySide6.QtGui.QOpenGLFunctions.glTexParameteri(target, pname, param)#
Parameters:
  • target – int

  • pname – int

  • param – int

Convenience function that calls glTexParameteri(target, pname, param).

For more information, see the OpenGL ES 3.X documentation for glTexParameteri() .

PySide6.QtGui.QOpenGLFunctions.glTexParameteriv(target, pname, params)#
Parameters:
  • target – int

  • pname – int

  • params – int

Convenience function that calls glTexParameteriv(target, pname, params).

For more information, see the OpenGL ES 3.X documentation for glTexParameteriv() .

PySide6.QtGui.QOpenGLFunctions.glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels)#
Parameters:
  • target – int

  • level – int

  • xoffset – int

  • yoffset – int

  • width – int

  • height – int

  • format – int

  • type – int

  • pixelsvoid

Convenience function that calls glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels).

For more information, see the OpenGL ES 3.X documentation for glTexSubImage2D() .

PySide6.QtGui.QOpenGLFunctions.glUniform1f(location, x)#
Parameters:
  • location – int

  • x – float

Convenience function that calls glUniform1f(location, x).

For more information, see the OpenGL ES 3.X documentation for glUniform1f() .

This convenience function will do nothing on OpenGL ES 1.x systems.

PySide6.QtGui.QOpenGLFunctions.glUniform1fv(location, count, v)#
Parameters:
  • location – int

  • count – int

  • v – float

Convenience function that calls glUniform1fv(location, count, v).

For more information, see the OpenGL ES 3.X documentation for glUniform1fv() .

This convenience function will do nothing on OpenGL ES 1.x systems.

PySide6.QtGui.QOpenGLFunctions.glUniform1i(location, x)#
Parameters:
  • location – int

  • x – int

Convenience function that calls glUniform1i(location, x).

For more information, see the OpenGL ES 3.X documentation for glUniform1i() .

This convenience function will do nothing on OpenGL ES 1.x systems.

PySide6.QtGui.QOpenGLFunctions.glUniform1iv(location, count, v)#
Parameters:
  • location – int

  • count – int

  • v – int

Convenience function that calls glUniform1iv(location, count, v).

For more information, see the OpenGL ES 3.X documentation for glUniform1iv() .

This convenience function will do nothing on OpenGL ES 1.x systems.

PySide6.QtGui.QOpenGLFunctions.glUniform2f(location, x, y)#
Parameters:
  • location – int

  • x – float

  • y – float

Convenience function that calls glUniform2f(location, x, y).

For more information, see the OpenGL ES 3.X documentation for glUniform2f() .

This convenience function will do nothing on OpenGL ES 1.x systems.

PySide6.QtGui.QOpenGLFunctions.glUniform2fv(location, count, v)#
Parameters:
  • location – int

  • count – int

  • v – float

Convenience function that calls glUniform2fv(location, count, v).

For more information, see the OpenGL ES 3.X documentation for glUniform2fv() .

This convenience function will do nothing on OpenGL ES 1.x systems.

PySide6.QtGui.QOpenGLFunctions.glUniform2i(location, x, y)#
Parameters:
  • location – int

  • x – int

  • y – int

Convenience function that calls glUniform2i(location, x, y).

For more information, see the OpenGL ES 3.X documentation for glUniform2i() .

This convenience function will do nothing on OpenGL ES 1.x systems.

PySide6.QtGui.QOpenGLFunctions.glUniform2iv(location, count, v)#
Parameters:
  • location – int

  • count – int

  • v – int

Convenience function that calls glUniform2iv(location, count, v).

For more information, see the OpenGL ES 3.X documentation for glUniform2iv() .

This convenience function will do nothing on OpenGL ES 1.x systems.

PySide6.QtGui.QOpenGLFunctions.glUniform3f(location, x, y, z)#
Parameters:
  • location – int

  • x – float

  • y – float

  • z – float

Convenience function that calls glUniform3f(location, x, y, z).

For more information, see the OpenGL ES 3.X documentation for glUniform3f() .

This convenience function will do nothing on OpenGL ES 1.x systems.

PySide6.QtGui.QOpenGLFunctions.glUniform3fv(location, count, v)#
Parameters:
  • location – int

  • count – int

  • v – float

Convenience function that calls glUniform3fv(location, count, v).

For more information, see the OpenGL ES 3.X documentation for glUniform3fv() .

This convenience function will do nothing on OpenGL ES 1.x systems.

PySide6.QtGui.QOpenGLFunctions.glUniform3i(location, x, y, z)#
Parameters:
  • location – int

  • x – int

  • y – int

  • z – int

Convenience function that calls glUniform3i(location, x, y, z).

For more information, see the OpenGL ES 3.X documentation for glUniform3i() .

This convenience function will do nothing on OpenGL ES 1.x systems.

PySide6.QtGui.QOpenGLFunctions.glUniform3iv(location, count, v)#
Parameters:
  • location – int

  • count – int

  • v – int

Convenience function that calls glUniform3iv(location, count, v).

For more information, see the OpenGL ES 3.X documentation for glUniform3iv() .

This convenience function will do nothing on OpenGL ES 1.x systems.

PySide6.QtGui.QOpenGLFunctions.glUniform4f(location, x, y, z, w)#
Parameters:
  • location – int

  • x – float

  • y – float

  • z – float

  • w – float

Convenience function that calls glUniform4f(location, x, y, z, w).

For more information, see the OpenGL ES 3.X documentation for glUniform4f() .

This convenience function will do nothing on OpenGL ES 1.x systems.

PySide6.QtGui.QOpenGLFunctions.glUniform4fv(location, count, v)#
Parameters:
  • location – int

  • count – int

  • v – float

Convenience function that calls glUniform4fv(location, count, v).

For more information, see the OpenGL ES 3.X documentation for glUniform4fv() .

This convenience function will do nothing on OpenGL ES 1.x systems.

PySide6.QtGui.QOpenGLFunctions.glUniform4i(location, x, y, z, w)#
Parameters:
  • location – int

  • x – int

  • y – int

  • z – int

  • w – int

Convenience function that calls glUniform4i(location, x, y, z, w).

For more information, see the OpenGL ES 3.X documentation for glUniform4i() .

This convenience function will do nothing on OpenGL ES 1.x systems.

PySide6.QtGui.QOpenGLFunctions.glUniform4iv(location, count, v)#
Parameters:
  • location – int

  • count – int

  • v – int

Convenience function that calls glUniform4iv(location, count, v).

For more information, see the OpenGL ES 3.X documentation for glUniform4iv() .

This convenience function will do nothing on OpenGL ES 1.x systems.

PySide6.QtGui.QOpenGLFunctions.glUniformMatrix2fv(location, count, transpose, value)#
Parameters:
  • location – int

  • count – int

  • transpose – int

  • value – float

Convenience function that calls glUniformMatrix2fv(location, count, transpose, value).

For more information, see the OpenGL ES 3.X documentation for glUniformMatrix2fv() .

This convenience function will do nothing on OpenGL ES 1.x systems.

PySide6.QtGui.QOpenGLFunctions.glUniformMatrix3fv(location, count, transpose, value)#
Parameters:
  • location – int

  • count – int

  • transpose – int

  • value – float

Convenience function that calls glUniformMatrix3fv(location, count, transpose, value).

For more information, see the OpenGL ES 3.X documentation for glUniformMatrix3fv() .

This convenience function will do nothing on OpenGL ES 1.x systems.

PySide6.QtGui.QOpenGLFunctions.glUniformMatrix4fv(location, count, transpose, value)#
Parameters:
  • location – int

  • count – int

  • transpose – int

  • value – float

Convenience function that calls glUniformMatrix4fv(location, count, transpose, value).

For more information, see the OpenGL ES 3.X documentation for glUniformMatrix4fv() .

This convenience function will do nothing on OpenGL ES 1.x systems.

PySide6.QtGui.QOpenGLFunctions.glUseProgram(program)#
Parameters:

program – int

Convenience function that calls glUseProgram(program).

For more information, see the OpenGL ES 3.X documentation for glUseProgram() .

This convenience function will do nothing on OpenGL ES 1.x systems.

PySide6.QtGui.QOpenGLFunctions.glValidateProgram(program)#
Parameters:

program – int

Convenience function that calls glValidateProgram(program).

For more information, see the OpenGL ES 3.X documentation for glValidateProgram() .

This convenience function will do nothing on OpenGL ES 1.x systems.

PySide6.QtGui.QOpenGLFunctions.glVertexAttrib1f(indx, x)#
Parameters:
  • indx – int

  • x – float

Convenience function that calls glVertexAttrib1f(indx, x).

For more information, see the OpenGL ES 3.X documentation for glVertexAttrib1f() .

This convenience function will do nothing on OpenGL ES 1.x systems.

PySide6.QtGui.QOpenGLFunctions.glVertexAttrib1fv(indx, values)#
Parameters:
  • indx – int

  • values – float

Convenience function that calls glVertexAttrib1fv(indx, values).

For more information, see the OpenGL ES 3.X documentation for glVertexAttrib1fv() .

This convenience function will do nothing on OpenGL ES 1.x systems.

PySide6.QtGui.QOpenGLFunctions.glVertexAttrib2f(indx, x, y)#
Parameters:
  • indx – int

  • x – float

  • y – float

Convenience function that calls glVertexAttrib2f(indx, x, y).

For more information, see the OpenGL ES 3.X documentation for glVertexAttrib2f() .

This convenience function will do nothing on OpenGL ES 1.x systems.

PySide6.QtGui.QOpenGLFunctions.glVertexAttrib2fv(indx, values)#
Parameters:
  • indx – int

  • values – float

Convenience function that calls glVertexAttrib2fv(indx, values).

For more information, see the OpenGL ES 3.X documentation for glVertexAttrib2fv() .

This convenience function will do nothing on OpenGL ES 1.x systems.

PySide6.QtGui.QOpenGLFunctions.glVertexAttrib3f(indx, x, y, z)#
Parameters:
  • indx – int

  • x – float

  • y – float

  • z – float

Convenience function that calls glVertexAttrib3f(indx, x, y, z).

For more information, see the OpenGL ES 3.X documentation for glVertexAttrib3f() .

This convenience function will do nothing on OpenGL ES 1.x systems.

PySide6.QtGui.QOpenGLFunctions.glVertexAttrib3fv(indx, values)#
Parameters:
  • indx – int

  • values – float

Convenience function that calls glVertexAttrib3fv(indx, values).

For more information, see the OpenGL ES 3.X documentation for glVertexAttrib3fv() .

This convenience function will do nothing on OpenGL ES 1.x systems.

PySide6.QtGui.QOpenGLFunctions.glVertexAttrib4f(indx, x, y, z, w)#
Parameters:
  • indx – int

  • x – float

  • y – float

  • z – float

  • w – float

Convenience function that calls glVertexAttrib4f(indx, x, y, z, w).

For more information, see the OpenGL ES 3.X documentation for glVertexAttrib4f() .

This convenience function will do nothing on OpenGL ES 1.x systems.

PySide6.QtGui.QOpenGLFunctions.glVertexAttrib4fv(indx, values)#
Parameters:
  • indx – int

  • values – float

Convenience function that calls glVertexAttrib4fv(indx, values).

For more information, see the OpenGL ES 3.X documentation for glVertexAttrib4fv() .

This convenience function will do nothing on OpenGL ES 1.x systems.

PySide6.QtGui.QOpenGLFunctions.glVertexAttribPointer(indx, size, type, normalized, stride, ptr)#
Parameters:
  • indx – int

  • size – int

  • type – int

  • normalized – int

  • stride – int

  • ptrvoid

Convenience function that calls glVertexAttribPointer(indx, size, type, normalized, stride, ptr).

For more information, see the OpenGL ES 3.X documentation for glVertexAttribPointer() .

This convenience function will do nothing on OpenGL ES 1.x systems.

PySide6.QtGui.QOpenGLFunctions.glViewport(x, y, width, height)#
Parameters:
  • x – int

  • y – int

  • width – int

  • height – int

Convenience function that calls glViewport(x, y, width, height).

For more information, see the OpenGL ES 3.X documentation for glViewport() .

PySide6.QtGui.QOpenGLFunctions.hasOpenGLFeature(feature)#
Parameters:

featureOpenGLFeature

Return type:

bool

Returns true if feature is present on this system’s OpenGL implementation; false otherwise.

It is assumed that the QOpenGLContext associated with this function resolver is current.

See also

openGLFeatures()

PySide6.QtGui.QOpenGLFunctions.initializeOpenGLFunctions()#

Initializes OpenGL function resolution for the current context.

After calling this function, the QOpenGLFunctions object can only be used with the current context and other contexts that share with it. Call initializeOpenGLFunctions() again to change the object’s context association.

PySide6.QtGui.QOpenGLFunctions.openGLFeatures()#
Return type:

Combination of QOpenGLFunctions.OpenGLFeature

Returns the set of features that are present on this system’s OpenGL implementation.

It is assumed that the QOpenGLContext associated with this function resolver is current.