CopperSpice API  1.9.1
QGLFunctions Class Reference

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

Public Typedefs

using OpenGLFeatures = QFlags< OpenGLFeature >
 

Public Types

enum  OpenGLFeature
 

Public Methods

 QGLFunctions ()
 
 QGLFunctions (const QGLContext *context)
 
 ~QGLFunctions ()
 
void glActiveTexture (GLenum texture)
 
void glAttachShader (GLuint program, GLuint shader)
 
void glBindAttribLocation (GLuint program, GLuint index, const char *name)
 
void glBindBuffer (GLenum target, GLuint buffer)
 
void glBindFramebuffer (GLenum target, GLuint framebuffer)
 
void glBindRenderbuffer (GLenum target, GLuint renderbuffer)
 
void glBlendColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
 
void glBlendEquation (GLenum mode)
 
void glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha)
 
void glBlendFuncSeparate (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
 
void glBufferData (GLenum target, qopengl_GLsizeiptr size, const void *data, GLenum usage)
 
void glBufferSubData (GLenum target, qopengl_GLintptr offset, qopengl_GLsizeiptr size, const void *data)
 
GLenum glCheckFramebufferStatus (GLenum target)
 
void glClearDepthf (GLclampf depth)
 
void glCompileShader (GLuint shader)
 
void glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data)
 
void glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data)
 
GLuint glCreateProgram ()
 
GLuint glCreateShader (GLenum type)
 
void glDeleteBuffers (GLsizei n, const GLuint *buffers)
 
void glDeleteFramebuffers (GLsizei n, const GLuint *framebuffers)
 
void glDeleteProgram (GLuint program)
 
void glDeleteRenderbuffers (GLsizei n, const GLuint *renderbuffers)
 
void glDeleteShader (GLuint shader)
 
void glDepthRangef (GLclampf zNear, GLclampf zFar)
 
void glDetachShader (GLuint program, GLuint shader)
 
void glDisableVertexAttribArray (GLuint index)
 
void glEnableVertexAttribArray (GLuint index)
 
void glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
 
void glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
 
void glGenBuffers (GLsizei n, GLuint *buffers)
 
void glGenerateMipmap (GLenum target)
 
void glGenFramebuffers (GLsizei n, GLuint *framebuffers)
 
void glGenRenderbuffers (GLsizei n, GLuint *renderbuffers)
 
void glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufsize, GLsizei *length, GLint *size, GLenum *type, char *name)
 
void glGetActiveUniform (GLuint program, GLuint index, GLsizei bufsize, GLsizei *length, GLint *size, GLenum *type, char *name)
 
void glGetAttachedShaders (GLuint program, GLsizei maxcount, GLsizei *count, GLuint *shaders)
 
int glGetAttribLocation (GLuint program, const char *name)
 
void glGetBufferParameteriv (GLenum target, GLenum pname, GLint *params)
 
void glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint *params)
 
void glGetProgramInfoLog (GLuint program, GLsizei bufsize, GLsizei *length, char *infolog)
 
void glGetProgramiv (GLuint program, GLenum pname, GLint *params)
 
void glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint *params)
 
void glGetShaderInfoLog (GLuint shader, GLsizei bufsize, GLsizei *length, char *infolog)
 
void glGetShaderiv (GLuint shader, GLenum pname, GLint *params)
 
void glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision)
 
void glGetShaderSource (GLuint shader, GLsizei bufsize, GLsizei *length, char *source)
 
void glGetUniformfv (GLuint program, GLint location, GLfloat *params)
 
void glGetUniformiv (GLuint program, GLint location, GLint *params)
 
int glGetUniformLocation (GLuint program, const char *name)
 
void glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat *params)
 
void glGetVertexAttribiv (GLuint index, GLenum pname, GLint *params)
 
void glGetVertexAttribPointerv (GLuint index, GLenum pname, void **pointer)
 
GLboolean glIsBuffer (GLuint buffer)
 
GLboolean glIsFramebuffer (GLuint framebuffer)
 
GLboolean glIsProgram (GLuint program)
 
GLboolean glIsRenderbuffer (GLuint renderbuffer)
 
GLboolean glIsShader (GLuint shader)
 
void glLinkProgram (GLuint program)
 
void glReleaseShaderCompiler ()
 
void glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
 
void glSampleCoverage (GLclampf value, GLboolean invert)
 
void glShaderBinary (GLint n, const GLuint *shaders, GLenum binaryformat, const void *binary, GLint length)
 
void glShaderSource (GLuint shader, GLsizei count, const char **string, const GLint *length)
 
void glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask)
 
void glStencilMaskSeparate (GLenum face, GLuint mask)
 
void glStencilOpSeparate (GLenum face, GLenum fail, GLenum zfail, GLenum zpass)
 
void glUniform1f (GLint location, GLfloat x)
 
void glUniform1fv (GLint location, GLsizei count, const GLfloat *v)
 
void glUniform1i (GLint location, GLint x)
 
void glUniform1iv (GLint location, GLsizei count, const GLint *v)
 
void glUniform2f (GLint location, GLfloat x, GLfloat y)
 
void glUniform2fv (GLint location, GLsizei count, const GLfloat *v)
 
