QOpenGLFunctions

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

Inheritance diagram of PySide2.QtGui.QOpenGLFunctions

Inherited by: QOpenGLExtraFunctions

New in version 5.0.

Synopsis

Functions

Detailed Description

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 : public QWindow, protected QOpenGLFunctions
{
    Q_OBJECT
public:
    explicit MyGLWindow(QScreen *screen = nullptr);

protected:
    void initializeGL();
    void paintGL();

    QOpenGLContext *m_context;
};

MyGLWindow(QScreen *screen)
  : QWindow(screen), QOpenGLWidget(parent)
{
    setSurfaceType(OpenGLSurface);
    create();

    // Create an OpenGL context
    m_context = new QOpenGLContext;
    m_context->create();

    // Setup scene and render it
    initializeGL();
    paintGL();
}

void MyGLWindow::initializeGL()
{
    m_context->makeCurrent(this);
    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:

void MyGLWindow::paintGL()
{
    m_context->makeCurrent(this);
    glActiveTexture(GL_TEXTURE1);
    glBindTexture(GL_TEXTURE_2D, textureId);
    ...
    m_context->swapBuffers(this);
    m_context->doneCurrent();
}

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

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

QOpenGLFunctions *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:

QOpenGLFunctions funcs(QOpenGLContext::currentContext());
bool npot = funcs.hasOpenGLFeature(QOpenGLFunctions::NPOTTextures);
class PySide2.QtGui.QOpenGLFunctions

PySide2.QtGui.QOpenGLFunctions(context)

param context:

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

PySide2.QtGui.QOpenGLFunctions.OpenGLFeature

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.

PySide2.QtGui.QOpenGLFunctions.glActiveTexture(texture)
Parameters:

textureGLenum

Convenience function that calls (texture ).

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

PySide2.QtGui.QOpenGLFunctions.glAttachShader(program, shader)
Parameters:
  • programGLuint

  • shaderGLuint

Convenience function that calls (program , shader ).

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

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

PySide2.QtGui.QOpenGLFunctions.glBindAttribLocation(program, index, name)
Parameters:
  • programGLuint

  • indexGLuint

  • name – str

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

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

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

PySide2.QtGui.QOpenGLFunctions.glBindBuffer(target, buffer)
Parameters:
  • targetGLenum

  • bufferGLuint

Convenience function that calls (target , buffer ).

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

PySide2.QtGui.QOpenGLFunctions.glBindFramebuffer(target, framebuffer)
Parameters:
  • targetGLenum

  • framebufferGLuint

Convenience function that calls (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 2.0 documentation for glBindFramebuffer() .

PySide2.QtGui.QOpenGLFunctions.glBindRenderbuffer(target, renderbuffer)
Parameters:
  • targetGLenum

  • renderbufferGLuint

Convenience function that calls (target , renderbuffer ).

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

PySide2.QtGui.QOpenGLFunctions.glBindTexture(target, texture)
Parameters:
  • targetGLenum

  • textureGLuint

Convenience function that calls (target , texture ).

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

PySide2.QtGui.QOpenGLFunctions.glBlendColor(red, green, blue, alpha)
Parameters:
  • redGLclampf

  • greenGLclampf

  • blueGLclampf

  • alphaGLclampf

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

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

PySide2.QtGui.QOpenGLFunctions.glBlendEquation(mode)
Parameters:

modeGLenum

Convenience function that calls (mode ).

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

PySide2.QtGui.QOpenGLFunctions.glBlendEquationSeparate(modeRGB, modeAlpha)
Parameters:
  • modeRGBGLenum

  • modeAlphaGLenum

Convenience function that calls (modeRGB , modeAlpha ).

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

PySide2.QtGui.QOpenGLFunctions.glBlendFunc(sfactor, dfactor)
Parameters:
  • sfactorGLenum

  • dfactorGLenum

Convenience function that calls (sfactor , dfactor ).

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

PySide2.QtGui.QOpenGLFunctions.glBlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha)
Parameters:
  • srcRGBGLenum

  • dstRGBGLenum

  • srcAlphaGLenum

  • dstAlphaGLenum

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

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

PySide2.QtGui.QOpenGLFunctions.glCheckFramebufferStatus(target)
Parameters:

targetGLenum

Return type:

GLenum

Convenience function that calls (target ).

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

PySide2.QtGui.QOpenGLFunctions.glClear(mask)
Parameters:

maskGLbitfield

Convenience function that calls (mask ).

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

PySide2.QtGui.QOpenGLFunctions.glClearColor(red, green, blue, alpha)
Parameters:
  • redGLclampf

  • greenGLclampf

  • blueGLclampf

  • alphaGLclampf

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

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

PySide2.QtGui.QOpenGLFunctions.glClearDepthf(depth)
Parameters:

depthGLclampf

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

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

PySide2.QtGui.QOpenGLFunctions.glClearStencil(s)
Parameters:

sGLint

Convenience function that calls (s ).

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

PySide2.QtGui.QOpenGLFunctions.glColorMask(red, green, blue, alpha)
Parameters:
  • redGLboolean

  • greenGLboolean

  • blueGLboolean

  • alphaGLboolean

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

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

PySide2.QtGui.QOpenGLFunctions.glCompileShader(shader)
Parameters:

shaderGLuint

Convenience function that calls (shader ).

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

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

PySide2.QtGui.QOpenGLFunctions.glCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data)
Parameters:
  • targetGLenum

  • levelGLint

  • internalformatGLenum

  • widthGLsizei

  • heightGLsizei

  • borderGLint

  • imageSizeGLsizei

  • datavoid

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

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

