内容表

上一话题

QOpenGLFramebufferObjectFormat

下一话题

QOpenGLPixelTransferOptions

QOpenGLFunctions

QOpenGLFunctions class provides cross-platform access to the OpenGL ES 2.0 API. 更多

Inheritance diagram of PySide2.QtGui.QOpenGLFunctions

继承者: QOpenGLExtraFunctions

New in version 5.0.

概要

函数

详细描述

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:
    MyGLWindow(QScreen *screen = 0);
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();
}
											

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.

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 QOpenGLFunctions

QOpenGLFunctions(context)

param context

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 。若 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.

常量

描述

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() 可用。

QOpenGLFunctions.BlendEquation

glBlendEquation() 可用。

QOpenGLFunctions.BlendEquationSeparate

glBlendEquationSeparate() 可用。

QOpenGLFunctions.BlendEquationAdvanced

Advanced blend equations are available.

QOpenGLFunctions.BlendFuncSeparate

glBlendFuncSeparate() 可用。

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 )
参数

texture GLenum

Convenience function that calls ( texture ).

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

PySide2.QtGui.QOpenGLFunctions. glAttachShader ( program , shader )
参数
  • program GLuint

  • shader GLuint

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 )
参数
  • program GLuint

  • index GLuint

  • 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 )
参数
  • target GLenum

  • buffer GLuint

Convenience function that calls ( target , buffer ).

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

PySide2.QtGui.QOpenGLFunctions. glBindFramebuffer ( target , framebuffer )
参数
  • target GLenum

  • framebuffer GLuint

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 )
参数
  • target GLenum

  • renderbuffer GLuint

Convenience function that calls ( target , renderbuffer ).

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

PySide2.QtGui.QOpenGLFunctions. glBindTexture ( target , texture )
参数
  • target GLenum

  • texture GLuint

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 )
参数
  • red GLclampf

  • green GLclampf

  • blue GLclampf

  • alpha GLclampf

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 )
参数

mode GLenum

Convenience function that calls ( mode ).

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

PySide2.QtGui.QOpenGLFunctions. glBlendEquationSeparate ( modeRGB , modeAlpha )
参数
  • modeRGB GLenum

  • modeAlpha GLenum

Convenience function that calls ( modeRGB , modeAlpha ).

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

PySide2.QtGui.QOpenGLFunctions. glBlendFunc ( sfactor , dfactor )
参数
  • sfactor GLenum

  • dfactor GLenum

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 )
参数
  • srcRGB GLenum

  • dstRGB GLenum

  • srcAlpha GLenum

  • dstAlpha GLenum

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 )
参数

target GLenum

返回类型

GLenum

Convenience function that calls ( target ).

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

PySide2.QtGui.QOpenGLFunctions. glClear ( mask )
参数

mask GLbitfield

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 )
参数
  • red GLclampf

  • green GLclampf

  • blue GLclampf

  • alpha GLclampf

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 )
参数

depth GLclampf

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 )
参数

s GLint

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 )
参数
  • red GLboolean

  • green GLboolean

  • blue GLboolean

  • alpha GLboolean

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 )
参数

shader GLuint

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 )
参数
  • target GLenum

  • level GLint

  • internalformat GLenum

  • width GLsizei

  • height GLsizei

  • border GLint

  • imageSize GLsizei

  • data void

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 )
参数
  • target GLenum

  • level GLint

  • xoffset GLint

  • yoffset GLint

  • width GLsizei

  • height GLsizei

  • format GLenum

  • imageSize GLsizei

  • data void

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 )
参数
  • target GLenum

  • level GLint

  • internalformat GLenum

  • x GLint

  • y GLint

  • width GLsizei

  • height GLsizei

  • border GLint

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 )
参数
  • target GLenum

  • level GLint

  • xoffset GLint

  • yoffset GLint

  • x GLint

  • y GLint

  • width GLsizei

  • height GLsizei

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 ( )
返回类型

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 )
参数

type GLenum

返回类型

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 )
参数

mode GLenum

Convenience function that calls ( mode ).

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

PySide2.QtGui.QOpenGLFunctions. glDeleteBuffers ( n , buffers )
参数
  • n GLsizei

  • buffers GLuint

Convenience function that calls ( n , buffers ).

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

PySide2.QtGui.QOpenGLFunctions. glDeleteFramebuffers ( n , framebuffers )
参数
  • n GLsizei

  • framebuffers GLuint

Convenience function that calls ( n , framebuffers ).

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

PySide2.QtGui.QOpenGLFunctions. glDeleteProgram ( program )
参数

program GLuint

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 )
参数
  • n GLsizei

  • renderbuffers GLuint

Convenience function that calls ( n , renderbuffers ).

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

PySide2.QtGui.QOpenGLFunctions. glDeleteShader ( shader )
参数

shader GLuint

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 )
参数
  • n GLsizei

  • textures GLuint

Convenience function that calls ( n , textures ).

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

PySide2.QtGui.QOpenGLFunctions. glDepthFunc ( func )
参数

func GLenum

Convenience function that calls ( func ).

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