void glUniform2i (GLint location, GLint x, GLint y)
 
void glUniform2iv (GLint location, GLsizei count, const GLint *v)
 
void glUniform3f (GLint location, GLfloat x, GLfloat y, GLfloat z)
 
void glUniform3fv (GLint location, GLsizei count, const GLfloat *v)
 
void glUniform3i (GLint location, GLint x, GLint y, GLint z)
 
void glUniform3iv (GLint location, GLsizei count, const GLint *v)
 
void glUniform4f (GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
 
void glUniform4fv (GLint location, GLsizei count, const GLfloat *v)
 
void glUniform4i (GLint location, GLint x, GLint y, GLint z, GLint w)
 
void glUniform4iv (GLint location, GLsizei count, const GLint *v)
 
void glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
 
void glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
 
void glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
 
void glUseProgram (GLuint program)
 
void glValidateProgram (GLuint program)
 
void glVertexAttrib1f (GLuint indx, GLfloat x)
 
void glVertexAttrib1fv (GLuint indx, const GLfloat *values)
 
void glVertexAttrib2f (GLuint indx, GLfloat x, GLfloat y)
 
void glVertexAttrib2fv (GLuint indx, const GLfloat *values)
 
void glVertexAttrib3f (GLuint indx, GLfloat x, GLfloat y, GLfloat z)
 
void glVertexAttrib3fv (GLuint indx, const GLfloat *values)
 
void glVertexAttrib4f (GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
 
void glVertexAttrib4fv (GLuint indx, const GLfloat *values)
 
void glVertexAttribPointer (GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *ptr)
 
bool hasOpenGLFeature (QGLFunctions::OpenGLFeature feature) const
 
void initializeGLFunctions (const QGLContext *context=nullptr)
 
QGLFunctions::OpenGLFeatures openGLFeatures () const
 

Detailed Description

The QGLFunctions class provides cross-platform access to the OpenGL/ES 2.0 API.

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.

QGLFunctions 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 QGLFunctions is by direct inheritance.

class MyGLWidget : public QGLWidget, protected QGLFunctions
{
CS_OBJECT(MyGLWidget)
public:
MyGLWidget(QWidget *parent = nullptr)
: QGLWidget(parent)
{ }
protected:
void initializeGL();
void paintGL();
};
void MyGLWidget::initializeGL() {
}

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 MyGLWidget::paintGL()
{
glActiveTexture(GL_TEXTURE1);
glBindTexture(GL_TEXTURE_2D, texture_id);
...
}

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

glFuncs.glActiveTexture(GL_TEXTURE1);

QGLFunctions provides wrappers for all OpenGL/ES 2.0 functions, except those like glDrawArrays(), glViewport(), and glBindTexture() that do not have portability issues.

Including the header for QGLFunctions will also define all of the OpenGL/ES 2.0 macro constants that are not already defined by the system's OpenGL headers, such as GL_TEXTURE1 above.

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:

bool npot = funcs.hasOpenGLFeature(QGLFunctions::NPOTTextures);
See also
initializeGLFunctions()

Member Typedef Documentation

Member Enumeration Documentation

This enum defines OpenGL/ES 2.0 features that may be optional on other platforms.

ConstantValueDescription
QGLFunctions::Multitexture0x0001glActiveTexture() function is available.
QGLFunctions::Shaders0x0002Shader functions are available.
QGLFunctions::Buffers0x0004Vertex and index buffer functions are available.
QGLFunctions::Framebuffers0x0008Framebuffer object functions are available.
QGLFunctions::BlendColor0x0010glBlendColor() is available.
QGLFunctions::BlendEquation0x0020glBlendEquation() is available.
QGLFunctions::BlendEquationSeparate0x0040glBlendEquationSeparate() is available.
QGLFunctions::BlendFuncSeparate0x0080glBlendFuncSeparate() is available.
QGLFunctions::BlendSubtract0x0100Blend subtract mode is available.
QGLFunctions::CompressedTextures0x0200Compressed texture functions are available.
QGLFunctions::Multisample0x0400glSampleCoverage() function is available.
QGLFunctions::StencilSeparate0x0800Separate stencil functions are available.
QGLFunctions::NPOTTextures0x1000Non power of two textures are available.

Constructor & Destructor Documentation

QGLFunctions::QGLFunctions ( )

Constructs a default function resolver. The resolver can not be used until initializeGLFunctions() is called to specify the context.

See also
initializeGLFunctions()
QGLFunctions::QGLFunctions ( const QGLContext context)
explicit

Constructs a function resolver for context. If context is null then the resolver will be created for the current QGLContext. An object constructed in this way can only be used with context and other contexts that share with it. Use initializeGLFunctions() to change the object's context association.

See also
initializeGLFunctions()
QGLFunctions::~QGLFunctions ( )
inline

Destroys this function resolver.

Method Documentation

void QGLFunctions::glActiveTexture ( GLenum  texture)
inline

Equivalent to calling glActiveTexture(texture).

For more information, refer to the OpenGL/ES 2.0 documentation for glActiveTexture().

void QGLFunctions::glAttachShader ( GLuint  program,
GLuint  shader 
)
inline

Equivalent to calling glAttachShader(program, shader). This method will do nothing on OpenGL/ES 1.x systems.

For more information, refer to the OpenGL/ES 2.0 documentation for glAttachShader().

void QGLFunctions::glBindAttribLocation ( GLuint  program,
GLuint  index,
const char *  name 
)
inline

Equivalent to calling glBindAttribLocation(program, index, name). This method will do nothing on OpenGL/ES 1.x systems.

For more information, refer to the OpenGL/ES 2.0 documentation for glBindAttribLocation().

void QGLFunctions::glBindBuffer ( GLenum  target,
GLuint  buffer 
)
inline

Equivalent to calling glBindBuffer(target, buffer).

For more information, refer to the OpenGL/ES 2.0 documentation for glBindBuffer().

void QGLFunctions::glBindFramebuffer ( GLenum  target,
GLuint  framebuffer 
)
inline

Equivalent to calling glBindFramebuffer(target, framebuffer).

For more information, refer to the OpenGL/ES 2.0 documentation for glBindFramebuffer().

void QGLFunctions::glBindRenderbuffer ( GLenum  target,
GLuint  renderbuffer 
)
inline

Equivalent to calling glBindRenderbuffer(target, renderbuffer).

For more information, refer to the OpenGL/ES 2.0 documentation for glBindRenderbuffer().

void QGLFunctions::glBlendColor ( GLclampf  red,
GLclampf  green,
GLclampf  blue,
GLclampf  alpha 
)
inline

Equivalent to calling glBlendColor(red, green, blue, alpha).

For more information, refer to the OpenGL/ES 2.0 documentation for glBlendColor().

void QGLFunctions::glBlendEquation ( GLenum  mode)
inline

Convenience function that calls glBlendEquation(mode).

For more information, refer to the OpenGL/ES 2.0 documentation for glBlendEquation().

void QGLFunctions::glBlendEquationSeparate ( GLenum  modeRGB,
GLenum  modeAlpha 
)
inline

Equivalent to calling glBlendEquationSeparate(modeRGB, modeAlpha).

For more information, refer to the OpenGL/ES 2.0 documentation for glBlendEquationSeparate().

void QGLFunctions::glBlendFuncSeparate ( GLenum  srcRGB,
GLenum  dstRGB,
GLenum  srcAlpha,
GLenum  dstAlpha 
)
inline

Equivalent to calling glBlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha).

For more information, refer to the OpenGL/ES 2.0 documentation for glBlendFuncSeparate().

void QGLFunctions::glBufferData ( GLenum  target,
qopengl_GLsizeiptr  size,
const void *  data,
GLenum  usage 
)
inline

Equivalent to calling glBufferData(target, size, data, usage).

For more information, refer to the OpenGL/ES 2.0 documentation for glBufferData().

void QGLFunctions::glBufferSubData ( GLenum  target,
qopengl_GLintptr  offset,
qopengl_GLsizeiptr  size,
const void *  data 
)
inline

Equivalent to calling glBufferSubData(target, offset, size, data).

For more information, refer to the OpenGL/ES 2.0 documentation for glBufferSubData().

GLenum QGLFunctions::glCheckFramebufferStatus ( GLenum  target)
inline

Equivalent to calling glCheckFramebufferStatus(target).

For more information, refer to the OpenGL/ES 2.0 documentation for glCheckFramebufferStatus().

void QGLFunctions::glClearDepthf ( GLclampf  depth)
inline

Equivalent to calling glClearDepth(depth) on desktop OpenGL systems and glClearDepthf(depth) on embedded OpenGL/ES systems.

For more information, refer to the OpenGL/ES 2.0 documentation for glClearDepthf().

void QGLFunctions::glCompileShader ( GLuint  shader)
inline

Equivalent to calling glCompileShader(shader). This method will do nothing on OpenGL/ES 1.x systems.

For more information, refer to the OpenGL/ES 2.0 documentation for glCompileShader().

void QGLFunctions::glCompressedTexImage2D ( GLenum  target,
GLint  level,
GLenum  internalformat,
GLsizei  width,
GLsizei  height,
GLint  border,
GLsizei  imageSize,
const void *  data 
)
inline

Equivalent to calling glCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data).