PySide2.QtGui.QOpenGLFunctions.glCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data)
Parameters:
  • targetGLenum

  • levelGLint

  • xoffsetGLint

  • yoffsetGLint

  • widthGLsizei

  • heightGLsizei

  • formatGLenum

  • imageSizeGLsizei

  • datavoid

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

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

PySide2.QtGui.QOpenGLFunctions.glCopyTexImage2D(target, level, internalformat, x, y, width, height, border)
Parameters:
  • targetGLenum

  • levelGLint

  • internalformatGLenum

  • xGLint

  • yGLint

  • widthGLsizei

  • heightGLsizei

  • borderGLint

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

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

PySide2.QtGui.QOpenGLFunctions.glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height)
Parameters:
  • targetGLenum

  • levelGLint

  • xoffsetGLint

  • yoffsetGLint

  • xGLint

  • yGLint

  • widthGLsizei

  • heightGLsizei

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

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

PySide2.QtGui.QOpenGLFunctions.glCreateProgram()
Return type:

GLuint

Convenience function that calls .

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

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

PySide2.QtGui.QOpenGLFunctions.glCreateShader(type)
Parameters:

typeGLenum

Return type:

GLuint

Convenience function that calls (type ).

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

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

PySide2.QtGui.QOpenGLFunctions.glCullFace(mode)
Parameters:

modeGLenum

Convenience function that calls (mode ).

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

PySide2.QtGui.QOpenGLFunctions.glDeleteBuffers(n, buffers)
Parameters:
  • nGLsizei

  • buffersGLuint

Convenience function that calls (n , buffers ).

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

PySide2.QtGui.QOpenGLFunctions.glDeleteFramebuffers(n, framebuffers)
Parameters:
  • nGLsizei

  • framebuffersGLuint

Convenience function that calls (n , framebuffers ).

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

PySide2.QtGui.QOpenGLFunctions.glDeleteProgram(program)
Parameters:

programGLuint

Convenience function that calls (program ).

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

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

PySide2.QtGui.QOpenGLFunctions.glDeleteRenderbuffers(n, renderbuffers)
Parameters:
  • nGLsizei

  • renderbuffersGLuint

Convenience function that calls (n , renderbuffers ).

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

PySide2.QtGui.QOpenGLFunctions.glDeleteShader(shader)
Parameters:

shaderGLuint

Convenience function that calls (shader ).

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

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

PySide2.QtGui.QOpenGLFunctions.glDeleteTextures(n, textures)
Parameters:
  • nGLsizei

  • texturesGLuint

