- class QOpenGLFunctions#
The
QOpenGLFunctions
class provides cross-platform access to the OpenGL ES 2.0 API. More…Inherited by:
QOpenGLExtraFunctions
Synopsis#
Methods#
def
__init__()
def
glAttachShader()
def
glBindBuffer()
def
glBindTexture()
def
glBlendColor()
def
glBlendFunc()
def
glClear()
def
glClearColor()
def
glClearDepthf()
def
glClearStencil()
def
glColorMask()
def
glCreateShader()
def
glCullFace()
def
glDeleteShader()
def
glDepthFunc()
def
glDepthMask()
def
glDepthRangef()
def
glDetachShader()
def
glDisable()
def
glDrawArrays()
def
glDrawElements()
def
glEnable()
def
glFinish()
def
glFlush()
def
glFrontFace()
def
glGenBuffers()
def
glGenTextures()
def
glGetBooleanv()
def
glGetError()
def
glGetFloatv()
def
glGetIntegerv()
def
glGetProgramiv()
def
glGetShaderiv()
def
glGetString()
def
glGetUniformfv()
def
glGetUniformiv()
def
glHint()
def
glIsBuffer()
def
glIsEnabled()
def
glIsProgram()
def
glIsShader()
def
glIsTexture()
def
glLineWidth()
def
glLinkProgram()
def
glPixelStorei()
def
glReadPixels()
def
glScissor()
def
glShaderBinary()
def
glShaderSource()
def
glStencilFunc()
def
glStencilMask()
def
glStencilOp()
def
glTexImage2D()
def
glUniform1f()
def
glUniform1fv()
def
glUniform1i()
def
glUniform1iv()
def
glUniform2f()
def
glUniform2fv()
def
glUniform2i()
def
glUniform2iv()
def
glUniform3f()
def
glUniform3fv()
def
glUniform3i()
def
glUniform3iv()
def
glUniform4f()
def
glUniform4fv()
def
glUniform4i()
def
glUniform4iv()
def
glUseProgram()
def
glViewport()
def
openGLFeatures()
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 useQOpenGLFunctions
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 asglActiveTexture()
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 ofQOpenGLFunctions
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 exampleglClear()
orglDrawArrays()
, can be called also directly, as long as the application links to the platform-specific OpenGL library, calling them viaQOpenGLFunctions
enables the possibility of dynamically loading the OpenGL implementation.The
hasOpenGLFeature()
andopenGLFeatures()
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)
See also
- class 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.
- __init__(context)#
- Parameters:
context –
QOpenGLContext
Constructs a function resolver for
context
. Ifcontext
isNone
, then the resolver will be created for the currentQOpenGLContext
.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. UseinitializeOpenGLFunctions()
to change the object’s context association.See also
- __init__()
Constructs a default function resolver. The resolver cannot be used until
initializeOpenGLFunctions()
is called to specify the context.See also
- glActiveTexture(texture)#
- Parameters:
texture – int
Convenience function that calls glActiveTexture(
texture
).For more information, see the OpenGL ES 3.X documentation for glActiveTexture() .
- 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.
- 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.
- 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() .
- 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 boundQOpenGLContext
‘s defaultFramebufferObject().For more information, see the OpenGL ES 3.X documentation for glBindFramebuffer() .
- 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() .
- 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() .
- 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() .
- glBlendEquation(mode)#
- Parameters:
mode – int
Convenience function that calls glBlendEquation(
mode
).For more information, see the OpenGL ES 3.X documentation for glBlendEquation() .
- 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() .
- 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() .
- 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() .
- 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() .
- glClear(mask)#
- Parameters:
mask – int
Convenience function that calls glClear(
mask
).For more information, see the OpenGL ES 3.X documentation for glClear() .
- 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() .
- 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() .
- glClearStencil(s)#
- Parameters:
s – int
Convenience function that calls glClearStencil(
s
).For more information, see the OpenGL ES 3.X documentation for glClearStencil() .
- 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() .
- 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.
- glCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data)#
- Parameters:
target – int
level – int
internalformat – int
width – int
height – int
border – int
imageSize – int
data –
void
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() .
- 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
data –
void
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() .
- 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() .
- 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() .
- 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.
- 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.
- glCullFace(mode)#
- Parameters:
mode – int
Convenience function that calls glCullFace(
mode
).For more information, see the OpenGL ES 3.X documentation for glCullFace() .
- glDeleteBuffers(n, buffers)#
- Parameters:
n – int
buffers –
unsigned int
Convenience function that calls glDeleteBuffers(
n
,buffers
).For more information, see the OpenGL ES 3.X documentation for glDeleteBuffers() .
- glDeleteFramebuffers(n, framebuffers)#
- Parameters:
n – int
framebuffers –
unsigned int
Convenience function that calls glDeleteFramebuffers(
n
,framebuffers
).For more information, see the OpenGL ES 3.X documentation for glDeleteFramebuffers() .
- 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.
- glDeleteRenderbuffers(n, renderbuffers)#
- Parameters:
n – int
renderbuffers –
unsigned int
Convenience function that calls glDeleteRenderbuffers(
n
,renderbuffers
).For more information, see the OpenGL ES 3.X documentation for glDeleteRenderbuffers() .
- 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.
- glDeleteTextures(n, textures)#
- Parameters:
n – int
textures –
unsigned int
Convenience function that calls glDeleteTextures(
n
,textures
).For more information, see the OpenGL ES 3.X documentation for glDeleteTextures() .
- glDepthFunc(func)#
- Parameters:
func – int
Convenience function that calls glDepthFunc(
func
).For more information, see the OpenGL ES 3.X documentation for glDepthFunc() .
- glDepthMask(flag)#
- Parameters:
flag – int
Convenience function that calls glDepthMask(
flag
).For more information, see the OpenGL ES 3.X documentation for glDepthMask() .
- 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() .
- 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.
- glDisable(cap)#
- Parameters:
cap – int
Convenience function that calls glDisable(
cap
).For more information, see the OpenGL ES 3.X documentation for glDisable() .
- 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.
- 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() .
- glDrawElements(mode, count, type, indices)#
- Parameters:
mode – int
count – int
type – int
indices –
void
Convenience function that calls glDrawElements(
mode
,count
,type
,indices
).For more information, see the OpenGL ES 3.X documentation for glDrawElements() .
- glEnable(cap)#
- Parameters:
cap – int
Convenience function that calls glEnable(
cap
).For more information, see the OpenGL ES 3.X documentation for glEnable() .
- 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.
- glFinish()#
Convenience function that calls glFinish().
For more information, see the OpenGL ES 3.X documentation for glFinish() .
- glFlush()#
Convenience function that calls glFlush().
For more information, see the OpenGL ES 3.X documentation for glFlush() .
- 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() .
- 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() .
- glFrontFace(mode)#
- Parameters:
mode – int
Convenience function that calls glFrontFace(
mode
).For more information, see the OpenGL ES 3.X documentation for glFrontFace() .
- glGenBuffers(n, buffers)#
- Parameters:
n – int
buffers –
unsigned int
Convenience function that calls glGenBuffers(
n
,buffers
).For more information, see the OpenGL ES 3.X documentation for glGenBuffers() .
- glGenFramebuffers(n, framebuffers)#
- Parameters:
n – int
framebuffers –
unsigned int
Convenience function that calls glGenFramebuffers(
n
,framebuffers
).For more information, see the OpenGL ES 3.X documentation for glGenFramebuffers() .
- glGenRenderbuffers(n, renderbuffers)#
- Parameters:
n – int
renderbuffers –
unsigned int
Convenience function that calls glGenRenderbuffers(
n
,renderbuffers
).For more information, see the OpenGL ES 3.X documentation for glGenRenderbuffers() .
- glGenTextures(n, textures)#
- Parameters:
n – int
textures –
unsigned int
Convenience function that calls glGenTextures(
n
,textures
).For more information, see the OpenGL ES 3.X documentation for glGenTextures() .
- glGenerateMipmap(target)#
- Parameters:
target – int
Convenience function that calls glGenerateMipmap(
target
).For more information, see the OpenGL ES 3.X documentation for glGenerateMipmap() .
- glGetAttachedShaders(program, maxcount, count, shaders)#
- Parameters:
program – int
maxcount – int
count – int
shaders –
unsigned 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.
- 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.
- 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() .
- 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() .
- glGetError()#
- Return type:
int
Convenience function that calls glGetError().
For more information, see the OpenGL ES 3.X documentation for glGetError() .
- glGetFloatv(arg__1)#
- Parameters:
arg__1 – int
- Return type:
object
- 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() .
- 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() .
- glGetIntegerv(arg__1)#
- Parameters:
arg__1 – int
- Return type:
object
- 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() .
- 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.
- 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() .
- 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.
- glGetShaderSource(shader)#
- Parameters:
shader – int
- Return type:
str
- 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.
- 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() .
- 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() .
- 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() .
- 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.
- 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.
- 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.
- 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.
- 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.
- 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() .
- 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() .
- 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() .
- 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() .
- 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.
- 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() .
- 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.
- 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() .
- glLineWidth(width)#
- Parameters:
width – float
Convenience function that calls glLineWidth(
width
).For more information, see the OpenGL ES 3.X documentation for glLineWidth() .
- 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.
- 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() .
- 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() .
- glReadPixels(x, y, width, height, format, type, pixels)#
- Parameters:
x – int
y – int
width – int
height – int
format – int
type – int
pixels –
void
Convenience function that calls glReadPixels(
x
,y
,width
,height
,format
,type
,pixels
).For more information, see the OpenGL ES 3.X documentation for glReadPixels() .
- 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.
- 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() .
- 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() .
- 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() .
- glShaderBinary(n, shaders, binaryformat, binary, length)#
- Parameters:
n – int
shaders –
unsigned int
binaryformat – int
binary –
void
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.
- glShaderSource(shader, source)#
- Parameters:
shader – int
source – str
- 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() .
- 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() .
- glStencilMask(mask)#
- Parameters:
mask – int
Convenience function that calls glStencilMask(
mask
).For more information, see the OpenGL ES 3.X documentation for glStencilMask() .
- 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() .
- 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() .
- 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() .
- 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
pixels –
void
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() .
- 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() .
- 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() .
- 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() .
- 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() .
- 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
pixels –
void
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() .
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- glVertexAttribPointer(indx, size, type, normalized, stride, ptr)#
- Parameters:
indx – int
size – int
type – int
normalized – int
stride – int
ptr –
void
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.
- 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() .
- hasOpenGLFeature(feature)#
- Parameters:
feature –
OpenGLFeature
- Return type:
bool
Returns
true
iffeature
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
- 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.- openGLFeatures()#
- Return type:
Combination of
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.See also