For more information, refer to the OpenGL/ES 2.0 documentation for glCompressedTexImage2D().

void QGLFunctions::glCompressedTexSubImage2D ( GLenum  target,
GLint  level,
GLint  xoffset,
GLint  yoffset,
GLsizei  width,
GLsizei  height,
GLenum  format,
GLsizei  imageSize,
const void *  data 
)
inline

Equivalent to calling glCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data).

For more information, refer to the OpenGL/ES 2.0 documentation for glCompressedTexSubImage2D().

GLuint QGLFunctions::glCreateProgram ( )
inline

Equivalent to calling glCreateProgram(). This method will do nothing on OpenGL/ES 1.x systems.

For more information, refer to the OpenGL/ES 2.0 documentation for glCreateProgram().

GLuint QGLFunctions::glCreateShader ( GLenum  type)
inline

Equivalent to calling glCreateShader(type). This method will do nothing on OpenGL/ES 1.x systems.

For more information, refer to the OpenGL/ES 2.0 documentation for glCreateShader().

void QGLFunctions::glDeleteBuffers ( GLsizei  n,
const GLuint *  buffers 
)
inline

Equivalent to calling glDeleteBuffers(n, buffers).

For more information, refer to the OpenGL/ES 2.0 documentation for glDeleteBuffers().