Convenience function that calls (n , textures ).

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

PySide2.QtGui.QOpenGLFunctions.glDepthFunc(func)
Parameters:

funcGLenum

Convenience function that calls (func ).

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

PySide2.QtGui.QOpenGLFunctions.glDepthMask(flag)
Parameters:

flagGLboolean

Convenience function that calls (flag ).

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

PySide2.QtGui.QOpenGLFunctions.glDepthRangef(zNear, zFar)
Parameters:
  • zNearGLclampf

  • zFarGLclampf

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

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

PySide2.QtGui.QOpenGLFunctions.glDetachShader(program, shader)
Parameters:
  • programGLuint

  • shaderGLuint

Convenience function that calls (program , shader ).

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

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

PySide2.QtGui.QOpenGLFunctions.glDisable(cap)
Parameters:

capGLenum

Convenience function that calls (cap ).

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

PySide2.QtGui.QOpenGLFunctions.glDisableVertexAttribArray(index)
Parameters:

indexGLuint

Convenience function that calls (index ).

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

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

PySide2.QtGui.QOpenGLFunctions.glDrawArrays(mode, first, count)
Parameters:
  • modeGLenum

  • firstGLint

  • countGLsizei

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

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

PySide2.QtGui.QOpenGLFunctions.glDrawElements(mode, count, type, indices)
Parameters:
  • modeGLenum

  • countGLsizei

  • typeGLenum

  • indicesvoid

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

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

PySide2.QtGui.QOpenGLFunctions.glEnable(cap)
Parameters:

capGLenum

Convenience function that calls (cap ).

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

PySide2.QtGui.QOpenGLFunctions.glEnableVertexAttribArray(index)
Parameters:

indexGLuint

Convenience function that calls (index ).

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

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

PySide2.QtGui.QOpenGLFunctions.glFinish()

Convenience function that calls .

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

PySide2.QtGui.QOpenGLFunctions.glFlush()

Convenience function that calls .

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

PySide2.QtGui.QOpenGLFunctions.glFramebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer)
Parameters:
  • targetGLenum

  • attachmentGLenum

  • renderbuffertargetGLenum

  • renderbufferGLuint

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

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

PySide2.QtGui.QOpenGLFunctions.glFramebufferTexture2D(target, attachment, textarget, texture, level)
Parameters:
  • targetGLenum

  • attachmentGLenum

  • textargetGLenum

  • textureGLuint

  • levelGLint

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

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

PySide2.QtGui.QOpenGLFunctions.glFrontFace(mode)
Parameters:

modeGLenum

Convenience function that calls (mode ).

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

PySide2.QtGui.QOpenGLFunctions.glGenBuffers(n, buffers)
Parameters:
  • nGLsizei

  • buffersGLuint

Convenience function that calls (n , buffers ).

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

PySide2.QtGui.QOpenGLFunctions.glGenFramebuffers(n, framebuffers)
Parameters:
  • nGLsizei

  • framebuffersGLuint

Convenience function that calls (n , framebuffers ).

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

PySide2.QtGui.QOpenGLFunctions.glGenRenderbuffers(n, renderbuffers)
Parameters:
  • nGLsizei

  • renderbuffersGLuint

Convenience function that calls (n , renderbuffers ).

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

PySide2.QtGui.QOpenGLFunctions.glGenTextures(n, textures)
Parameters:
  • nGLsizei

  • texturesGLuint

Convenience function that calls (n , textures ).

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

PySide2.QtGui.QOpenGLFunctions.glGenerateMipmap(target)
Parameters:

targetGLenum

Convenience function that calls (target ).

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

PySide2.QtGui.QOpenGLFunctions.glGetAttachedShaders(program, maxcount, count, shaders)
Parameters:
  • programGLuint

  • maxcountGLsizei

  • countGLsizei

  • shadersGLuint

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

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

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

PySide2.QtGui.QOpenGLFunctions.glGetAttribLocation(program, name)
Parameters:
  • programGLuint

  • name – str

Return type:

GLint

Convenience function that calls (program , name ).

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

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