PySide2.QtGui.QOpenGLFunctions. glDepthMask ( flag )
参数

flag GLboolean

Convenience function that calls ( flag ).

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

PySide2.QtGui.QOpenGLFunctions. glDepthRangef ( zNear , zFar )
参数
  • zNear GLclampf

  • zFar GLclampf

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 )
参数
  • program GLuint

  • shader GLuint

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 )
参数

cap GLenum

Convenience function that calls ( cap ).

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

PySide2.QtGui.QOpenGLFunctions. glDisableVertexAttribArray ( index )
参数

index GLuint

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 )
参数
  • mode GLenum

  • first GLint

  • count GLsizei

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 )
参数
  • mode GLenum

  • count GLsizei

  • type GLenum

  • indices void

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 )
参数

cap GLenum

Convenience function that calls ( cap ).

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

PySide2.QtGui.QOpenGLFunctions. glEnableVertexAttribArray ( index )
参数

index GLuint

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 )
参数
  • target GLenum

  • attachment GLenum

  • renderbuffertarget GLenum

  • renderbuffer GLuint

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 )
参数
  • target GLenum

  • attachment GLenum

  • textarget GLenum

  • texture GLuint

  • level GLint

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 )
参数

mode GLenum

Convenience function that calls ( mode ).

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

PySide2.QtGui.QOpenGLFunctions. glGenBuffers ( n , buffers )
参数
  • n GLsizei

  • buffers GLuint

Convenience function that calls ( n , buffers ).

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

PySide2.QtGui.QOpenGLFunctions. glGenFramebuffers ( n , framebuffers )
参数
  • n GLsizei

  • framebuffers GLuint

Convenience function that calls ( n , framebuffers ).

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

PySide2.QtGui.QOpenGLFunctions. glGenRenderbuffers ( n , renderbuffers )
参数
  • n GLsizei

  • renderbuffers GLuint

Convenience function that calls ( n , renderbuffers ).

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

PySide2.QtGui.QOpenGLFunctions. glGenTextures ( n , textures )
参数
  • n GLsizei

  • textures GLuint

Convenience function that calls ( n , textures ).

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

PySide2.QtGui.QOpenGLFunctions. glGenerateMipmap ( target )
参数

target GLenum

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 )
参数
  • program GLuint

  • maxcount GLsizei

  • count GLsizei

  • shaders GLuint

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 )
参数
  • program GLuint

  • name – str

返回类型

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 )
参数
  • target GLenum

  • pname GLenum

  • params GLint

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

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

PySide2.QtGui.QOpenGLFunctions. glGetError ( )
返回类型

GLenum

Convenience function that calls .

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

PySide2.QtGui.QOpenGLFunctions. glGetFloatv ( pname , params )
参数
  • pname GLenum

  • params GLfloat

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 )
参数
  • target GLenum

  • attachment GLenum

  • pname GLenum

  • params GLint

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 )
参数
  • pname GLenum

  • params GLint

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 )
参数
  • program GLuint

  • pname GLenum

  • params GLint

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 )
参数
  • target GLenum

  • pname GLenum

  • params GLint

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 )
参数
  • shadertype GLenum

  • precisiontype GLenum

  • range GLint

  • precision GLint

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. glGetShaderiv ( shader , pname , params )
参数
  • shader GLuint

  • pname GLenum

  • params GLint

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 )
参数

name GLenum

返回类型

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 )
参数
  • target GLenum

  • pname GLenum

  • params GLfloat

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 )
参数
  • target GLenum

  • pname GLenum

  • params GLint

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 )
参数
  • program GLuint

  • name – str

返回类型

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 )
参数
  • program GLuint

  • location GLint

  • params GLfloat

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 )
参数
  • program GLuint

  • location GLint

  • params GLint

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 )
参数
  • index GLuint

  • pname GLenum

  • params GLfloat

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 )
参数
  • index GLuint

  • pname GLenum

  • params GLint

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 )
参数
  • target GLenum

  • mode GLenum

Convenience function that calls ( target , mode ).

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

PySide2.QtGui.QOpenGLFunctions. glIsBuffer ( buffer )
参数

buffer GLuint

返回类型

GLboolean

Convenience function that calls ( buffer ).

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

PySide2.QtGui.QOpenGLFunctions. glIsEnabled ( cap )
参数

cap GLenum

返回类型

GLboolean

Convenience function that calls ( cap ).

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

PySide2.QtGui.QOpenGLFunctions. glIsFramebuffer ( framebuffer )
参数

framebuffer GLuint

返回类型

GLboolean

Convenience function that calls ( framebuffer ).

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

PySide2.QtGui.QOpenGLFunctions. glIsProgram ( program )
参数

program GLuint

返回类型

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 )
参数

renderbuffer GLuint

返回类型

GLboolean

Convenience function that calls ( renderbuffer ).

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

PySide2.QtGui.QOpenGLFunctions. glIsShader ( shader )
参数

shader GLuint

返回类型

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 )
参数

texture GLuint

返回类型

GLboolean

Convenience function that calls ( texture ).

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

PySide2.QtGui.QOpenGLFunctions. glLineWidth ( width )
参数