void QGLFunctions::glDeleteFramebuffers ( GLsizei  n,
const GLuint *  framebuffers 
)
inline

Equivalent to calling glDeleteFramebuffers(n, framebuffers).

For more information, refer to the OpenGL/ES 2.0 documentation for glDeleteFramebuffers().

void QGLFunctions::glDeleteProgram ( GLuint  program)
inline

Equivalent to calling glDeleteProgram(program). This method will do nothing on OpenGL/ES 1.x systems.

For more information, refer to the OpenGL/ES 2.0 documentation for glDeleteProgram().

void QGLFunctions::glDeleteRenderbuffers ( GLsizei  n,
const GLuint *  renderbuffers 
)
inline

Equivalent to calling glDeleteRenderbuffers(n, renderbuffers).

For more information, refer to the OpenGL/ES 2.0 documentation for glDeleteRenderbuffers().

void QGLFunctions::glDeleteShader ( GLuint  shader)
inline

Equivalent to calling glDeleteShader(shader). This method will do nothing on OpenGL/ES 1.x systems.

For more information, refer to the OpenGL/ES 2.0 documentation for glDeleteShader().

void QGLFunctions::glDepthRangef ( GLclampf  zNear,
GLclampf  zFar 
)
inline

Equivalent to calling glDepthRange(zNear, zFar) on desktop OpenGL systems and glDepthRangef(zNear, zFar) on embedded OpenGL/ES systems.

For more information, refer to the OpenGL/ES 2.0 documentation for glDepthRangef().

void QGLFunctions::glDetachShader ( GLuint  program,
GLuint  shader 
)
inline

Equivalent to calling glDetachShader(program, shader). This method will do nothing on OpenGL/ES 1.x systems.

For more information, refer to the OpenGL/ES 2.0 documentation for glDetachShader().

void QGLFunctions::glDisableVertexAttribArray ( GLuint  index)
inline

Equivalent to calling glDisableVertexAttribArray(index). This method will do nothing on OpenGL/ES 1.x systems.

For more information, refer to the OpenGL/ES 2.0 documentation for glDisableVertexAttribArray().

void QGLFunctions::glEnableVertexAttribArray ( GLuint  index)
inline

Equivalent to calling glEnableVertexAttribArray(index). This method will do nothing on OpenGL/ES 1.x systems.

For more information, refer to the OpenGL/ES 2.0 documentation for glEnableVertexAttribArray().

void QGLFunctions::glFramebufferRenderbuffer ( GLenum  target,
GLenum  attachment,
GLenum  renderbuffertarget,
GLuint  renderbuffer 
)
inline

Equivalent to calling glFramebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer).

For more information, refer to the OpenGL/ES 2.0 documentation for glFramebufferRenderbuffer().

void QGLFunctions::glFramebufferTexture2D ( GLenum  target,
GLenum  attachment,
GLenum  textarget,
GLuint  texture,
GLint  level 
)
inline

Equivalent to calling glFramebufferTexture2D(target, attachment, textarget, texture, level).

For more information, refer to the OpenGL/ES 2.0 documentation for glFramebufferTexture2D().

void QGLFunctions::glGenBuffers ( GLsizei  n,
GLuint *  buffers 
)
inline

Equivalent to calling glGenBuffers(n, buffers).

For more information, refer to the OpenGL/ES 2.0 documentation for glGenBuffers().

void QGLFunctions::glGenerateMipmap ( GLenum  target)
inline

Equivalent to calling glGenerateMipmap(target).

For more information, refer to the OpenGL/ES 2.0 documentation for glGenerateMipmap().

void QGLFunctions::glGenFramebuffers ( GLsizei  n,
GLuint *  framebuffers 
)
inline

Equivalent to calling glGenFramebuffers(n, framebuffers).

For more information, refer to the OpenGL/ES 2.0 documentation for glGenFramebuffers().

void QGLFunctions::glGenRenderbuffers ( GLsizei  n,
GLuint *  renderbuffers 
)
inline

Equivalent to calling glGenRenderbuffers(n, renderbuffers).

For more information, refer to the OpenGL/ES 2.0 documentation for glGenRenderbuffers().

void QGLFunctions::glGetActiveAttrib ( GLuint  program,
GLuint  index,
GLsizei  bufsize,
GLsizei *  length,
GLint *  size,
GLenum *  type,
char *  name 
)
inline

Equivalent to calling glGetActiveAttrib(program, index, bufsize, length, size, type, name). This method will do nothing on OpenGL/ES 1.x systems.

For more information, refer to the OpenGL/ES 2.0 documentation for glGetActiveAttrib().

void QGLFunctions::glGetActiveUniform ( GLuint  program,
GLuint  index,
GLsizei  bufsize,
GLsizei *  length,
GLint *  size,
GLenum *  type,
char *  name 
)
inline

Equivalent to calling glGetActiveUniform(program, index, bufsize, length, size, type, name). This method will do nothing on OpenGL/ES 1.x systems.

For more information, refer to the OpenGL/ES 2.0 documentation for glGetActiveUniform().