PySide2.QtGui.QOpenGLFunctions.glGetBufferParameteriv(target, pname, params)
Parameters:
  • targetGLenum

  • pnameGLenum

  • paramsGLint

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

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

PySide2.QtGui.QOpenGLFunctions.glGetError()
Return type:

GLenum

Convenience function that calls .

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

PySide2.QtGui.QOpenGLFunctions.glGetFloatv(pname, params)
Parameters:
  • pnameGLenum

  • paramsGLfloat

Convenience function that calls (pname , params ).

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

PySide2.QtGui.QOpenGLFunctions.glGetFramebufferAttachmentParameteriv(target, attachment, pname, params)
Parameters:
  • targetGLenum

  • attachmentGLenum

  • pnameGLenum

  • paramsGLint

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

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

PySide2.QtGui.QOpenGLFunctions.glGetIntegerv(pname, params)
Parameters:
  • pnameGLenum

  • paramsGLint

Convenience function that calls (pname , params ).

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

PySide2.QtGui.QOpenGLFunctions.glGetProgramiv(program, pname, params)
Parameters:
  • programGLuint

  • pnameGLenum

  • paramsGLint

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

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

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

PySide2.QtGui.QOpenGLFunctions.glGetRenderbufferParameteriv(target, pname, params)
Parameters:
  • targetGLenum

  • pnameGLenum

  • paramsGLint

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

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

PySide2.QtGui.QOpenGLFunctions.glGetShaderPrecisionFormat(shadertype, precisiontype, range, precision)
Parameters:
  • shadertypeGLenum

  • precisiontypeGLenum

  • rangeGLint

  • precisionGLint

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

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

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

PySide2.QtGui.QOpenGLFunctions.glGetShaderSource(shader)
Parameters:

shaderuint

Return type:

str

PySide2.QtGui.QOpenGLFunctions.glGetShaderiv(shader, pname, params)
Parameters:
  • shaderGLuint

  • pnameGLenum

  • paramsGLint

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

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

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

PySide2.QtGui.QOpenGLFunctions.glGetString(name)
Parameters:

nameGLenum

Return type:

GLubyte

Convenience function that calls (name ).

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

PySide2.QtGui.QOpenGLFunctions.glGetTexParameterfv(target, pname, params)
Parameters:
  • targetGLenum

  • pnameGLenum

  • paramsGLfloat

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

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

PySide2.QtGui.QOpenGLFunctions.glGetTexParameteriv(target, pname, params)
Parameters:
  • targetGLenum

  • pnameGLenum

  • paramsGLint

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

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

PySide2.QtGui.QOpenGLFunctions.glGetUniformLocation(program, name)
Parameters:
  • programGLuint

  • name – str

Return type:

GLint

Convenience function that calls (program , name ).

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

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

PySide2.QtGui.QOpenGLFunctions.glGetUniformfv(program, location, params)
Parameters:
  • programGLuint

  • locationGLint

  • paramsGLfloat

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

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

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

PySide2.QtGui.QOpenGLFunctions.glGetUniformiv(program, location, params)
Parameters:
  • programGLuint

  • locationGLint

  • paramsGLint

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

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

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

PySide2.QtGui.QOpenGLFunctions.glGetVertexAttribfv(index, pname, params)
Parameters:
  • indexGLuint

  • pnameGLenum

  • paramsGLfloat

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

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

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

PySide2.QtGui.QOpenGLFunctions.glGetVertexAttribiv(index, pname, params)
Parameters:
  • indexGLuint

  • pnameGLenum

  • paramsGLint

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

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

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

PySide2.QtGui.QOpenGLFunctions.glHint(target, mode)
Parameters:
  • targetGLenum

  • modeGLenum

Convenience function that calls (target , mode ).

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

PySide2.QtGui.QOpenGLFunctions.glIsBuffer(buffer)
Parameters:

bufferGLuint

Return type:

GLboolean

Convenience function that calls (buffer ).

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

PySide2.QtGui.QOpenGLFunctions.glIsEnabled(cap)
Parameters:

capGLenum

Return type:

GLboolean

Convenience function that calls (cap ).

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

