157 #if QT_VERSION >= 0x040800 160 static void qt_gl_functions_free(
void *
data)
174 (qt_gl_functions_resource()->value(context));
175 #if QT_VERSION < 0x040800 178 qt_gl_functions_resource()->insert(context, funcs);
222 #if defined(QT_OPENGL_ES_2) 236 if (extensions.
match(
"GL_OES_texture_npot"))
238 if (extensions.
match(
"GL_IMG_texture_npot"))
241 #elif defined(QT_OPENGL_ES) 247 if (extensions.
match(
"GL_OES_framebuffer_object"))
249 if (extensions.
match(
"GL_OES_blend_equation_separate"))
251 if (extensions.
match(
"GL_OES_blend_func_separate"))
253 if (extensions.
match(
"GL_OES_blend_subtract"))
255 if (extensions.
match(
"GL_OES_texture_npot"))
257 if (extensions.
match(
"GL_IMG_texture_npot"))
266 if (extensions.
match(
"GL_ARB_multitexture"))
268 if (extensions.
match(
"GL_ARB_shader_objects"))
270 if (extensions.
match(
"GL_EXT_framebuffer_object") ||
271 extensions.
match(
"GL_ARB_framebuffer_object"))
273 if (extensions.
match(
"GL_EXT_blend_color"))
275 if (extensions.
match(
"GL_EXT_blend_equation_separate"))
277 if (extensions.
match(
"GL_EXT_blend_func_separate"))
279 if (extensions.
match(
"GL_EXT_blend_subtract"))
281 if (extensions.
match(
"GL_ARB_texture_compression"))
283 if (extensions.
match(
"GL_ARB_multisample"))
285 if (extensions.
match(
"GL_ARB_texture_non_power_of_two"))
328 return QGLFunctions::OpenGLFeatures(d->
m_features);
1512 #ifndef QT_OPENGL_ES_2 1521 funcs->activeTexture = (type_glActiveTexture)
1523 if (!funcs->activeTexture) {
1524 funcs->activeTexture = (type_glActiveTexture)
1525 context->getProcAddress(
QLatin1String(
"glActiveTextureARB"));
1528 if (funcs->activeTexture)
1529 funcs->activeTexture(texture);
1536 typedef void (
QGLF_APIENTRYP type_glAttachShader)(GLuint program, GLuint shader);
1541 funcs->attachShader = (type_glAttachShader)
1543 if (!funcs->attachShader) {
1544 funcs->attachShader = (type_glAttachShader)
1545 context->getProcAddress(
QLatin1String(
"glAttachObjectARB"));
1548 if (funcs->attachShader)
1549 funcs->attachShader(program, shader);
1561 funcs->bindAttribLocation = (type_glBindAttribLocation)
1562 context->getProcAddress(
QLatin1String(
"glBindAttribLocation"));
1563 if (!funcs->bindAttribLocation) {
1564 funcs->bindAttribLocation = (type_glBindAttribLocation)
1565 context->getProcAddress(
QLatin1String(
"glBindAttribLocationARB"));
1568 if (funcs->bindAttribLocation)
1569 funcs->bindAttribLocation(program, index, name);
1581 funcs->bindBuffer = (type_glBindBuffer)
1584 if (!funcs->bindBuffer) {
1585 funcs->bindBuffer = (type_glBindBuffer)
1589 if (!funcs->bindBuffer) {
1590 funcs->bindBuffer = (type_glBindBuffer)
1593 if (!funcs->bindBuffer) {
1594 funcs->bindBuffer = (type_glBindBuffer)
1598 if (funcs->bindBuffer)
1599 funcs->bindBuffer(target, buffer);
1611 funcs->bindFramebuffer = (type_glBindFramebuffer)
1612 context->getProcAddress(
QLatin1String(
"glBindFramebuffer"));
1614 if (!funcs->bindFramebuffer) {
1615 funcs->bindFramebuffer = (type_glBindFramebuffer)
1616 context->getProcAddress(
QLatin1String(
"glBindFramebufferOES"));
1619 if (!funcs->bindFramebuffer) {
1620 funcs->bindFramebuffer = (type_glBindFramebuffer)
1621 context->getProcAddress(
QLatin1String(
"glBindFramebufferEXT"));
1623 if (!funcs->bindFramebuffer) {
1624 funcs->bindFramebuffer = (type_glBindFramebuffer)
1625 context->getProcAddress(
QLatin1String(
"glBindFramebufferARB"));
1628 if (funcs->bindFramebuffer)
1629 funcs->bindFramebuffer(target, framebuffer);
1641 funcs->bindRenderbuffer = (type_glBindRenderbuffer)
1642 context->getProcAddress(
QLatin1String(
"glBindRenderbuffer"));
1644 if (!funcs->bindRenderbuffer) {
1645 funcs->bindRenderbuffer = (type_glBindRenderbuffer)
1646 context->getProcAddress(
QLatin1String(
"glBindRenderbufferOES"));
1649 if (!funcs->bindRenderbuffer) {
1650 funcs->bindRenderbuffer = (type_glBindRenderbuffer)
1651 context->getProcAddress(
QLatin1String(
"glBindRenderbufferEXT"));
1653 if (!funcs->bindRenderbuffer) {
1654 funcs->bindRenderbuffer = (type_glBindRenderbuffer)
1655 context->getProcAddress(
QLatin1String(
"glBindRenderbufferARB"));
1658 if (funcs->bindRenderbuffer)
1659 funcs->bindRenderbuffer(target, renderbuffer);
1671 funcs->blendColor = (type_glBlendColor)
1674 if (!funcs->blendColor) {
1675 funcs->blendColor = (type_glBlendColor)
1679 if (!funcs->blendColor) {
1680 funcs->blendColor = (type_glBlendColor)
1683 if (!funcs->blendColor) {
1684 funcs->blendColor = (type_glBlendColor)
1688 if (funcs->blendColor)
1689 funcs->blendColor(red, green, blue, alpha);
1701 funcs->blendEquation = (type_glBlendEquation)
1704 if (!funcs->blendEquation) {
1705 funcs->blendEquation = (type_glBlendEquation)
1706 context->getProcAddress(
QLatin1String(
"glBlendEquationOES"));
1709 if (!funcs->blendEquation) {
1710 funcs->blendEquation = (type_glBlendEquation)
1711 context->getProcAddress(
QLatin1String(
"glBlendEquationEXT"));
1713 if (!funcs->blendEquation) {
1714 funcs->blendEquation = (type_glBlendEquation)
1715 context->getProcAddress(
QLatin1String(
"glBlendEquationARB"));
1718 if (funcs->blendEquation)
1719 funcs->blendEquation(mode);
1731 funcs->blendEquationSeparate = (type_glBlendEquationSeparate)
1732 context->getProcAddress(
QLatin1String(
"glBlendEquationSeparate"));
1734 if (!funcs->blendEquationSeparate) {
1735 funcs->blendEquationSeparate = (type_glBlendEquationSeparate)
1736 context->getProcAddress(
QLatin1String(
"glBlendEquationSeparateOES"));
1739 if (!funcs->blendEquationSeparate) {
1740 funcs->blendEquationSeparate = (type_glBlendEquationSeparate)
1741 context->getProcAddress(
QLatin1String(
"glBlendEquationSeparateEXT"));
1743 if (!funcs->blendEquationSeparate) {
1744 funcs->blendEquationSeparate = (type_glBlendEquationSeparate)
1745 context->getProcAddress(
QLatin1String(
"glBlendEquationSeparateARB"));
1748 if (funcs->blendEquationSeparate)
1749 funcs->blendEquationSeparate(modeRGB, modeAlpha);
1761 funcs->blendFuncSeparate = (type_glBlendFuncSeparate)
1762 context->getProcAddress(
QLatin1String(
"glBlendFuncSeparate"));
1764 if (!funcs->blendFuncSeparate) {
1765 funcs->blendFuncSeparate = (type_glBlendFuncSeparate)
1766 context->getProcAddress(
QLatin1String(
"glBlendFuncSeparateOES"));
1769 if (!funcs->blendFuncSeparate) {
1770 funcs->blendFuncSeparate = (type_glBlendFuncSeparate)
1771 context->getProcAddress(
QLatin1String(
"glBlendFuncSeparateEXT"));
1773 if (!funcs->blendFuncSeparate) {
1774 funcs->blendFuncSeparate = (type_glBlendFuncSeparate)
1775 context->getProcAddress(
QLatin1String(
"glBlendFuncSeparateARB"));
1778 if (funcs->blendFuncSeparate)
1779 funcs->blendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha);
1791 funcs->bufferData = (type_glBufferData)
1794 if (!funcs->bufferData) {
1795 funcs->bufferData = (type_glBufferData)
1799 if (!funcs->bufferData) {
1800 funcs->bufferData = (type_glBufferData)
1803 if (!funcs->bufferData) {
1804 funcs->bufferData = (type_glBufferData)
1808 if (funcs->bufferData)
1809 funcs->bufferData(target, size, data, usage);
1821 funcs->bufferSubData = (type_glBufferSubData)
1824 if (!funcs->bufferSubData) {
1825 funcs->bufferSubData = (type_glBufferSubData)
1826 context->getProcAddress(
QLatin1String(
"glBufferSubDataOES"));
1829 if (!funcs->bufferSubData) {
1830 funcs->bufferSubData = (type_glBufferSubData)
1831 context->getProcAddress(
QLatin1String(
"glBufferSubDataEXT"));
1833 if (!funcs->bufferSubData) {
1834 funcs->bufferSubData = (type_glBufferSubData)
1835 context->getProcAddress(
QLatin1String(
"glBufferSubDataARB"));
1838 if (funcs->bufferSubData)
1839 funcs->bufferSubData(target, offset, size, data);
1851 funcs->checkFramebufferStatus = (type_glCheckFramebufferStatus)
1852 context->getProcAddress(
QLatin1String(
"glCheckFramebufferStatus"));
1854 if (!funcs->checkFramebufferStatus) {
1855 funcs->checkFramebufferStatus = (type_glCheckFramebufferStatus)
1856 context->getProcAddress(
QLatin1String(
"glCheckFramebufferStatusOES"));
1859 if (!funcs->checkFramebufferStatus) {
1860 funcs->checkFramebufferStatus = (type_glCheckFramebufferStatus)
1861 context->getProcAddress(
QLatin1String(
"glCheckFramebufferStatusEXT"));
1863 if (!funcs->checkFramebufferStatus) {
1864 funcs->checkFramebufferStatus = (type_glCheckFramebufferStatus)
1865 context->getProcAddress(
QLatin1String(
"glCheckFramebufferStatusARB"));
1868 if (funcs->checkFramebufferStatus)
1869 return funcs->checkFramebufferStatus(target);
1876 typedef void (
QGLF_APIENTRYP type_glCompileShader)(GLuint shader);
1881 funcs->compileShader = (type_glCompileShader)
1883 if (!funcs->compileShader) {
1884 funcs->compileShader = (type_glCompileShader)
1888 if (funcs->compileShader)
1889 funcs->compileShader(shader);
1901 funcs->compressedTexImage2D = (type_glCompressedTexImage2D)
1902 context->getProcAddress(
QLatin1String(
"glCompressedTexImage2D"));
1904 if (!funcs->compressedTexImage2D) {
1905 funcs->compressedTexImage2D = (type_glCompressedTexImage2D)
1906 context->getProcAddress(
QLatin1String(
"glCompressedTexImage2DOES"));
1909 if (!funcs->compressedTexImage2D) {
1910 funcs->compressedTexImage2D = (type_glCompressedTexImage2D)
1911 context->getProcAddress(
QLatin1String(
"glCompressedTexImage2DEXT"));
1913 if (!funcs->compressedTexImage2D) {
1914 funcs->compressedTexImage2D = (type_glCompressedTexImage2D)
1915 context->getProcAddress(
QLatin1String(
"glCompressedTexImage2DARB"));
1918 if (funcs->compressedTexImage2D)
1919 funcs->compressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data);
1931 funcs->compressedTexSubImage2D = (type_glCompressedTexSubImage2D)
1932 context->getProcAddress(
QLatin1String(
"glCompressedTexSubImage2D"));
1934 if (!funcs->compressedTexSubImage2D) {
1935 funcs->compressedTexSubImage2D = (type_glCompressedTexSubImage2D)
1936 context->getProcAddress(
QLatin1String(
"glCompressedTexSubImage2DOES"));
1939 if (!funcs->compressedTexSubImage2D) {
1940 funcs->compressedTexSubImage2D = (type_glCompressedTexSubImage2D)
1941 context->getProcAddress(
QLatin1String(
"glCompressedTexSubImage2DEXT"));
1943 if (!funcs->compressedTexSubImage2D) {
1944 funcs->compressedTexSubImage2D = (type_glCompressedTexSubImage2D)
1945 context->getProcAddress(
QLatin1String(
"glCompressedTexSubImage2DARB"));
1948 if (funcs->compressedTexSubImage2D)
1949 funcs->compressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data);
1961 funcs->createProgram = (type_glCreateProgram)
1963 if (!funcs->createProgram) {
1964 funcs->createProgram = (type_glCreateProgram)
1965 context->getProcAddress(
QLatin1String(
"glCreateProgramObjectARB"));
1968 if (funcs->createProgram)
1969 return funcs->createProgram();
1981 funcs->createShader = (type_glCreateShader)
1983 if (!funcs->createShader) {
1984 funcs->createShader = (type_glCreateShader)
1985 context->getProcAddress(
QLatin1String(
"glCreateShaderObjectARB"));
1988 if (funcs->createShader)
1989 return funcs->createShader(type);
2001 funcs->deleteBuffers = (type_glDeleteBuffers)
2004 if (!funcs->deleteBuffers) {
2005 funcs->deleteBuffers = (type_glDeleteBuffers)
2006 context->getProcAddress(
QLatin1String(
"glDeleteBuffersOES"));
2009 if (!funcs->deleteBuffers) {
2010 funcs->deleteBuffers = (type_glDeleteBuffers)
2011 context->getProcAddress(
QLatin1String(
"glDeleteBuffersEXT"));
2013 if (!funcs->deleteBuffers) {
2014 funcs->deleteBuffers = (type_glDeleteBuffers)
2015 context->getProcAddress(
QLatin1String(
"glDeleteBuffersARB"));
2018 if (funcs->deleteBuffers)
2019 funcs->deleteBuffers(n, buffers);
2031 funcs->deleteFramebuffers = (type_glDeleteFramebuffers)
2032 context->getProcAddress(
QLatin1String(
"glDeleteFramebuffers"));
2034 if (!funcs->deleteFramebuffers) {
2035 funcs->deleteFramebuffers = (type_glDeleteFramebuffers)
2036 context->getProcAddress(
QLatin1String(
"glDeleteFramebuffersOES"));
2039 if (!funcs->deleteFramebuffers) {
2040 funcs->deleteFramebuffers = (type_glDeleteFramebuffers)
2041 context->getProcAddress(
QLatin1String(
"glDeleteFramebuffersEXT"));
2043 if (!funcs->deleteFramebuffers) {
2044 funcs->deleteFramebuffers = (type_glDeleteFramebuffers)
2045 context->getProcAddress(
QLatin1String(
"glDeleteFramebuffersARB"));
2048 if (funcs->deleteFramebuffers)
2049 funcs->deleteFramebuffers(n, framebuffers);
2056 typedef void (
QGLF_APIENTRYP type_glDeleteProgram)(GLuint program);
2061 funcs->deleteProgram = (type_glDeleteProgram)
2063 if (!funcs->deleteProgram) {
2064 funcs->deleteProgram = (type_glDeleteProgram)
2065 context->getProcAddress(
QLatin1String(
"glDeleteObjectARB"));
2068 if (funcs->deleteProgram)
2069 funcs->deleteProgram(program);
2081 funcs->deleteRenderbuffers = (type_glDeleteRenderbuffers)
2082 context->getProcAddress(
QLatin1String(
"glDeleteRenderbuffers"));
2084 if (!funcs->deleteRenderbuffers) {
2085 funcs->deleteRenderbuffers = (type_glDeleteRenderbuffers)
2086 context->getProcAddress(
QLatin1String(
"glDeleteRenderbuffersOES"));
2089 if (!funcs->deleteRenderbuffers) {
2090 funcs->deleteRenderbuffers = (type_glDeleteRenderbuffers)
2091 context->getProcAddress(
QLatin1String(
"glDeleteRenderbuffersEXT"));
2093 if (!funcs->deleteRenderbuffers) {
2094 funcs->deleteRenderbuffers = (type_glDeleteRenderbuffers)
2095 context->getProcAddress(
QLatin1String(
"glDeleteRenderbuffersARB"));
2098 if (funcs->deleteRenderbuffers)
2099 funcs->deleteRenderbuffers(n, renderbuffers);
2106 typedef void (
QGLF_APIENTRYP type_glDeleteShader)(GLuint shader);
2111 funcs->deleteShader = (type_glDeleteShader)
2113 if (!funcs->deleteShader) {
2114 funcs->deleteShader = (type_glDeleteShader)
2115 context->getProcAddress(
QLatin1String(
"glDeleteObjectARB"));
2118 if (funcs->deleteShader)
2119 funcs->deleteShader(shader);
2126 typedef void (
QGLF_APIENTRYP type_glDetachShader)(GLuint program, GLuint shader);
2131 funcs->detachShader = (type_glDetachShader)
2133 if (!funcs->detachShader) {
2134 funcs->detachShader = (type_glDetachShader)
2135 context->getProcAddress(
QLatin1String(
"glDetachObjectARB"));
2138 if (funcs->detachShader)
2139 funcs->detachShader(program, shader);
2151 funcs->disableVertexAttribArray = (type_glDisableVertexAttribArray)
2152 context->getProcAddress(
QLatin1String(
"glDisableVertexAttribArray"));
2153 if (!funcs->disableVertexAttribArray) {
2154 funcs->disableVertexAttribArray = (type_glDisableVertexAttribArray)
2155 context->getProcAddress(
QLatin1String(
"glDisableVertexAttribArrayARB"));
2158 if (funcs->disableVertexAttribArray)
2159 funcs->disableVertexAttribArray(index);
2171 funcs->enableVertexAttribArray = (type_glEnableVertexAttribArray)
2172 context->getProcAddress(
QLatin1String(
"glEnableVertexAttribArray"));
2173 if (!funcs->enableVertexAttribArray) {
2174 funcs->enableVertexAttribArray = (type_glEnableVertexAttribArray)
2175 context->getProcAddress(
QLatin1String(
"glEnableVertexAttribArrayARB"));
2178 if (funcs->enableVertexAttribArray)
2179 funcs->enableVertexAttribArray(index);
2191 funcs->framebufferRenderbuffer = (type_glFramebufferRenderbuffer)
2192 context->getProcAddress(
QLatin1String(
"glFramebufferRenderbuffer"));
2194 if (!funcs->framebufferRenderbuffer) {
2195 funcs->framebufferRenderbuffer = (type_glFramebufferRenderbuffer)
2196 context->getProcAddress(
QLatin1String(
"glFramebufferRenderbufferOES"));
2199 if (!funcs->framebufferRenderbuffer) {
2200 funcs->framebufferRenderbuffer = (type_glFramebufferRenderbuffer)
2201 context->getProcAddress(
QLatin1String(
"glFramebufferRenderbufferEXT"));
2203 if (!funcs->framebufferRenderbuffer) {
2204 funcs->framebufferRenderbuffer = (type_glFramebufferRenderbuffer)
2205 context->getProcAddress(
QLatin1String(
"glFramebufferRenderbufferARB"));
2208 if (funcs->framebufferRenderbuffer)
2209 funcs->framebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer);
2221 funcs->framebufferTexture2D = (type_glFramebufferTexture2D)
2222 context->getProcAddress(
QLatin1String(
"glFramebufferTexture2D"));
2224 if (!funcs->framebufferTexture2D) {
2225 funcs->framebufferTexture2D = (type_glFramebufferTexture2D)
2226 context->getProcAddress(
QLatin1String(
"glFramebufferTexture2DOES"));
2229 if (!funcs->framebufferTexture2D) {
2230 funcs->framebufferTexture2D = (type_glFramebufferTexture2D)
2231 context->getProcAddress(
QLatin1String(
"glFramebufferTexture2DEXT"));
2233 if (!funcs->framebufferTexture2D) {
2234 funcs->framebufferTexture2D = (type_glFramebufferTexture2D)
2235 context->getProcAddress(
QLatin1String(
"glFramebufferTexture2DARB"));
2238 if (funcs->framebufferTexture2D)
2239 funcs->framebufferTexture2D(target, attachment, textarget, texture, level);
2251 funcs->genBuffers = (type_glGenBuffers)
2254 if (!funcs->genBuffers) {
2255 funcs->genBuffers = (type_glGenBuffers)
2259 if (!funcs->genBuffers) {
2260 funcs->genBuffers = (type_glGenBuffers)
2263 if (!funcs->genBuffers) {
2264 funcs->genBuffers = (type_glGenBuffers)
2268 if (funcs->genBuffers)
2269 funcs->genBuffers(n, buffers);
2281 funcs->generateMipmap = (type_glGenerateMipmap)
2284 if (!funcs->generateMipmap) {
2285 funcs->generateMipmap = (type_glGenerateMipmap)
2286 context->getProcAddress(
QLatin1String(
"glGenerateMipmapOES"));
2289 if (!funcs->generateMipmap) {
2290 funcs->generateMipmap = (type_glGenerateMipmap)
2291 context->getProcAddress(
QLatin1String(
"glGenerateMipmapEXT"));
2293 if (!funcs->generateMipmap) {
2294 funcs->generateMipmap = (type_glGenerateMipmap)
2295 context->getProcAddress(
QLatin1String(
"glGenerateMipmapARB"));
2298 if (funcs->generateMipmap)
2299 funcs->generateMipmap(target);
2311 funcs->genFramebuffers = (type_glGenFramebuffers)
2312 context->getProcAddress(
QLatin1String(
"glGenFramebuffers"));
2314 if (!funcs->genFramebuffers) {
2315 funcs->genFramebuffers = (type_glGenFramebuffers)
2316 context->getProcAddress(
QLatin1String(
"glGenFramebuffersOES"));
2319 if (!funcs->genFramebuffers) {
2320 funcs->genFramebuffers = (type_glGenFramebuffers)
2321 context->getProcAddress(
QLatin1String(
"glGenFramebuffersEXT"));
2323 if (!funcs->genFramebuffers) {
2324 funcs->genFramebuffers = (type_glGenFramebuffers)
2325 context->getProcAddress(
QLatin1String(
"glGenFramebuffersARB"));
2328 if (funcs->genFramebuffers)
2329 funcs->genFramebuffers(n, framebuffers);
2341 funcs->genRenderbuffers = (type_glGenRenderbuffers)
2342 context->getProcAddress(
QLatin1String(
"glGenRenderbuffers"));
2344 if (!funcs->genRenderbuffers) {
2345 funcs->genRenderbuffers = (type_glGenRenderbuffers)
2346 context->getProcAddress(
QLatin1String(
"glGenRenderbuffersOES"));
2349 if (!funcs->genRenderbuffers) {
2350 funcs->genRenderbuffers = (type_glGenRenderbuffers)
2351 context->getProcAddress(
QLatin1String(
"glGenRenderbuffersEXT"));
2353 if (!funcs->genRenderbuffers) {
2354 funcs->genRenderbuffers = (type_glGenRenderbuffers)
2355 context->getProcAddress(
QLatin1String(
"glGenRenderbuffersARB"));
2358 if (funcs->genRenderbuffers)
2359 funcs->genRenderbuffers(n, renderbuffers);
2371 funcs->getActiveAttrib = (type_glGetActiveAttrib)
2372 context->getProcAddress(
QLatin1String(
"glGetActiveAttrib"));
2373 if (!funcs->getActiveAttrib) {
2374 funcs->getActiveAttrib = (type_glGetActiveAttrib)
2375 context->getProcAddress(
QLatin1String(
"glGetActiveAttribARB"));
2378 if (funcs->getActiveAttrib)
2379 funcs->getActiveAttrib(program, index, bufsize, length, size, type, name);
2391 funcs->getActiveUniform = (type_glGetActiveUniform)
2392 context->getProcAddress(
QLatin1String(
"glGetActiveUniform"));
2393 if (!funcs->getActiveUniform) {
2394 funcs->getActiveUniform = (type_glGetActiveUniform)
2395 context->getProcAddress(
QLatin1String(
"glGetActiveUniformARB"));
2398 if (funcs->getActiveUniform)
2399 funcs->getActiveUniform(program, index, bufsize, length, size, type, name);
2411 funcs->getAttachedShaders = (type_glGetAttachedShaders)
2412 context->getProcAddress(
QLatin1String(
"glGetAttachedShaders"));
2413 if (!funcs->getAttachedShaders) {
2414 funcs->getAttachedShaders = (type_glGetAttachedShaders)
2415 context->getProcAddress(
QLatin1String(
"glGetAttachedObjectsARB"));
2418 if (funcs->getAttachedShaders)
2419 funcs->getAttachedShaders(program, maxcount, count, shaders);
2426 typedef int (
QGLF_APIENTRYP type_glGetAttribLocation)(GLuint program,
const char*
name);
2431 funcs->getAttribLocation = (type_glGetAttribLocation)
2432 context->getProcAddress(
QLatin1String(
"glGetAttribLocation"));
2433 if (!funcs->getAttribLocation) {
2434 funcs->getAttribLocation = (type_glGetAttribLocation)
2435 context->getProcAddress(
QLatin1String(
"glGetAttribLocationARB"));
2438 if (funcs->getAttribLocation)
2439 return funcs->getAttribLocation(program, name);
2451 funcs->getBufferParameteriv = (type_glGetBufferParameteriv)
2452 context->getProcAddress(
QLatin1String(
"glGetBufferParameteriv"));
2454 if (!funcs->getBufferParameteriv) {
2455 funcs->getBufferParameteriv = (type_glGetBufferParameteriv)
2456 context->getProcAddress(
QLatin1String(
"glGetBufferParameterivOES"));
2459 if (!funcs->getBufferParameteriv) {
2460 funcs->getBufferParameteriv = (type_glGetBufferParameteriv)
2461 context->getProcAddress(
QLatin1String(
"glGetBufferParameterivEXT"));
2463 if (!funcs->getBufferParameteriv) {
2464 funcs->getBufferParameteriv = (type_glGetBufferParameteriv)
2465 context->getProcAddress(
QLatin1String(
"glGetBufferParameterivARB"));
2468 if (funcs->getBufferParameteriv)
2469 funcs->getBufferParameteriv(target, pname, params);
2481 funcs->getFramebufferAttachmentParameteriv = (type_glGetFramebufferAttachmentParameteriv)
2482 context->getProcAddress(
QLatin1String(
"glGetFramebufferAttachmentParameteriv"));
2484 if (!funcs->getFramebufferAttachmentParameteriv) {
2485 funcs->getFramebufferAttachmentParameteriv = (type_glGetFramebufferAttachmentParameteriv)
2486 context->getProcAddress(
QLatin1String(
"glGetFramebufferAttachmentParameterivOES"));
2489 if (!funcs->getFramebufferAttachmentParameteriv) {
2490 funcs->getFramebufferAttachmentParameteriv = (type_glGetFramebufferAttachmentParameteriv)
2491 context->getProcAddress(
QLatin1String(
"glGetFramebufferAttachmentParameterivEXT"));
2493 if (!funcs->getFramebufferAttachmentParameteriv) {
2494 funcs->getFramebufferAttachmentParameteriv = (type_glGetFramebufferAttachmentParameteriv)
2495 context->getProcAddress(
QLatin1String(
"glGetFramebufferAttachmentParameterivARB"));
2498 if (funcs->getFramebufferAttachmentParameteriv)
2499 funcs->getFramebufferAttachmentParameteriv(target, attachment, pname, params);
2511 funcs->getProgramiv = (type_glGetProgramiv)
2513 if (!funcs->getProgramiv) {
2514 funcs->getProgramiv = (type_glGetProgramiv)
2515 context->getProcAddress(
QLatin1String(
"glGetObjectParameterivARB"));
2518 if (funcs->getProgramiv)
2519 funcs->getProgramiv(program, pname, params);
2531 funcs->getProgramInfoLog = (type_glGetProgramInfoLog)
2532 context->getProcAddress(
QLatin1String(
"glGetProgramInfoLog"));
2533 if (!funcs->getProgramInfoLog) {
2534 funcs->getProgramInfoLog = (type_glGetProgramInfoLog)
2538 if (funcs->getProgramInfoLog)
2539 funcs->getProgramInfoLog(program, bufsize, length, infolog);
2551 funcs->getRenderbufferParameteriv = (type_glGetRenderbufferParameteriv)
2552 context->getProcAddress(
QLatin1String(
"glGetRenderbufferParameteriv"));
2554 if (!funcs->getRenderbufferParameteriv) {
2555 funcs->getRenderbufferParameteriv = (type_glGetRenderbufferParameteriv)
2556 context->getProcAddress(
QLatin1String(
"glGetRenderbufferParameterivOES"));
2559 if (!funcs->getRenderbufferParameteriv) {
2560 funcs->getRenderbufferParameteriv = (type_glGetRenderbufferParameteriv)
2561 context->getProcAddress(
QLatin1String(
"glGetRenderbufferParameterivEXT"));
2563 if (!funcs->getRenderbufferParameteriv) {
2564 funcs->getRenderbufferParameteriv = (type_glGetRenderbufferParameteriv)
2565 context->getProcAddress(
QLatin1String(
"glGetRenderbufferParameterivARB"));
2568 if (funcs->getRenderbufferParameteriv)
2569 funcs->getRenderbufferParameteriv(target, pname, params);
2581 funcs->getShaderiv = (type_glGetShaderiv)
2583 if (!funcs->getShaderiv) {
2584 funcs->getShaderiv = (type_glGetShaderiv)
2585 context->getProcAddress(
QLatin1String(
"glGetObjectParameterivARB"));
2588 if (funcs->getShaderiv)
2589 funcs->getShaderiv(shader, pname, params);
2601 funcs->getShaderInfoLog = (type_glGetShaderInfoLog)
2602 context->getProcAddress(
QLatin1String(
"glGetShaderInfoLog"));
2603 if (!funcs->getShaderInfoLog) {
2604 funcs->getShaderInfoLog = (type_glGetShaderInfoLog)
2608 if (funcs->getShaderInfoLog)
2609 funcs->getShaderInfoLog(shader, bufsize, length, infolog);
2618 range[0] = range[1] = precision[0] = 0;
2628 funcs->getShaderPrecisionFormat = (type_glGetShaderPrecisionFormat)
2629 context->getProcAddress(
QLatin1String(
"glGetShaderPrecisionFormat"));
2631 if (!funcs->getShaderPrecisionFormat) {
2632 funcs->getShaderPrecisionFormat = (type_glGetShaderPrecisionFormat)
2633 context->getProcAddress(
QLatin1String(
"glGetShaderPrecisionFormatOES"));
2636 if (!funcs->getShaderPrecisionFormat) {
2637 funcs->getShaderPrecisionFormat = (type_glGetShaderPrecisionFormat)
2638 context->getProcAddress(
QLatin1String(
"glGetShaderPrecisionFormatEXT"));
2640 if (!funcs->getShaderPrecisionFormat) {
2641 funcs->getShaderPrecisionFormat = (type_glGetShaderPrecisionFormat)
2642 context->getProcAddress(
QLatin1String(
"glGetShaderPrecisionFormatARB"));
2645 if (!funcs->getShaderPrecisionFormat)
2648 funcs->getShaderPrecisionFormat(shadertype, precisiontype, range, precision);
2658 funcs->getShaderSource = (type_glGetShaderSource)
2659 context->getProcAddress(
QLatin1String(
"glGetShaderSource"));
2660 if (!funcs->getShaderSource) {
2661 funcs->getShaderSource = (type_glGetShaderSource)
2662 context->getProcAddress(
QLatin1String(
"glGetShaderSourceARB"));
2665 if (funcs->getShaderSource)
2666 funcs->getShaderSource(shader, bufsize, length, source);
2678 funcs->getUniformfv = (type_glGetUniformfv)
2680 if (!funcs->getUniformfv) {
2681 funcs->getUniformfv = (type_glGetUniformfv)
2682 context->getProcAddress(
QLatin1String(
"glGetUniformfvARB"));
2685 if (funcs->getUniformfv)
2686 funcs->getUniformfv(program, location, params);
2698 funcs->getUniformiv = (type_glGetUniformiv)
2700 if (!funcs->getUniformiv) {
2701 funcs->getUniformiv = (type_glGetUniformiv)
2702 context->getProcAddress(
QLatin1String(
"glGetUniformivARB"));
2705 if (funcs->getUniformiv)
2706 funcs->getUniformiv(program, location, params);
2713 typedef int (
QGLF_APIENTRYP type_glGetUniformLocation)(GLuint program,
const char*
name);
2718 funcs->getUniformLocation = (type_glGetUniformLocation)
2719 context->getProcAddress(
QLatin1String(
"glGetUniformLocation"));
2720 if (!funcs->getUniformLocation) {
2721 funcs->getUniformLocation = (type_glGetUniformLocation)
2722 context->getProcAddress(
QLatin1String(
"glGetUniformLocationARB"));
2725 if (funcs->getUniformLocation)
2726 return funcs->getUniformLocation(program, name);
2738 funcs->getVertexAttribfv = (type_glGetVertexAttribfv)
2739 context->getProcAddress(
QLatin1String(
"glGetVertexAttribfv"));
2740 if (!funcs->getVertexAttribfv) {
2741 funcs->getVertexAttribfv = (type_glGetVertexAttribfv)
2742 context->getProcAddress(
QLatin1String(
"glGetVertexAttribfvARB"));
2745 if (funcs->getVertexAttribfv)
2746 funcs->getVertexAttribfv(index, pname, params);
2758 funcs->getVertexAttribiv = (type_glGetVertexAttribiv)
2759 context->getProcAddress(
QLatin1String(
"glGetVertexAttribiv"));
2760 if (!funcs->getVertexAttribiv) {
2761 funcs->getVertexAttribiv = (type_glGetVertexAttribiv)
2762 context->getProcAddress(
QLatin1String(
"glGetVertexAttribivARB"));
2765 if (funcs->getVertexAttribiv)
2766 funcs->getVertexAttribiv(index, pname, params);
2778 funcs->getVertexAttribPointerv = (type_glGetVertexAttribPointerv)
2779 context->getProcAddress(
QLatin1String(
"glGetVertexAttribPointerv"));
2780 if (!funcs->getVertexAttribPointerv) {
2781 funcs->getVertexAttribPointerv = (type_glGetVertexAttribPointerv)
2782 context->getProcAddress(
QLatin1String(
"glGetVertexAttribPointervARB"));
2785 if (funcs->getVertexAttribPointerv)
2786 funcs->getVertexAttribPointerv(index, pname, pointer);
2798 funcs->isBuffer = (type_glIsBuffer)
2801 if (!funcs->isBuffer) {
2802 funcs->isBuffer = (type_glIsBuffer)
2806 if (!funcs->isBuffer) {
2807 funcs->isBuffer = (type_glIsBuffer)
2810 if (!funcs->isBuffer) {
2811 funcs->isBuffer = (type_glIsBuffer)
2815 if (funcs->isBuffer)
2816 return funcs->isBuffer(buffer);
2828 funcs->isFramebuffer = (type_glIsFramebuffer)
2831 if (!funcs->isFramebuffer) {
2832 funcs->isFramebuffer = (type_glIsFramebuffer)
2833 context->getProcAddress(
QLatin1String(
"glIsFramebufferOES"));
2836 if (!funcs->isFramebuffer) {
2837 funcs->isFramebuffer = (type_glIsFramebuffer)
2838 context->getProcAddress(
QLatin1String(
"glIsFramebufferEXT"));
2840 if (!funcs->isFramebuffer) {
2841 funcs->isFramebuffer = (type_glIsFramebuffer)
2842 context->getProcAddress(
QLatin1String(
"glIsFramebufferARB"));
2845 if (funcs->isFramebuffer)
2846 return funcs->isFramebuffer(framebuffer);
2853 return program != 0;
2863 funcs->isProgram = (type_glIsProgram)
2865 if (!funcs->isProgram) {
2866 funcs->isProgram = (type_glIsProgram)
2870 if (!funcs->isProgram)
2873 return funcs->isProgram(program);
2883 funcs->isRenderbuffer = (type_glIsRenderbuffer)
2886 if (!funcs->isRenderbuffer) {
2887 funcs->isRenderbuffer = (type_glIsRenderbuffer)
2888 context->getProcAddress(
QLatin1String(
"glIsRenderbufferOES"));
2891 if (!funcs->isRenderbuffer) {
2892 funcs->isRenderbuffer = (type_glIsRenderbuffer)
2893 context->getProcAddress(
QLatin1String(
"glIsRenderbufferEXT"));
2895 if (!funcs->isRenderbuffer) {
2896 funcs->isRenderbuffer = (type_glIsRenderbuffer)
2897 context->getProcAddress(
QLatin1String(
"glIsRenderbufferARB"));
2900 if (funcs->isRenderbuffer)
2901 return funcs->isRenderbuffer(renderbuffer);
2918 funcs->isShader = (type_glIsShader)
2920 if (!funcs->isShader) {
2921 funcs->isShader = (type_glIsShader)
2925 if (!funcs->isShader)
2928 return funcs->isShader(shader);
2933 typedef void (
QGLF_APIENTRYP type_glLinkProgram)(GLuint program);
2938 funcs->linkProgram = (type_glLinkProgram)
2940 if (!funcs->linkProgram) {
2941 funcs->linkProgram = (type_glLinkProgram)
2945 if (funcs->linkProgram)
2946 funcs->linkProgram(program);
2962 funcs->releaseShaderCompiler = (type_glReleaseShaderCompiler)
2963 context->getProcAddress(
QLatin1String(
"glReleaseShaderCompiler"));
2964 if (!funcs->releaseShaderCompiler) {
2965 funcs->releaseShaderCompiler = (type_glReleaseShaderCompiler)
2966 context->getProcAddress(
QLatin1String(
"glReleaseShaderCompilerARB"));
2969 if (!funcs->releaseShaderCompiler)
2972 funcs->releaseShaderCompiler();
2982 funcs->renderbufferStorage = (type_glRenderbufferStorage)
2983 context->getProcAddress(
QLatin1String(
"glRenderbufferStorage"));
2985 if (!funcs->renderbufferStorage) {
2986 funcs->renderbufferStorage = (type_glRenderbufferStorage)
2987 context->getProcAddress(
QLatin1String(
"glRenderbufferStorageOES"));
2990 if (!funcs->renderbufferStorage) {
2991 funcs->renderbufferStorage = (type_glRenderbufferStorage)
2992 context->getProcAddress(
QLatin1String(
"glRenderbufferStorageEXT"));
2994 if (!funcs->renderbufferStorage) {
2995 funcs->renderbufferStorage = (type_glRenderbufferStorage)
2996 context->getProcAddress(
QLatin1String(
"glRenderbufferStorageARB"));
2999 if (funcs->renderbufferStorage)
3000 funcs->renderbufferStorage(target, internalformat, width, height);
3012 funcs->sampleCoverage = (type_glSampleCoverage)
3015 if (!funcs->sampleCoverage) {
3016 funcs->sampleCoverage = (type_glSampleCoverage)
3017 context->getProcAddress(
QLatin1String(
"glSampleCoverageOES"));
3020 if (!funcs->sampleCoverage) {
3021 funcs->sampleCoverage = (type_glSampleCoverage)
3022 context->getProcAddress(
QLatin1String(
"glSampleCoverageEXT"));
3024 if (!funcs->sampleCoverage) {
3025 funcs->sampleCoverage = (type_glSampleCoverage)
3026 context->getProcAddress(
QLatin1String(
"glSampleCoverageARB"));
3029 if (funcs->sampleCoverage)
3030 funcs->sampleCoverage(value, invert);
3042 funcs->shaderBinary = (type_glShaderBinary)
3044 if (!funcs->shaderBinary) {
3045 funcs->shaderBinary = (type_glShaderBinary)
3046 context->getProcAddress(
QLatin1String(
"glShaderBinaryARB"));
3049 if (funcs->shaderBinary)
3050 funcs->shaderBinary(n, shaders, binaryformat, binary, length);
3062 funcs->shaderSource = (type_glShaderSource)
3064 if (!funcs->shaderSource) {
3065 funcs->shaderSource = (type_glShaderSource)
3066 context->getProcAddress(
QLatin1String(
"glShaderSourceARB"));
3069 if (funcs->shaderSource)
3070 funcs->shaderSource(shader, count,
string, length);
3082 funcs->stencilFuncSeparate = (type_glStencilFuncSeparate)
3083 context->getProcAddress(
QLatin1String(
"glStencilFuncSeparate"));
3085 if (!funcs->stencilFuncSeparate) {
3086 funcs->stencilFuncSeparate = (type_glStencilFuncSeparate)
3087 context->getProcAddress(
QLatin1String(
"glStencilFuncSeparateOES"));
3090 if (!funcs->stencilFuncSeparate) {
3091 funcs->stencilFuncSeparate = (type_glStencilFuncSeparate)
3092 context->getProcAddress(
QLatin1String(
"glStencilFuncSeparateEXT"));
3094 if (!funcs->stencilFuncSeparate) {
3095 funcs->stencilFuncSeparate = (type_glStencilFuncSeparate)
3096 context->getProcAddress(
QLatin1String(
"glStencilFuncSeparateARB"));
3099 if (funcs->stencilFuncSeparate)
3100 funcs->stencilFuncSeparate(face, func, ref, mask);
3112 funcs->stencilMaskSeparate = (type_glStencilMaskSeparate)
3113 context->getProcAddress(
QLatin1String(
"glStencilMaskSeparate"));
3115 if (!funcs->stencilMaskSeparate) {
3116 funcs->stencilMaskSeparate = (type_glStencilMaskSeparate)
3117 context->getProcAddress(
QLatin1String(
"glStencilMaskSeparateOES"));
3120 if (!funcs->stencilMaskSeparate) {
3121 funcs->stencilMaskSeparate = (type_glStencilMaskSeparate)
3122 context->getProcAddress(
QLatin1String(
"glStencilMaskSeparateEXT"));
3124 if (!funcs->stencilMaskSeparate) {
3125 funcs->stencilMaskSeparate = (type_glStencilMaskSeparate)
3126 context->getProcAddress(
QLatin1String(
"glStencilMaskSeparateARB"));
3129 if (funcs->stencilMaskSeparate)
3130 funcs->stencilMaskSeparate(face, mask);
3142 funcs->stencilOpSeparate = (type_glStencilOpSeparate)
3143 context->getProcAddress(
QLatin1String(
"glStencilOpSeparate"));
3145 if (!funcs->stencilOpSeparate) {
3146 funcs->stencilOpSeparate = (type_glStencilOpSeparate)
3147 context->getProcAddress(
QLatin1String(
"glStencilOpSeparateOES"));
3150 if (!funcs->stencilOpSeparate) {
3151 funcs->stencilOpSeparate = (type_glStencilOpSeparate)
3152 context->getProcAddress(
QLatin1String(
"glStencilOpSeparateEXT"));
3154 if (!funcs->stencilOpSeparate) {
3155 funcs->stencilOpSeparate = (type_glStencilOpSeparate)
3156 context->getProcAddress(
QLatin1String(
"glStencilOpSeparateARB"));
3159 if (funcs->stencilOpSeparate)
3160 funcs->stencilOpSeparate(face, fail, zfail, zpass);
3172 funcs->uniform1f = (type_glUniform1f)
3174 if (!funcs->uniform1f) {
3175 funcs->uniform1f = (type_glUniform1f)
3179 if (funcs->uniform1f)
3180 funcs->uniform1f(location, x);
3192 funcs->uniform1fv = (type_glUniform1fv)
3194 if (!funcs->uniform1fv) {
3195 funcs->uniform1fv = (type_glUniform1fv)
3199 if (funcs->uniform1fv)
3200 funcs->uniform1fv(location, count, v);
3212 funcs->uniform1i = (type_glUniform1i)
3214 if (!funcs->uniform1i) {
3215 funcs->uniform1i = (type_glUniform1i)
3219 if (funcs->uniform1i)
3220 funcs->uniform1i(location, x);
3232 funcs->uniform1iv = (type_glUniform1iv)
3234 if (!funcs->uniform1iv) {
3235 funcs->uniform1iv = (type_glUniform1iv)
3239 if (funcs->uniform1iv)
3240 funcs->uniform1iv(location, count, v);
3252 funcs->uniform2f = (type_glUniform2f)
3254 if (!funcs->uniform2f) {
3255 funcs->uniform2f = (type_glUniform2f)
3259 if (funcs->uniform2f)
3260 funcs->uniform2f(location, x, y);
3272 funcs->uniform2fv = (type_glUniform2fv)
3274 if (!funcs->uniform2fv) {
3275 funcs->uniform2fv = (type_glUniform2fv)
3279 if (funcs->uniform2fv)
3280 funcs->uniform2fv(location, count, v);
3292 funcs->uniform2i = (type_glUniform2i)
3294 if (!funcs->uniform2i) {
3295 funcs->uniform2i = (type_glUniform2i)
3299 if (funcs->uniform2i)
3300 funcs->uniform2i(location, x, y);
3312 funcs->uniform2iv = (type_glUniform2iv)
3314 if (!funcs->uniform2iv) {
3315 funcs->uniform2iv = (type_glUniform2iv)
3319 if (funcs->uniform2iv)
3320 funcs->uniform2iv(location, count, v);
3332 funcs->uniform3f = (type_glUniform3f)
3334 if (!funcs->uniform3f) {
3335 funcs->uniform3f = (type_glUniform3f)
3339 if (funcs->uniform3f)
3340 funcs->uniform3f(location, x, y, z);
3352 funcs->uniform3fv = (type_glUniform3fv)
3354 if (!funcs->uniform3fv) {
3355 funcs->uniform3fv = (type_glUniform3fv)
3359 if (funcs->uniform3fv)
3360 funcs->uniform3fv(location, count, v);
3372 funcs->uniform3i = (type_glUniform3i)
3374 if (!funcs->uniform3i) {
3375 funcs->uniform3i = (type_glUniform3i)
3379 if (funcs->uniform3i)
3380 funcs->uniform3i(location, x, y, z);
3392 funcs->uniform3iv = (type_glUniform3iv)
3394 if (!funcs->uniform3iv) {
3395 funcs->uniform3iv = (type_glUniform3iv)
3399 if (funcs->uniform3iv)
3400 funcs->uniform3iv(location, count, v);
3412 funcs->uniform4f = (type_glUniform4f)
3414 if (!funcs->uniform4f) {
3415 funcs->uniform4f = (type_glUniform4f)
3419 if (funcs->uniform4f)
3420 funcs->uniform4f(location, x, y, z, w);
3432 funcs->uniform4fv = (type_glUniform4fv)
3434 if (!funcs->uniform4fv) {
3435 funcs->uniform4fv = (type_glUniform4fv)
3439 if (funcs->uniform4fv)
3440 funcs->uniform4fv(location, count, v);
3452 funcs->uniform4i = (type_glUniform4i)
3454 if (!funcs->uniform4i) {
3455 funcs->uniform4i = (type_glUniform4i)
3459 if (funcs->uniform4i)
3460 funcs->uniform4i(location, x, y, z, w);
3472 funcs->uniform4iv = (type_glUniform4iv)
3474 if (!funcs->uniform4iv) {
3475 funcs->uniform4iv = (type_glUniform4iv)
3479 if (funcs->uniform4iv)
3480 funcs->uniform4iv(location, count, v);
3492 funcs->uniformMatrix2fv = (type_glUniformMatrix2fv)
3493 context->getProcAddress(
QLatin1String(
"glUniformMatrix2fv"));
3494 if (!funcs->uniformMatrix2fv) {
3495 funcs->uniformMatrix2fv = (type_glUniformMatrix2fv)
3496 context->getProcAddress(
QLatin1String(
"glUniformMatrix2fvARB"));
3499 if (funcs->uniformMatrix2fv)
3500 funcs->uniformMatrix2fv(location, count, transpose, value);
3512 funcs->uniformMatrix3fv = (type_glUniformMatrix3fv)
3513 context->getProcAddress(
QLatin1String(
"glUniformMatrix3fv"));
3514 if (!funcs->uniformMatrix3fv) {
3515 funcs->uniformMatrix3fv = (type_glUniformMatrix3fv)
3516 context->getProcAddress(
QLatin1String(
"glUniformMatrix3fvARB"));
3519 if (funcs->uniformMatrix3fv)
3520 funcs->uniformMatrix3fv(location, count, transpose, value);
3532 funcs->uniformMatrix4fv = (type_glUniformMatrix4fv)
3533 context->getProcAddress(
QLatin1String(
"glUniformMatrix4fv"));
3534 if (!funcs->uniformMatrix4fv) {
3535 funcs->uniformMatrix4fv = (type_glUniformMatrix4fv)
3536 context->getProcAddress(
QLatin1String(
"glUniformMatrix4fvARB"));
3539 if (funcs->uniformMatrix4fv)
3540 funcs->uniformMatrix4fv(location, count, transpose, value);
3552 funcs->useProgram = (type_glUseProgram)
3554 if (!funcs->useProgram) {
3555 funcs->useProgram = (type_glUseProgram)
3556 context->getProcAddress(
QLatin1String(
"glUseProgramObjectARB"));
3559 if (funcs->useProgram)
3560 funcs->useProgram(program);
3567 typedef void (
QGLF_APIENTRYP type_glValidateProgram)(GLuint program);
3572 funcs->validateProgram = (type_glValidateProgram)
3573 context->getProcAddress(
QLatin1String(
"glValidateProgram"));
3574 if (!funcs->validateProgram) {
3575 funcs->validateProgram = (type_glValidateProgram)
3576 context->getProcAddress(
QLatin1String(
"glValidateProgramARB"));
3579 if (funcs->validateProgram)
3580 funcs->validateProgram(program);
3587 typedef void (
QGLF_APIENTRYP type_glVertexAttrib1f)(GLuint indx, GLfloat x);
3592 funcs->vertexAttrib1f = (type_glVertexAttrib1f)
3594 if (!funcs->vertexAttrib1f) {
3595 funcs->vertexAttrib1f = (type_glVertexAttrib1f)
3596 context->getProcAddress(
QLatin1String(
"glVertexAttrib1fARB"));
3599 if (funcs->vertexAttrib1f)
3600 funcs->vertexAttrib1f(indx, x);
3612 funcs->vertexAttrib1fv = (type_glVertexAttrib1fv)
3613 context->getProcAddress(
QLatin1String(
"glVertexAttrib1fv"));
3614 if (!funcs->vertexAttrib1fv) {
3615 funcs->vertexAttrib1fv = (type_glVertexAttrib1fv)
3616 context->getProcAddress(
QLatin1String(
"glVertexAttrib1fvARB"));
3619 if (funcs->vertexAttrib1fv)
3620 funcs->vertexAttrib1fv(indx, values);
3627 typedef void (
QGLF_APIENTRYP type_glVertexAttrib2f)(GLuint indx, GLfloat x, GLfloat y);
3632 funcs->vertexAttrib2f = (type_glVertexAttrib2f)
3634 if (!funcs->vertexAttrib2f) {
3635 funcs->vertexAttrib2f = (type_glVertexAttrib2f)
3636 context->getProcAddress(
QLatin1String(
"glVertexAttrib2fARB"));
3639 if (funcs->vertexAttrib2f)
3640 funcs->vertexAttrib2f(indx, x, y);
3652 funcs->vertexAttrib2fv = (type_glVertexAttrib2fv)
3653 context->getProcAddress(
QLatin1String(
"glVertexAttrib2fv"));
3654 if (!funcs->vertexAttrib2fv) {
3655 funcs->vertexAttrib2fv = (type_glVertexAttrib2fv)
3656 context->getProcAddress(
QLatin1String(
"glVertexAttrib2fvARB"));
3659 if (funcs->vertexAttrib2fv)
3660 funcs->vertexAttrib2fv(indx, values);
3667 typedef void (
QGLF_APIENTRYP type_glVertexAttrib3f)(GLuint indx, GLfloat x, GLfloat y, GLfloat z);
3672 funcs->vertexAttrib3f = (type_glVertexAttrib3f)
3674 if (!funcs->vertexAttrib3f) {
3675 funcs->vertexAttrib3f = (type_glVertexAttrib3f)
3676 context->getProcAddress(
QLatin1String(
"glVertexAttrib3fARB"));
3679 if (funcs->vertexAttrib3f)
3680 funcs->vertexAttrib3f(indx, x, y, z);
3692 funcs->vertexAttrib3fv = (type_glVertexAttrib3fv)
3693 context->getProcAddress(
QLatin1String(
"glVertexAttrib3fv"));
3694 if (!funcs->vertexAttrib3fv) {
3695 funcs->vertexAttrib3fv = (type_glVertexAttrib3fv)
3696 context->getProcAddress(
QLatin1String(
"glVertexAttrib3fvARB"));
3699 if (funcs->vertexAttrib3fv)
3700 funcs->vertexAttrib3fv(indx, values);
3707 typedef void (
QGLF_APIENTRYP type_glVertexAttrib4f)(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
3712 funcs->vertexAttrib4f = (type_glVertexAttrib4f)
3714 if (!funcs->vertexAttrib4f) {
3715 funcs->vertexAttrib4f = (type_glVertexAttrib4f)
3716 context->getProcAddress(
QLatin1String(
"glVertexAttrib4fARB"));
3719 if (funcs->vertexAttrib4f)
3720 funcs->vertexAttrib4f(indx, x, y, z, w);
3732 funcs->vertexAttrib4fv = (type_glVertexAttrib4fv)
3733 context->getProcAddress(
QLatin1String(
"glVertexAttrib4fv"));
3734 if (!funcs->vertexAttrib4fv) {
3735 funcs->vertexAttrib4fv = (type_glVertexAttrib4fv)
3736 context->getProcAddress(
QLatin1String(
"glVertexAttrib4fvARB"));
3739 if (funcs->vertexAttrib4fv)
3740 funcs->vertexAttrib4fv(indx, values);
3752 funcs->vertexAttribPointer = (type_glVertexAttribPointer)
3753 context->getProcAddress(
QLatin1String(
"glVertexAttribPointer"));
3754 if (!funcs->vertexAttribPointer) {
3755 funcs->vertexAttribPointer = (type_glVertexAttribPointer)
3756 context->getProcAddress(
QLatin1String(
"glVertexAttribPointerARB"));
3759 if (funcs->vertexAttribPointer)
3760 funcs->vertexAttribPointer(indx, size, type, normalized, stride, ptr);
3765 #endif // !QT_OPENGL_ES_2 3769 #ifndef QT_OPENGL_ES_2 3865 #endif // !QT_OPENGL_ES_2
static GLuint qglfResolveCreateShader(GLenum type)
QGLFunctionsPrivate * d_ptr
static void qglfResolveGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint *params)
QGLFunctions::OpenGLFeatures openGLFeatures() const
Returns the set of features that are present on this system's OpenGL implementation.
static void qglfResolveFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
#define QT_END_NAMESPACE
This macro expands to.
static void qglfResolveBindRenderbuffer(GLenum target, GLuint renderbuffer)
static void qglfResolveVertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z)
static GLboolean qglfSpecialIsProgram(GLuint program)
static void qglfResolveUniform3f(GLint location, GLfloat x, GLfloat y, GLfloat z)
static void qglfResolveGetProgramInfoLog(GLuint program, GLsizei bufsize, GLsizei *length, char *infolog)
static void qglfResolveUniform4i(GLint location, GLint x, GLint y, GLint z, GLint w)
static void qglfResolveBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha)
static void qglfResolveUniform4f(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
QGLFunctions()
Constructs a default function resolver.
QGLFunctionsPrivate(const QGLContext *context=0)
static void qglfResolveActiveTexture(GLenum texture)
static void qglfResolveUniform3i(GLint location, GLint x, GLint y, GLint z)
static void qglfResolveUseProgram(GLuint program)
static GLboolean qglfResolveIsBuffer(GLuint buffer)
static GLboolean qglfSpecialIsShader(GLuint shader)
static void qglfResolveGenFramebuffers(GLsizei n, GLuint *framebuffers)
static void qglfResolveUniform2iv(GLint location, GLsizei count, const GLint *v)
static int qglfResolveGetUniformLocation(GLuint program, const char *name)
OpenGLFeature
This enum defines OpenGL/ES 2.
static GLenum qglfResolveCheckFramebufferStatus(GLenum target)
static void qglfResolveGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision)
QGLFunctionsPrivateEx(const QGLContext *context=0)
static void qglfResolveUniform1iv(GLint location, GLsizei count, const GLint *v)
static void qglfResolveCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data)
static void qglfResolveGetActiveAttrib(GLuint program, GLuint index, GLsizei bufsize, GLsizei *length, GLint *size, GLenum *type, char *name)
static void qglfResolveGetUniformfv(GLuint program, GLint location, GLfloat *params)
static void qglfResolveBufferSubData(GLenum target, qgl_GLintptr offset, qgl_GLsizeiptr size, const void *data)
Q_GUI_EXPORT QString extensions()
static void qglfResolveVertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
static void qglfResolveGenerateMipmap(GLenum target)
static void qglfResolveAttachShader(GLuint program, GLuint shader)
static void qglfResolveVertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *ptr)
static void qglfResolveVertexAttrib1fv(GLuint indx, const GLfloat *values)
static const QGLContext * currentContext()
Returns the current context, i.e.
static void qglfResolveCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data)
static void qglfResolveGetVertexAttribfv(GLuint index, GLenum pname, GLfloat *params)
bool hasOpenGLFeature(QGLFunctions::OpenGLFeature feature) const
Returns true if feature is present on this system's OpenGL implementation; false otherwise.
static void qglfResolveDisableVertexAttribArray(GLuint index)
static void qglfResolveGenBuffers(GLsizei n, GLuint *buffers)
#define QT_BEGIN_NAMESPACE
This macro expands to.
The QGLContext class encapsulates an OpenGL rendering context.
static void qglfResolveUniform3iv(GLint location, GLsizei count, const GLint *v)
static void qglfSpecialGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision)
#define Q_GLOBAL_STATIC(TYPE, NAME)
Declares a global static variable with the given type and name.
static void qglfResolveSampleCoverage(GLclampf value, GLboolean invert)
static void qglfResolveDeleteRenderbuffers(GLsizei n, const GLuint *renderbuffers)
static const char * data(const QByteArray &arr)
static void qglfResolveGenRenderbuffers(GLsizei n, GLuint *renderbuffers)
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
static void qglfResolveUniform3fv(GLint location, GLsizei count, const GLfloat *v)
static void qglfResolveGetShaderSource(GLuint shader, GLsizei bufsize, GLsizei *length, char *source)
static void qglfResolveUniform1i(GLint location, GLint x)
static void qglfResolveGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint *params)
static void qglfResolveCompileShader(GLuint shader)
static void qglfSpecialReleaseShaderCompiler()
static void qglfResolveBindFramebuffer(GLenum target, GLuint framebuffer)
const T * ptr(const T &t)
static void qglfResolveBufferData(GLenum target, qgl_GLsizeiptr size, const void *data, GLenum usage)
static int qt_gl_resolve_features()
static void qglfResolveVertexAttrib3fv(GLuint indx, const GLfloat *values)
static void qglfResolveUniform2f(GLint location, GLfloat x, GLfloat y)
static void qglfResolveStencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask)
static void qglfResolveUniform1f(GLint location, GLfloat x)
static void qglfResolveReleaseShaderCompiler()
static void qglfResolveBindBuffer(GLenum target, GLuint buffer)
static void qglfResolveVertexAttrib1f(GLuint indx, GLfloat x)
static void qglfResolveDeleteBuffers(GLsizei n, const GLuint *buffers)
static void qglfResolveEnableVertexAttribArray(GLuint index)
static void qglfResolveDetachShader(GLuint program, GLuint shader)
static void qglfResolveGetProgramiv(GLuint program, GLenum pname, GLint *params)
static void qglfResolveStencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass)
static void qglfResolveGetVertexAttribiv(GLuint index, GLenum pname, GLint *params)
static GLboolean qglfResolveIsFramebuffer(GLuint framebuffer)
static void qglfResolveVertexAttrib2f(GLuint indx, GLfloat x, GLfloat y)
static void qglfResolveVertexAttrib4fv(GLuint indx, const GLfloat *values)
static void qglfResolveGetAttachedShaders(GLuint program, GLsizei maxcount, GLsizei *count, GLuint *shaders)
static void qglfResolveGetVertexAttribPointerv(GLuint index, GLenum pname, void **pointer)
static void qglfResolveValidateProgram(GLuint program)
static GLboolean qglfResolveIsProgram(GLuint program)
static void qglfResolveUniform4fv(GLint location, GLsizei count, const GLfloat *v)
Q_STATIC_TEMPLATE_FUNCTION void blendColor(int count, const QSpan *spans, void *userData)
static void qglfResolveUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
static void qglfResolveGetActiveUniform(GLuint program, GLuint index, GLsizei bufsize, GLsizei *length, GLint *size, GLenum *type, char *name)
static void qglfResolveUniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
static QTestResult::TestLocation location
static void qglfResolveUniform1fv(GLint location, GLsizei count, const GLfloat *v)
static void qglfResolveRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
void initializeGLFunctions(const QGLContext *context=0)
Initializes GL function resolution for context.
static void qglfResolveVertexAttrib2fv(GLuint indx, const GLfloat *values)
static void qglfResolveUniform2fv(GLint location, GLsizei count, const GLfloat *v)
static void qglfResolveBlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
static GLuint qglfResolveCreateProgram()
bool match(const char *str) const
static void qglfResolveBindAttribLocation(GLuint program, GLuint index, const char *name)
static GLboolean qglfResolveIsShader(GLuint shader)
static void qglfResolveBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
static void qglfResolveFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
static void qglfResolveShaderSource(GLuint shader, GLsizei count, const char **string, const GLint *length)
static void qglfResolveLinkProgram(GLuint program)
static void qglfResolveUniform4iv(GLint location, GLsizei count, const GLint *v)
static void qglfResolveBlendEquation(GLenum mode)
static void qglfResolveGetShaderInfoLog(GLuint shader, GLsizei bufsize, GLsizei *length, char *infolog)
static void qglfResolveStencilMaskSeparate(GLenum face, GLuint mask)
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
static void qglfResolveDeleteFramebuffers(GLsizei n, const GLuint *framebuffers)
#define Q_GLOBAL_STATIC_WITH_ARGS(TYPE, NAME, ARGS)
Declares a global static variable with the specified type and name.
static void qglfResolveDeleteProgram(GLuint program)
static void qglfResolveUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
static int qglfResolveGetAttribLocation(GLuint program, const char *name)
static void qglfResolveDeleteShader(GLuint shader)
static GLboolean qglfResolveIsRenderbuffer(GLuint renderbuffer)
static void qglfResolveGetUniformiv(GLuint program, GLint location, GLint *params)
static void qglfResolveShaderBinary(GLint n, const GLuint *shaders, GLenum binaryformat, const void *binary, GLint length)
static QGLFunctionsPrivateEx * qt_gl_functions(const QGLContext *context=0)
qgl_GLsizeiptr const void * data
static void qglfResolveGetBufferParameteriv(GLenum target, GLenum pname, GLint *params)
static void qglfResolveGetShaderiv(GLuint shader, GLenum pname, GLint *params)
static void qglfResolveUniform2i(GLint location, GLint x, GLint y)