void QGLFunctions::glGetAttachedShaders ( GLuint  program,
GLsizei  maxcount,
GLsizei *  count,
GLuint *  shaders 
)
inline

Equivalent to calling glGetAttachedShaders(program, maxcount, count, shaders). This method will do nothing on OpenGL/ES 1.x systems.

For more information, refer to the OpenGL/ES 2.0 documentation for glGetAttachedShaders().

int QGLFunctions::glGetAttribLocation ( GLuint  program,
const char *  name 
)
inline

Equivalent to calling glGetAttribLocation(program, name). This method will do nothing on OpenGL/ES 1.x systems.

For more information, refer to the OpenGL/ES 2.0 documentation for glGetAttribLocation().

void QGLFunctions::glGetBufferParameteriv ( GLenum  target,
GLenum  pname,
GLint *  params 
)
inline

Equivalent to calling glGetBufferParameteriv(target, pname, params). This method will do nothing on OpenGL/ES 1.x systems.

For more information, refer to the OpenGL/ES 2.0 documentation for glGetBufferParameteriv().

void QGLFunctions::glGetFramebufferAttachmentParameteriv ( GLenum  target,
GLenum  attachment,
GLenum  pname,
GLint *  params 
)
inline

Equivalent to calling glGetFramebufferAttachmentParameteriv(target, attachment, pname, params).

For more information, refer to the OpenGL/ES 2.0 documentation for glGetFramebufferAttachmentParameteriv().

void QGLFunctions::glGetProgramInfoLog ( GLuint  program,
GLsizei  bufsize,
GLsizei *  length,
char *  infolog 
)
inline

Equivalent to calling glGetProgramInfoLog(program, bufsize, length, infolog). This method will do nothing on OpenGL/ES 1.x systems.

For more information, refer to the OpenGL/ES 2.0 documentation for glGetProgramInfoLog().

void QGLFunctions::glGetProgramiv ( GLuint  program,
GLenum  pname,
GLint *  params 
)
inline

Equivalent to calling glGetProgramiv(program, pname, params). This method will do nothing on OpenGL/ES 1.x systems.

For more information, refer to the OpenGL/ES 2.0 documentation for glGetProgramiv().

void QGLFunctions::glGetRenderbufferParameteriv ( GLenum  target,
GLenum  pname,
GLint *  params 
)
inline

Equivalent to calling glGetRenderbufferParameteriv(target, pname, params).

For more information, refer to the OpenGL/ES 2.0 documentation for glGetRenderbufferParameteriv().

void QGLFunctions::glGetShaderInfoLog ( GLuint  shader,
GLsizei  bufsize,
GLsizei *  length,
char *  infolog 
)
inline

Equivalent to calling glGetShaderInfoLog(shader, bufsize, length, infolog). This method will do nothing on OpenGL/ES 1.x systems.

For more information, refer to the OpenGL/ES 2.0 documentation for glGetShaderInfoLog().

void QGLFunctions::glGetShaderiv ( GLuint  shader,
GLenum  pname,
GLint *  params 
)
inline

Equivalent to calling glGetShaderiv(shader, pname, params). This method will do nothing on OpenGL/ES 1.x systems.

For more information, refer to the OpenGL/ES 2.0 documentation for glGetShaderiv().

void QGLFunctions::glGetShaderPrecisionFormat ( GLenum  shadertype,
GLenum  precisiontype,
GLint *  range,
GLint *  precision 
)
inline

Equivalent to calling glGetShaderPrecisionFormat(shadertype, precisiontype, range, precision). This method will do nothing on OpenGL/ES 1.x systems.

For more information, refer to the OpenGL/ES 2.0 documentation for glGetShaderPrecisionFormat().

void QGLFunctions::glGetShaderSource ( GLuint  shader,
GLsizei  bufsize,
GLsizei *  length,
char *  source 
)
inline

Equivalent to calling glGetShaderSource(shader, bufsize, length, source). This method will do nothing on OpenGL/ES 1.x systems.

For more information, refer to the OpenGL/ES 2.0 documentation for glGetShaderSource().

void QGLFunctions::glGetUniformfv ( GLuint  program,
GLint  location,
GLfloat *  params 
)
inline

Equivalent to calling glGetUniformfv(program, location, params). This method will do nothing on OpenGL/ES 1.x systems.

For more information, refer to the OpenGL/ES 2.0 documentation for glGetUniformfv().

void QGLFunctions::glGetUniformiv ( GLuint  program,
GLint  location,
GLint *  params 
)
inline

Equivalent to calling glGetUniformiv(program, location, params). This method will do nothing on OpenGL/ES 1.x systems.

For more information, refer to the OpenGL/ES 2.0 documentation for glGetUniformiv().

int QGLFunctions::glGetUniformLocation ( GLuint  program,
const char *  name 
)
inline

Equivalent to calling glGetUniformLocation(program, name). This method will do nothing on OpenGL/ES 1.x systems.

For more information, refer to the OpenGL/ES 2.0 documentation for glGetUniformLocation().

void QGLFunctions::glGetVertexAttribfv ( GLuint  index,
GLenum  pname,
GLfloat *  params 
)
inline

Equivalent to calling glGetVertexAttribfv(index, pname, params). This method will do nothing on OpenGL/ES 1.x systems.