PySide2.QtGui.QOpenGLFunctions.glIsFramebuffer(framebuffer)
Parameters:

framebufferGLuint

Return type:

GLboolean

Convenience function that calls (framebuffer ).

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

PySide2.QtGui.QOpenGLFunctions.glIsProgram(program)
Parameters:

programGLuint

Return type:

GLboolean

Convenience function that calls (program ).

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

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

PySide2.QtGui.QOpenGLFunctions.glIsRenderbuffer(renderbuffer)
Parameters:

renderbufferGLuint

Return type:

GLboolean

Convenience function that calls (renderbuffer ).

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

PySide2.QtGui.QOpenGLFunctions.glIsShader(shader)
Parameters:

shaderGLuint

Return type:

GLboolean

Convenience function that calls (shader ).

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

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

PySide2.QtGui.QOpenGLFunctions.glIsTexture(texture)
Parameters:

textureGLuint

Return type:

GLboolean

Convenience function that calls (texture ).

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

PySide2.QtGui.QOpenGLFunctions.glLineWidth(width)
Parameters:

widthGLfloat

Convenience function that calls (width ).

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

PySide2.QtGui.QOpenGLFunctions.glLinkProgram(program)
Parameters:

programGLuint

Convenience function that calls (program ).

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

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

PySide2.QtGui.QOpenGLFunctions.glPixelStorei(pname, param)
Parameters:
  • pnameGLenum

  • paramGLint

Convenience function that calls (pname , param ).

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

PySide2.QtGui.QOpenGLFunctions.glPolygonOffset(factor, units)
Parameters:
  • factorGLfloat

  • unitsGLfloat

Convenience function that calls (factor , units ).

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

PySide2.QtGui.QOpenGLFunctions.glReadPixels(x, y, width, height, format, type, pixels)
Parameters:
  • xGLint

  • yGLint

  • widthGLsizei

  • heightGLsizei

  • formatGLenum

  • typeGLenum

  • pixelsvoid

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

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

PySide2.QtGui.QOpenGLFunctions.glReleaseShaderCompiler()

Convenience function that calls .

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

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

PySide2.QtGui.QOpenGLFunctions.glRenderbufferStorage(target, internalformat, width, height)
Parameters:
  • targetGLenum

  • internalformatGLenum

  • widthGLsizei

  • heightGLsizei

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

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

PySide2.QtGui.QOpenGLFunctions.glSampleCoverage(value, invert)
Parameters:
  • valueGLclampf

  • invertGLboolean

Convenience function that calls (value , invert ).

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

PySide2.QtGui.QOpenGLFunctions.glScissor(x, y, width, height)
Parameters:
  • xGLint

  • yGLint

  • widthGLsizei

  • heightGLsizei

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

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

PySide2.QtGui.QOpenGLFunctions.glShaderBinary(n, shaders, binaryformat, binary, length)
Parameters:
  • nGLint

  • shadersGLuint

  • binaryformatGLenum

  • binaryvoid

  • lengthGLint

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

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

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

PySide2.QtGui.QOpenGLFunctions.glShaderSource(shader, source)
Parameters:
  • shaderuint

  • source – str

PySide2.QtGui.QOpenGLFunctions.glStencilFunc(func, ref, mask)
Parameters:
  • funcGLenum

  • refGLint

  • maskGLuint

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

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

PySide2.QtGui.QOpenGLFunctions.glStencilFuncSeparate(face, func, ref, mask)
Parameters:
  • faceGLenum

  • funcGLenum

  • refGLint

  • maskGLuint

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

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

PySide2.QtGui.QOpenGLFunctions.glStencilMask(mask)
Parameters:

maskGLuint

Convenience function that calls (mask ).

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

PySide2.QtGui.QOpenGLFunctions.glStencilMaskSeparate(face, mask)
Parameters:
  • faceGLenum

  • maskGLuint

Convenience function that calls (face , mask ).

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

PySide2.QtGui.QOpenGLFunctions.glStencilOp(fail, zfail, zpass)
Parameters:
  • failGLenum

  • zfailGLenum

  • zpassGLenum

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

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