width GLfloat

Convenience function that calls ( width ).

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

PySide2.QtGui.QOpenGLFunctions. glLinkProgram ( program )
参数

program GLuint

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 )
参数
  • pname GLenum

  • param GLint

Convenience function that calls ( pname , param ).

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

PySide2.QtGui.QOpenGLFunctions. glPolygonOffset ( factor , units )
参数
  • factor GLfloat

  • units GLfloat

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 )
参数
  • x GLint

  • y GLint

  • width GLsizei

  • height GLsizei

  • format GLenum

  • type GLenum

  • pixels void

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 )
参数
  • target GLenum

  • internalformat GLenum

  • width GLsizei

  • height GLsizei

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 )
参数
  • value GLclampf

  • invert GLboolean

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 )
参数
  • x GLint

  • y GLint

  • width GLsizei

  • height GLsizei

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 )
参数
  • n GLint

  • shaders GLuint

  • binaryformat GLenum

  • binary void

  • length GLint

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. glStencilFunc ( func , ref , mask )
参数
  • func GLenum

  • ref GLint

  • mask GLuint

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 )
参数
  • face GLenum

  • func GLenum

  • ref GLint

  • mask GLuint

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 )
参数

mask GLuint

Convenience function that calls ( mask ).

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

PySide2.QtGui.QOpenGLFunctions. glStencilMaskSeparate ( face , mask )
参数
  • face GLenum

  • mask GLuint

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 )
参数
  • fail GLenum

  • zfail GLenum

  • zpass GLenum

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 )
参数
  • face GLenum

  • fail GLenum

  • zfail GLenum

  • zpass GLenum

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 )
参数
  • target GLenum

  • level GLint

  • internalformat GLint

  • width GLsizei

  • height GLsizei

  • border GLint

  • format GLenum

  • type GLenum

  • pixels void

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 )
参数
  • target GLenum

  • pname GLenum

  • param GLfloat

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 )
参数
  • target GLenum

  • pname GLenum

  • params GLfloat

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 )
参数
  • target GLenum

  • pname GLenum

  • param GLint

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 )
参数
  • target GLenum

  • pname GLenum

  • params GLint

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 )
参数
  • target GLenum

  • level GLint

  • xoffset GLint

  • yoffset GLint

  • width GLsizei

  • height GLsizei

  • format GLenum

  • type GLenum

  • pixels void

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 )
参数
  • location GLint

  • x GLfloat

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 )
参数
  • location GLint

  • count GLsizei

  • v GLfloat

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 )
参数
  • location GLint

  • x GLint

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 )
参数
  • location GLint

  • count GLsizei

  • v GLint

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 )
参数
  • location GLint

  • x GLfloat

  • y GLfloat

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 )
参数
  • location GLint

  • count GLsizei

  • v GLfloat

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 )
参数
  • location GLint

  • x GLint

  • y GLint

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 )
参数
  • location GLint

  • count GLsizei

  • v GLint

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 )
参数
  • location GLint

  • x GLfloat

  • y GLfloat

  • z GLfloat

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 )
参数
  • location GLint

  • count GLsizei

  • v GLfloat

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 )
参数
  • location GLint

  • x GLint

  • y GLint

  • z GLint

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 )
参数
  • location GLint

  • count GLsizei

  • v GLint

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 )
参数
  • location GLint

  • x GLfloat

  • y GLfloat

  • z GLfloat

  • w GLfloat

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 )
参数
  • location GLint

  • count GLsizei

  • v GLfloat

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 )
参数
  • location GLint

  • x GLint

  • y GLint

  • z GLint

  • w GLint

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 )
参数
  • location GLint

  • count GLsizei

  • v GLint

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 )
参数
  • location GLint

  • count GLsizei

  • transpose GLboolean

  • value GLfloat

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 )
参数
  • location GLint

  • count GLsizei

  • transpose GLboolean

  • value GLfloat

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 )
参数
  • location GLint

  • count GLsizei

  • transpose GLboolean

  • value GLfloat

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 )
参数

program GLuint

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 )
参数

program GLuint

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 )
参数
  • indx GLuint

  • x GLfloat

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 )
参数
  • indx GLuint

  • values GLfloat

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 )
参数
  • indx GLuint

  • x GLfloat

  • y GLfloat

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 )
参数
  • indx GLuint

  • values GLfloat

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 )
参数
  • indx GLuint

  • x GLfloat

  • y GLfloat

  • z GLfloat

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 )
参数
  • indx GLuint

  • values GLfloat

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 )
参数
  • indx GLuint

  • x GLfloat

  • y GLfloat

  • z GLfloat

  • w GLfloat

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 )
参数
  • indx GLuint

  • values GLfloat

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 )
参数
  • indx GLuint

  • size GLint

  • type GLenum

  • normalized GLboolean

  • stride GLsizei

  • ptr void

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 )
参数
  • x GLint

  • y GLint

  • width GLsizei

  • height GLsizei

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 )
参数

feature OpenGLFeature

返回类型

bool

返回 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.

另请参阅

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 ( )
返回类型

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.