For more information, refer to the OpenGL/ES 2.0 documentation for glGetVertexAttribfv().

void QGLFunctions::glGetVertexAttribiv ( GLuint  index,
GLenum  pname,
GLint *  params 
)
inline

Equivalent to calling glGetVertexAttribiv(index, pname, params). This method will do nothing on OpenGL/ES 1.x systems.

For more information, refer to the OpenGL/ES 2.0 documentation for glGetVertexAttribiv().

void QGLFunctions::glGetVertexAttribPointerv ( GLuint  index,
GLenum  pname,
void **  pointer 
)
inline

Equivalent to calling glGetVertexAttribPointerv(index, pname, pointer). This method will do nothing on OpenGL/ES 1.x systems.

For more information, refer to the OpenGL/ES 2.0 documentation for glGetVertexAttribPointerv().

GLboolean QGLFunctions::glIsBuffer ( GLuint  buffer)
inline

Equivalent to calling glIsBuffer(buffer).

For more information, refer to the OpenGL/ES 2.0 documentation for glIsBuffer().

GLboolean QGLFunctions::glIsFramebuffer ( GLuint  framebuffer)
inline

Equivalent to calling glIsFramebuffer(framebuffer).

For more information, refer to the OpenGL/ES 2.0 documentation for glIsFramebuffer().

GLboolean QGLFunctions::glIsProgram ( GLuint  program)
inline

Equivalent to calling glIsProgram(program). This method will do nothing on OpenGL/ES 1.x systems.

For more information, refer to the OpenGL/ES 2.0 documentation for glIsProgram().

GLboolean QGLFunctions::glIsRenderbuffer ( GLuint  renderbuffer)
inline

Equivalent to calling glIsRenderbuffer(renderbuffer).

For more information, refer to the OpenGL/ES 2.0 documentation for glIsRenderbuffer().

GLboolean QGLFunctions::glIsShader ( GLuint  shader)
inline

Equivalent to calling glIsShader(shader). This method will do nothing on OpenGL/ES 1.x systems.

For more information, refer to the OpenGL/ES 2.0 documentation for glIsShader().

void QGLFunctions::glLinkProgram ( GLuint  program)
inline

Equivalent to calling glLinkProgram(program). This method will do nothing on OpenGL/ES 1.x systems.

For more information, refer to the OpenGL/ES 2.0 documentation for glLinkProgram().

void QGLFunctions::glReleaseShaderCompiler ( )
inline

Equivalent to calling glReleaseShaderCompiler(). This method will do nothing on OpenGL/ES 1.x systems.

For more information, refer to the OpenGL/ES 2.0 documentation for glReleaseShaderCompiler().

void QGLFunctions::glRenderbufferStorage ( GLenum  target,
GLenum  internalformat,
GLsizei  width,
GLsizei  height 
)
inline

Equivalent to calling glRenderbufferStorage(target, internalformat, width, height).

For more information, refer to the OpenGL/ES 2.0 documentation for glRenderbufferStorage().

void QGLFunctions::glSampleCoverage ( GLclampf  value,
GLboolean  invert 
)
inline

Equivalent to calling glSampleCoverage(value, invert).

For more information, refer to the OpenGL/ES 2.0 documentation for glSampleCoverage().

void QGLFunctions::glShaderBinary ( GLint  n,
const GLuint *  shaders,
GLenum  binaryformat,
const void *  binary,
GLint  length 
)
inline

Equivalent to calling glShaderBinary(n, shaders, binaryformat, binary, length). This method will do nothing on OpenGL/ES 1.x systems.

For more information, refer to the OpenGL/ES 2.0 documentation for glShaderBinary().

void QGLFunctions::glShaderSource ( GLuint  shader,
GLsizei  count,
const char **  string,
const GLint *  length 
)
inline

Equivalent to calling glShaderSource(shader, count, string, length). This method will do nothing on OpenGL/ES 1.x systems.

For more information, refer to the OpenGL/ES 2.0 documentation for glShaderSource().

void QGLFunctions::glStencilFuncSeparate ( GLenum  face,
GLenum  func,
GLint  ref,
GLuint  mask 
)
inline

Equivalent to calling glStencilFuncSeparate(face, func, ref, mask). This method will do nothing on OpenGL/ES 1.x systems.

For more information, refer to the OpenGL/ES 2.0 documentation for glStencilFuncSeparate().

void QGLFunctions::glStencilMaskSeparate ( GLenum  face,
GLuint  mask 
)
inline

Equivalent to calling glStencilMaskSeparate(face, mask).

For more information, refer to the OpenGL/ES 2.0 documentation for glStencilMaskSeparate().

void QGLFunctions::glStencilOpSeparate ( GLenum  face,
GLenum  fail,
GLenum  zfail,
GLenum  zpass 
)
inline

Equivalent to calling glStencilOpSeparate(face, fail, zfail, zpass).

For more information, refer to the OpenGL/ES 2.0 documentation for glStencilOpSeparate().

void QGLFunctions::glUniform1f ( GLint  location,
GLfloat  x 
)
inline

Equivalent to calling glUniform1f(location, x). This method will do nothing on OpenGL/ES 1.x systems.

For more information, refer to the OpenGL/ES 2.0 documentation for glUniform1f().