PySide2.QtGui.QOpenGLFunctions.glStencilOpSeparate(face, fail, zfail, zpass)
Parameters:
  • faceGLenum

  • failGLenum

  • zfailGLenum

  • zpassGLenum

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

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

PySide2.QtGui.QOpenGLFunctions.glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels)
Parameters:
  • targetGLenum

  • levelGLint

  • internalformatGLint

  • widthGLsizei

  • heightGLsizei

  • borderGLint

  • formatGLenum

  • typeGLenum

  • pixelsvoid

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

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

PySide2.QtGui.QOpenGLFunctions.glTexParameterf(target, pname, param)
Parameters:
  • targetGLenum

  • pnameGLenum

  • paramGLfloat

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

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

PySide2.QtGui.QOpenGLFunctions.glTexParameterfv(target, pname, params)
Parameters:
  • targetGLenum

  • pnameGLenum

  • paramsGLfloat

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

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

PySide2.QtGui.QOpenGLFunctions.glTexParameteri(target, pname, param)
Parameters:
  • targetGLenum

  • pnameGLenum

  • paramGLint

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

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

PySide2.QtGui.QOpenGLFunctions.glTexParameteriv(target, pname, params)
Parameters:
  • targetGLenum

  • pnameGLenum

  • paramsGLint

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

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

PySide2.QtGui.QOpenGLFunctions.glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels)
Parameters:
  • targetGLenum

  • levelGLint

  • xoffsetGLint

  • yoffsetGLint

  • widthGLsizei

  • heightGLsizei

  • formatGLenum

  • typeGLenum

  • pixelsvoid

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

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

PySide2.QtGui.QOpenGLFunctions.glUniform1f(location, x)
Parameters:
  • locationGLint

  • xGLfloat

Convenience function that calls (location , x ).

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

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

PySide2.QtGui.QOpenGLFunctions.glUniform1fv(location, count, v)
Parameters:
  • locationGLint

  • countGLsizei

  • vGLfloat

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

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

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

PySide2.QtGui.QOpenGLFunctions.glUniform1i(location, x)
Parameters:
  • locationGLint

  • xGLint

Convenience function that calls (location , x ).

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

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

PySide2.QtGui.QOpenGLFunctions.glUniform1iv(location, count, v)
Parameters:
  • locationGLint

  • countGLsizei

  • vGLint

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

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

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

PySide2.QtGui.QOpenGLFunctions.glUniform2f(location, x, y)
Parameters:
  • locationGLint

  • xGLfloat

  • yGLfloat

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

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

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

PySide2.QtGui.QOpenGLFunctions.glUniform2fv(location, count, v)
Parameters:
  • locationGLint

  • countGLsizei

  • vGLfloat

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

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

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

PySide2.QtGui.QOpenGLFunctions.glUniform2i(location, x, y)
Parameters:
  • locationGLint

  • xGLint

  • yGLint

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

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

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

PySide2.QtGui.QOpenGLFunctions.glUniform2iv(location, count, v)
Parameters:
  • locationGLint

  • countGLsizei

  • vGLint

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

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

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

PySide2.QtGui.QOpenGLFunctions.glUniform3f(location, x, y, z)
Parameters:
  • locationGLint

  • xGLfloat

  • yGLfloat

  • zGLfloat

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

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

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

PySide2.QtGui.QOpenGLFunctions.glUniform3fv(location, count, v)
Parameters:
  • locationGLint

  • countGLsizei

  • vGLfloat

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

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

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

PySide2.QtGui.QOpenGLFunctions.glUniform3i(location, x, y, z)
Parameters:
  • locationGLint

  • xGLint

  • yGLint

  • zGLint

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

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

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

PySide2.QtGui.QOpenGLFunctions.glUniform3iv(location, count, v)
Parameters:
  • locationGLint

  • countGLsizei

  • vGLint

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

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

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

PySide2.QtGui.QOpenGLFunctions.glUniform4f(location, x, y, z, w)
Parameters:
  • locationGLint

  • xGLfloat

  • yGLfloat

  • zGLfloat

  • wGLfloat

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

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

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