void QGLFunctions::glUniform1fv ( GLint  location,
GLsizei  count,
const GLfloat *  v 
)
inline

Equivalent to calling glUniform1fv(location, count, v). This method will do nothing on OpenGL/ES 1.x systems.

For more information, refer to the OpenGL/ES 2.0 documentation for glUniform1fv().

void QGLFunctions::glUniform1i ( GLint  location,
GLint  x 
)
inline

Equivalent to calling glUniform1i(location, x). This method will do nothing on OpenGL/ES 1.x systems.

For more information, refer to the OpenGL/ES 2.0 documentation for glUniform1i().

void QGLFunctions::glUniform1iv ( GLint  location,
GLsizei  count,
const GLint *  v 
)
inline

Equivalent to calling glUniform1iv(location, count, v). This method will do nothing on OpenGL/ES 1.x systems.

For more information, refer to the OpenGL/ES 2.0 documentation for glUniform1iv().

void QGLFunctions::glUniform2f ( GLint  location,
GLfloat  x,
GLfloat  y 
)
inline

Equivalent to calling glUniform2f(location, x, y). This method will do nothing on OpenGL/ES 1.x systems.

For more information, refer to the OpenGL/ES 2.0 documentation for glUniform2f().

void QGLFunctions::glUniform2fv ( GLint  location,
GLsizei  count,
const GLfloat *  v 
)
inline

Equivalent to calling glUniform2fv(location, count, v). This method will do nothing on OpenGL/ES 1.x systems.

For more information, refer to the OpenGL/ES 2.0 documentation for glUniform2fv().

void QGLFunctions::glUniform2i ( GLint  location,
GLint  x,
GLint  y 
)
inline

Equivalent to calling glUniform2i(location, x, y). This method will do nothing on OpenGL/ES 1.x systems.

For more information, refer to the OpenGL/ES 2.0 documentation for glUniform2i().

void QGLFunctions::glUniform2iv ( GLint  location,
GLsizei  count,
const GLint *  v 
)
inline

Equivalent to calling glUniform2iv(location, count, v). This method will do nothing on OpenGL/ES 1.x systems.

For more information, refer to the OpenGL/ES 2.0 documentation for glUniform2iv().

void QGLFunctions::glUniform3f ( GLint  location,
GLfloat  x,
GLfloat  y,
GLfloat  z 
)
inline

Equivalent to calling glUniform3f(location, x, y, z). This method will do nothing on OpenGL/ES 1.x systems.

For more information, refer to the OpenGL/ES 2.0 documentation for glUniform3f().

void QGLFunctions::glUniform3fv ( GLint  location,
GLsizei  count,
const GLfloat *  v 
)
inline

Equivalent to calling glUniform3fv(location, count, v). This method will do nothing on OpenGL/ES 1.x systems.

For more information, refer to the OpenGL/ES 2.0 documentation for glUniform3fv().

void QGLFunctions::glUniform3i ( GLint  location,
GLint  x,
GLint  y,
GLint  z 
)
inline

Equivalent to calling glUniform3i(location, x, y, z). This method will do nothing on OpenGL/ES 1.x systems.

For more information, refer to the OpenGL/ES 2.0 documentation for glUniform3i().

void QGLFunctions::glUniform3iv ( GLint  location,
GLsizei  count,
const GLint *  v 
)
inline

Equivalent to calling glUniform3iv(location, count, v). This method will do nothing on OpenGL/ES 1.x systems.

For more information, refer to the OpenGL/ES 2.0 documentation for glUniform3iv().

void QGLFunctions::glUniform4f ( GLint  location,
GLfloat  x,
GLfloat  y,
GLfloat  z,
GLfloat  w 
)
inline

Equivalent to calling glUniform4f(location, x, y, z, w). This method will do nothing on OpenGL/ES 1.x systems.

For more information, refer to the OpenGL/ES 2.0 documentation for glUniform4f().

void QGLFunctions::glUniform4fv ( GLint  location,
GLsizei  count,
const GLfloat *  v 
)
inline

Equivalent to calling glUniform4fv(location, count, v). This method will do nothing on OpenGL/ES 1.x systems.

For more information, refer to the OpenGL/ES 2.0 documentation for glUniform4fv().

void QGLFunctions::glUniform4i ( GLint  location,
GLint  x,
GLint  y,
GLint  z,
GLint  w 
)
inline

Equivalent to calling glUniform4i(location, x, y, z, w). This method will do nothing on OpenGL/ES 1.x systems.

For more information, refer to the OpenGL/ES 2.0 documentation for glUniform4i().

void QGLFunctions::glUniform4iv ( GLint  location,
GLsizei  count,
const GLint *  v 
)
inline

Equivalent to calling glUniform4iv(location, count, v). This method will do nothing on OpenGL/ES 1.x systems.

For more information, refer to the OpenGL/ES 2.0 documentation for glUniform4iv().

void QGLFunctions::glUniformMatrix2fv ( GLint  location,
GLsizei  count,
GLboolean  transpose,
const GLfloat *  value 
)
inline

Equivalent to calling glUniformMatrix2fv(location, count, transpose, value). This method will do nothing on OpenGL/ES 1.x systems.

For more information, refer to the OpenGL/ES 2.0 documentation for glUniformMatrix2fv().