PySide2.QtGui.QOpenGLFunctions.glUniform4fv(location, count, v)
Parameters:
  • locationGLint

  • countGLsizei

  • vGLfloat

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

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

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

PySide2.QtGui.QOpenGLFunctions.glUniform4i(location, x, y, z, w)
Parameters:
  • locationGLint

  • xGLint

  • yGLint

  • zGLint

  • wGLint

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

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

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

PySide2.QtGui.QOpenGLFunctions.glUniform4iv(location, count, v)
Parameters:
  • locationGLint

  • countGLsizei

  • vGLint

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

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

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

PySide2.QtGui.QOpenGLFunctions.glUniformMatrix2fv(location, count, transpose, value)
Parameters:
  • locationGLint

  • countGLsizei

  • transposeGLboolean

  • valueGLfloat

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

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

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

PySide2.QtGui.QOpenGLFunctions.glUniformMatrix3fv(location, count, transpose, value)
Parameters:
  • locationGLint

  • countGLsizei

  • transposeGLboolean

  • valueGLfloat

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

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

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

PySide2.QtGui.QOpenGLFunctions.glUniformMatrix4fv(location, count, transpose, value)
Parameters:
  • locationGLint

  • countGLsizei

  • transposeGLboolean

  • valueGLfloat

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

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

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

PySide2.QtGui.QOpenGLFunctions.glUseProgram(program)
Parameters:

programGLuint

Convenience function that calls (program ).

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

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

PySide2.QtGui.QOpenGLFunctions.glValidateProgram(program)
Parameters:

programGLuint

Convenience function that calls (program ).

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

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

PySide2.QtGui.QOpenGLFunctions.glVertexAttrib1f(indx, x)
Parameters:
  • indxGLuint

  • xGLfloat

Convenience function that calls (indx , x ).

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

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

PySide2.QtGui.QOpenGLFunctions.glVertexAttrib1fv(indx, values)
Parameters:
  • indxGLuint

  • valuesGLfloat

Convenience function that calls (indx , values ).

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

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

PySide2.QtGui.QOpenGLFunctions.glVertexAttrib2f(indx, x, y)
Parameters:
  • indxGLuint

  • xGLfloat

  • yGLfloat

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

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

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

PySide2.QtGui.QOpenGLFunctions.glVertexAttrib2fv(indx, values)
Parameters:
  • indxGLuint

  • valuesGLfloat

Convenience function that calls (indx , values ).

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

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

PySide2.QtGui.QOpenGLFunctions.glVertexAttrib3f(indx, x, y, z)
Parameters:
  • indxGLuint

  • xGLfloat

  • yGLfloat

  • zGLfloat

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

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

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

PySide2.QtGui.QOpenGLFunctions.glVertexAttrib3fv(indx, values)
Parameters:
  • indxGLuint

  • valuesGLfloat

Convenience function that calls (indx , values ).

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

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

PySide2.QtGui.QOpenGLFunctions.glVertexAttrib4f(indx, x, y, z, w)
Parameters:
  • indxGLuint

  • xGLfloat

  • yGLfloat

  • zGLfloat

  • wGLfloat

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

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

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

PySide2.QtGui.QOpenGLFunctions.glVertexAttrib4fv(indx, values)
Parameters:
  • indxGLuint

  • valuesGLfloat

Convenience function that calls (indx , values ).

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

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

PySide2.QtGui.QOpenGLFunctions.glVertexAttribPointer(indx, size, type, normalized, stride, ptr)
Parameters:
  • indxGLuint

  • sizeGLint

  • typeGLenum

  • normalizedGLboolean

  • strideGLsizei

  • ptrvoid

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

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

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

PySide2.QtGui.QOpenGLFunctions.glViewport(x, y, width, height)
Parameters:
  • xGLint

  • yGLint

  • widthGLsizei

  • heightGLsizei

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

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

PySide2.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()

PySide2.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 again to change the object’s context association.

PySide2.QtGui.QOpenGLFunctions.openGLFeatures()
Return type:

OpenGLFeatures

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.