void QGLFunctions::glUniformMatrix3fv ( GLint  location,
GLsizei  count,
GLboolean  transpose,
const GLfloat *  value 
)
inline

Equivalent to calling glUniformMatrix3fv(location, count, transpose, value). This method will do nothing on OpenGL/ES 1.x systems.

For more information, refer to the OpenGL/ES 2.0 documentation for glUniformMatrix3fv().

void QGLFunctions::glUniformMatrix4fv ( GLint  location,
GLsizei  count,
GLboolean  transpose,
const GLfloat *  value 
)
inline

Equivalent to calling glUniformMatrix4fv(location, count, transpose, value). This method will do nothing on OpenGL/ES 1.x systems.

For more information, refer to the OpenGL/ES 2.0 documentation for glUniformMatrix4fv().

void QGLFunctions::glUseProgram ( GLuint  program)
inline

Equivalent to calling glUseProgram(program). This method will do nothing on OpenGL/ES 1.x systems.

For more information, refer to the OpenGL/ES 2.0 documentation for glUseProgram().

void QGLFunctions::glValidateProgram ( GLuint  program)
inline

Equivalent to calling glValidateProgram(program). This method will do nothing on OpenGL/ES 1.x systems.

For more information, refer to the OpenGL/ES 2.0 documentation for glValidateProgram().

void QGLFunctions::glVertexAttrib1f ( GLuint  indx,
GLfloat  x 
)
inline

Equivalent to calling glVertexAttrib1f(indx, x). This method will do nothing on OpenGL/ES 1.x systems.

For more information, refer to the OpenGL/ES 2.0 documentation for glVertexAttrib1f().

void QGLFunctions::glVertexAttrib1fv ( GLuint  indx,
const GLfloat *  values 
)
inline

Equivalent to calling glVertexAttrib1fv(indx, values). This method will do nothing on OpenGL/ES 1.x systems.

For more information, refer to the OpenGL/ES 2.0 documentation for glVertexAttrib1fv().

void QGLFunctions::glVertexAttrib2f ( GLuint  indx,
GLfloat  x,
GLfloat  y 
)
inline

Equivalent to calling glVertexAttrib2f(indx, x, y). This method will do nothing on OpenGL/ES 1.x systems.

For more information, refer to the OpenGL/ES 2.0 documentation for glVertexAttrib2f().

void QGLFunctions::glVertexAttrib2fv ( GLuint  indx,
const GLfloat *  values 
)
inline

Equivalent to calling glVertexAttrib2fv(indx, values). This method will do nothing on OpenGL/ES 1.x systems.

For more information, refer to the OpenGL/ES 2.0 documentation for glVertexAttrib2fv().

void QGLFunctions::glVertexAttrib3f ( GLuint  indx,
GLfloat  x,
GLfloat  y,
GLfloat  z 
)
inline

Equivalent to calling glVertexAttrib3f(indx, x, y, z). This method will do nothing on OpenGL/ES 1.x systems.

For more information, refer to the OpenGL/ES 2.0 documentation for glVertexAttrib3f().

void QGLFunctions::glVertexAttrib3fv ( GLuint  indx,
const GLfloat *  values 
)
inline

Equivalent to calling glVertexAttrib3fv(indx, values). This method will do nothing on OpenGL/ES 1.x systems.

For more information, refer to the OpenGL/ES 2.0 documentation for glVertexAttrib3fv().

void QGLFunctions::glVertexAttrib4f ( GLuint  indx,
GLfloat  x,
GLfloat  y,
GLfloat  z,
GLfloat  w 
)
inline

Equivalent to calling glVertexAttrib4f(indx, x, y, z, w). This method will do nothing on OpenGL/ES 1.x systems.

For more information, refer to the OpenGL/ES 2.0 documentation for glVertexAttrib4f().

void QGLFunctions::glVertexAttrib4fv ( GLuint  indx,
const GLfloat *  values 
)
inline

Equivalent to calling glVertexAttrib4fv(indx, values). This method will do nothing on OpenGL/ES 1.x systems.

For more information, refer to the OpenGL/ES 2.0 documentation for glVertexAttrib4fv().

void QGLFunctions::glVertexAttribPointer ( GLuint  indx,
GLint  size,
GLenum  type,
GLboolean  normalized,
GLsizei  stride,
const void *  ptr 
)
inline

Equivalent to calling glVertexAttribPointer(indx, size, type, normalized, stride, ptr). This method will do nothing on OpenGL/ES 1.x systems.

For more information, refer to the OpenGL/ES 2.0 documentation for glVertexAttribPointer().

bool QGLFunctions::hasOpenGLFeature ( QGLFunctions::OpenGLFeature  feature) const

Returns true if feature is present on this system's OpenGL implementation, false otherwise.

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

See also
openGLFeatures()
void QGLFunctions::initializeGLFunctions ( const QGLContext context = nullptr)

Initializes GL function resolution for context. If context is null, then the current QGLContext will be used.

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

QGLFunctions::OpenGLFeatures QGLFunctions::openGLFeatures ( ) const

Returns the set of features that are present on this system's OpenGL implementation. It is assumed that the QGLContext associated with this function resolver is current.

See also
hasOpenGLFeature()