Qt 4.8
qglfunctions.cpp
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the QtOpenGL module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 #include "qglfunctions.h"
43 #include "qgl_p.h"
44 
46 
147 // Hidden private fields for additional extension data.
149 {
150  QGLFunctionsPrivateEx(const QGLContext *context = 0)
151  : QGLFunctionsPrivate(context)
152  , m_features(-1) {}
153 
155 };
156 
157 #if QT_VERSION >= 0x040800
159 #else
160 static void qt_gl_functions_free(void *data)
161 {
162  delete reinterpret_cast<QGLFunctionsPrivateEx *>(data);
163 }
164 
165 Q_GLOBAL_STATIC_WITH_ARGS(QGLContextResource, qt_gl_functions_resource, (qt_gl_functions_free))
166 #endif
168 {
169  if (!context)
170  context = QGLContext::currentContext();
171  Q_ASSERT(context);
172  QGLFunctionsPrivateEx *funcs =
173  reinterpret_cast<QGLFunctionsPrivateEx *>
174  (qt_gl_functions_resource()->value(context));
175 #if QT_VERSION < 0x040800
176  if (!funcs) {
177  funcs = new QGLFunctionsPrivateEx();
178  qt_gl_functions_resource()->insert(context, funcs);
179  }
180 #endif
181  return funcs;
182 }
183 
192  : d_ptr(0)
193 {
194 }
195 
207  : d_ptr(qt_gl_functions(context))
208 {
209 }
210 
221 {
222 #if defined(QT_OPENGL_ES_2)
223  int features = QGLFunctions::Multitexture |
236  if (extensions.match("GL_OES_texture_npot"))
237  features |= QGLFunctions::NPOTTextures;
238  if (extensions.match("GL_IMG_texture_npot"))
239  features |= QGLFunctions::NPOTTextures;
240  return features;
241 #elif defined(QT_OPENGL_ES)
242  int features = QGLFunctions::Multitexture |
247  if (extensions.match("GL_OES_framebuffer_object"))
248  features |= QGLFunctions::Framebuffers;
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"))
254  features |= QGLFunctions::BlendSubtract;
255  if (extensions.match("GL_OES_texture_npot"))
256  features |= QGLFunctions::NPOTTextures;
257  if (extensions.match("GL_IMG_texture_npot"))
258  features |= QGLFunctions::NPOTTextures;
259  return features;
260 #else
261  int features = 0;
262  QGLFormat::OpenGLVersionFlags versions = QGLFormat::openGLVersionFlags();
264 
265  // Recognize features by extension name.
266  if (extensions.match("GL_ARB_multitexture"))
267  features |= QGLFunctions::Multitexture;
268  if (extensions.match("GL_ARB_shader_objects"))
269  features |= QGLFunctions::Shaders;
270  if (extensions.match("GL_EXT_framebuffer_object") ||
271  extensions.match("GL_ARB_framebuffer_object"))
272  features |= QGLFunctions::Framebuffers;
273  if (extensions.match("GL_EXT_blend_color"))
274  features |= QGLFunctions::BlendColor;
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"))
280  features |= QGLFunctions::BlendSubtract;
281  if (extensions.match("GL_ARB_texture_compression"))
283  if (extensions.match("GL_ARB_multisample"))
284  features |= QGLFunctions::Multisample;
285  if (extensions.match("GL_ARB_texture_non_power_of_two"))
286  features |= QGLFunctions::NPOTTextures;
287 
288  // Recognize features by minimum OpenGL version.
289  if (versions & QGLFormat::OpenGL_Version_1_2) {
290  features |= QGLFunctions::BlendColor |
292  }
293  if (versions & QGLFormat::OpenGL_Version_1_3) {
294  features |= QGLFunctions::Multitexture |
297  }
298  if (versions & QGLFormat::OpenGL_Version_1_4)
300  if (versions & QGLFormat::OpenGL_Version_1_5)
301  features |= QGLFunctions::Buffers;
302  if (versions & QGLFormat::OpenGL_Version_2_0) {
303  features |= QGLFunctions::Shaders |
307  }
308  return features;
309 #endif
310 }
311 
321 QGLFunctions::OpenGLFeatures QGLFunctions::openGLFeatures() const
322 {
324  if (!d)
325  return 0;
326  if (d->m_features == -1)
328  return QGLFunctions::OpenGLFeatures(d->m_features);
329 }
330 
341 {
343  if (!d)
344  return false;
345  if (d->m_features == -1)
347  return (d->m_features & int(feature)) != 0;
348 }
349 
360 {
361  d_ptr = qt_gl_functions(context);
362 }
363 
1512 #ifndef QT_OPENGL_ES_2
1513 
1514 static void qglfResolveActiveTexture(GLenum texture)
1515 {
1516  typedef void (QGLF_APIENTRYP type_glActiveTexture)(GLenum texture);
1517 
1518  const QGLContext *context = QGLContext::currentContext();
1519  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1520 
1521  funcs->activeTexture = (type_glActiveTexture)
1522  context->getProcAddress(QLatin1String("glActiveTexture"));
1523  if (!funcs->activeTexture) {
1524  funcs->activeTexture = (type_glActiveTexture)
1525  context->getProcAddress(QLatin1String("glActiveTextureARB"));
1526  }
1527 
1528  if (funcs->activeTexture)
1529  funcs->activeTexture(texture);
1530  else
1531  funcs->activeTexture = qglfResolveActiveTexture;
1532 }
1533 
1534 static void qglfResolveAttachShader(GLuint program, GLuint shader)
1535 {
1536  typedef void (QGLF_APIENTRYP type_glAttachShader)(GLuint program, GLuint shader);
1537 
1538  const QGLContext *context = QGLContext::currentContext();
1539  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1540 
1541  funcs->attachShader = (type_glAttachShader)
1542  context->getProcAddress(QLatin1String("glAttachShader"));
1543  if (!funcs->attachShader) {
1544  funcs->attachShader = (type_glAttachShader)
1545  context->getProcAddress(QLatin1String("glAttachObjectARB"));
1546  }
1547 
1548  if (funcs->attachShader)
1549  funcs->attachShader(program, shader);
1550  else
1551  funcs->attachShader = qglfResolveAttachShader;
1552 }
1553 
1554 static void qglfResolveBindAttribLocation(GLuint program, GLuint index, const char* name)
1555 {
1556  typedef void (QGLF_APIENTRYP type_glBindAttribLocation)(GLuint program, GLuint index, const char* name);
1557 
1558  const QGLContext *context = QGLContext::currentContext();
1559  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1560 
1561  funcs->bindAttribLocation = (type_glBindAttribLocation)
1562  context->getProcAddress(QLatin1String("glBindAttribLocation"));
1563  if (!funcs->bindAttribLocation) {
1564  funcs->bindAttribLocation = (type_glBindAttribLocation)
1565  context->getProcAddress(QLatin1String("glBindAttribLocationARB"));
1566  }
1567 
1568  if (funcs->bindAttribLocation)
1569  funcs->bindAttribLocation(program, index, name);
1570  else
1571  funcs->bindAttribLocation = qglfResolveBindAttribLocation;
1572 }
1573 
1574 static void qglfResolveBindBuffer(GLenum target, GLuint buffer)
1575 {
1576  typedef void (QGLF_APIENTRYP type_glBindBuffer)(GLenum target, GLuint buffer);
1577 
1578  const QGLContext *context = QGLContext::currentContext();
1579  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1580 
1581  funcs->bindBuffer = (type_glBindBuffer)
1582  context->getProcAddress(QLatin1String("glBindBuffer"));
1583 #ifdef QT_OPENGL_ES
1584  if (!funcs->bindBuffer) {
1585  funcs->bindBuffer = (type_glBindBuffer)
1586  context->getProcAddress(QLatin1String("glBindBufferOES"));
1587  }
1588 #endif
1589  if (!funcs->bindBuffer) {
1590  funcs->bindBuffer = (type_glBindBuffer)
1591  context->getProcAddress(QLatin1String("glBindBufferEXT"));
1592  }
1593  if (!funcs->bindBuffer) {
1594  funcs->bindBuffer = (type_glBindBuffer)
1595  context->getProcAddress(QLatin1String("glBindBufferARB"));
1596  }
1597 
1598  if (funcs->bindBuffer)
1599  funcs->bindBuffer(target, buffer);
1600  else
1601  funcs->bindBuffer = qglfResolveBindBuffer;
1602 }
1603 
1604 static void qglfResolveBindFramebuffer(GLenum target, GLuint framebuffer)
1605 {
1606  typedef void (QGLF_APIENTRYP type_glBindFramebuffer)(GLenum target, GLuint framebuffer);
1607 
1608  const QGLContext *context = QGLContext::currentContext();
1609  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1610 
1611  funcs->bindFramebuffer = (type_glBindFramebuffer)
1612  context->getProcAddress(QLatin1String("glBindFramebuffer"));
1613 #ifdef QT_OPENGL_ES
1614  if (!funcs->bindFramebuffer) {
1615  funcs->bindFramebuffer = (type_glBindFramebuffer)
1616  context->getProcAddress(QLatin1String("glBindFramebufferOES"));
1617  }
1618 #endif
1619  if (!funcs->bindFramebuffer) {
1620  funcs->bindFramebuffer = (type_glBindFramebuffer)
1621  context->getProcAddress(QLatin1String("glBindFramebufferEXT"));
1622  }
1623  if (!funcs->bindFramebuffer) {
1624  funcs->bindFramebuffer = (type_glBindFramebuffer)
1625  context->getProcAddress(QLatin1String("glBindFramebufferARB"));
1626  }
1627 
1628  if (funcs->bindFramebuffer)
1629  funcs->bindFramebuffer(target, framebuffer);
1630  else
1631  funcs->bindFramebuffer = qglfResolveBindFramebuffer;
1632 }
1633 
1634 static void qglfResolveBindRenderbuffer(GLenum target, GLuint renderbuffer)
1635 {
1636  typedef void (QGLF_APIENTRYP type_glBindRenderbuffer)(GLenum target, GLuint renderbuffer);
1637 
1638  const QGLContext *context = QGLContext::currentContext();
1639  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1640 
1641  funcs->bindRenderbuffer = (type_glBindRenderbuffer)
1642  context->getProcAddress(QLatin1String("glBindRenderbuffer"));
1643 #ifdef QT_OPENGL_ES
1644  if (!funcs->bindRenderbuffer) {
1645  funcs->bindRenderbuffer = (type_glBindRenderbuffer)
1646  context->getProcAddress(QLatin1String("glBindRenderbufferOES"));
1647  }
1648 #endif
1649  if (!funcs->bindRenderbuffer) {
1650  funcs->bindRenderbuffer = (type_glBindRenderbuffer)
1651  context->getProcAddress(QLatin1String("glBindRenderbufferEXT"));
1652  }
1653  if (!funcs->bindRenderbuffer) {
1654  funcs->bindRenderbuffer = (type_glBindRenderbuffer)
1655  context->getProcAddress(QLatin1String("glBindRenderbufferARB"));
1656  }
1657 
1658  if (funcs->bindRenderbuffer)
1659  funcs->bindRenderbuffer(target, renderbuffer);
1660  else
1661  funcs->bindRenderbuffer = qglfResolveBindRenderbuffer;
1662 }
1663 
1664 static void qglfResolveBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
1665 {
1666  typedef void (QGLF_APIENTRYP type_glBlendColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
1667 
1668  const QGLContext *context = QGLContext::currentContext();
1669  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1670 
1671  funcs->blendColor = (type_glBlendColor)
1672  context->getProcAddress(QLatin1String("glBlendColor"));
1673 #ifdef QT_OPENGL_ES
1674  if (!funcs->blendColor) {
1675  funcs->blendColor = (type_glBlendColor)
1676  context->getProcAddress(QLatin1String("glBlendColorOES"));
1677  }
1678 #endif
1679  if (!funcs->blendColor) {
1680  funcs->blendColor = (type_glBlendColor)
1681  context->getProcAddress(QLatin1String("glBlendColorEXT"));
1682  }
1683  if (!funcs->blendColor) {
1684  funcs->blendColor = (type_glBlendColor)
1685  context->getProcAddress(QLatin1String("glBlendColorARB"));
1686  }
1687 
1688  if (funcs->blendColor)
1689  funcs->blendColor(red, green, blue, alpha);
1690  else
1691  funcs->blendColor = qglfResolveBlendColor;
1692 }
1693 
1695 {
1696  typedef void (QGLF_APIENTRYP type_glBlendEquation)(GLenum mode);
1697 
1698  const QGLContext *context = QGLContext::currentContext();
1699  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1700 
1701  funcs->blendEquation = (type_glBlendEquation)
1702  context->getProcAddress(QLatin1String("glBlendEquation"));
1703 #ifdef QT_OPENGL_ES
1704  if (!funcs->blendEquation) {
1705  funcs->blendEquation = (type_glBlendEquation)
1706  context->getProcAddress(QLatin1String("glBlendEquationOES"));
1707  }
1708 #endif
1709  if (!funcs->blendEquation) {
1710  funcs->blendEquation = (type_glBlendEquation)
1711  context->getProcAddress(QLatin1String("glBlendEquationEXT"));
1712  }
1713  if (!funcs->blendEquation) {
1714  funcs->blendEquation = (type_glBlendEquation)
1715  context->getProcAddress(QLatin1String("glBlendEquationARB"));
1716  }
1717 
1718  if (funcs->blendEquation)
1719  funcs->blendEquation(mode);
1720  else
1721  funcs->blendEquation = qglfResolveBlendEquation;
1722 }
1723 
1724 static void qglfResolveBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha)
1725 {
1726  typedef void (QGLF_APIENTRYP type_glBlendEquationSeparate)(GLenum modeRGB, GLenum modeAlpha);
1727 
1728  const QGLContext *context = QGLContext::currentContext();
1729  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1730 
1731  funcs->blendEquationSeparate = (type_glBlendEquationSeparate)
1732  context->getProcAddress(QLatin1String("glBlendEquationSeparate"));
1733 #ifdef QT_OPENGL_ES
1734  if (!funcs->blendEquationSeparate) {
1735  funcs->blendEquationSeparate = (type_glBlendEquationSeparate)
1736  context->getProcAddress(QLatin1String("glBlendEquationSeparateOES"));
1737  }
1738 #endif
1739  if (!funcs->blendEquationSeparate) {
1740  funcs->blendEquationSeparate = (type_glBlendEquationSeparate)
1741  context->getProcAddress(QLatin1String("glBlendEquationSeparateEXT"));
1742  }
1743  if (!funcs->blendEquationSeparate) {
1744  funcs->blendEquationSeparate = (type_glBlendEquationSeparate)
1745  context->getProcAddress(QLatin1String("glBlendEquationSeparateARB"));
1746  }
1747 
1748  if (funcs->blendEquationSeparate)
1749  funcs->blendEquationSeparate(modeRGB, modeAlpha);
1750  else
1751  funcs->blendEquationSeparate = qglfResolveBlendEquationSeparate;
1752 }
1753 
1754 static void qglfResolveBlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
1755 {
1756  typedef void (QGLF_APIENTRYP type_glBlendFuncSeparate)(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
1757 
1758  const QGLContext *context = QGLContext::currentContext();
1759  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1760 
1761  funcs->blendFuncSeparate = (type_glBlendFuncSeparate)
1762  context->getProcAddress(QLatin1String("glBlendFuncSeparate"));
1763 #ifdef QT_OPENGL_ES
1764  if (!funcs->blendFuncSeparate) {
1765  funcs->blendFuncSeparate = (type_glBlendFuncSeparate)
1766  context->getProcAddress(QLatin1String("glBlendFuncSeparateOES"));
1767  }
1768 #endif
1769  if (!funcs->blendFuncSeparate) {
1770  funcs->blendFuncSeparate = (type_glBlendFuncSeparate)
1771  context->getProcAddress(QLatin1String("glBlendFuncSeparateEXT"));
1772  }
1773  if (!funcs->blendFuncSeparate) {
1774  funcs->blendFuncSeparate = (type_glBlendFuncSeparate)
1775  context->getProcAddress(QLatin1String("glBlendFuncSeparateARB"));
1776  }
1777 
1778  if (funcs->blendFuncSeparate)
1779  funcs->blendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha);
1780  else
1781  funcs->blendFuncSeparate = qglfResolveBlendFuncSeparate;
1782 }
1783 
1784 static void qglfResolveBufferData(GLenum target, qgl_GLsizeiptr size, const void* data, GLenum usage)
1785 {
1786  typedef void (QGLF_APIENTRYP type_glBufferData)(GLenum target, qgl_GLsizeiptr size, const void* data, GLenum usage);
1787 
1788  const QGLContext *context = QGLContext::currentContext();
1789  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1790 
1791  funcs->bufferData = (type_glBufferData)
1792  context->getProcAddress(QLatin1String("glBufferData"));
1793 #ifdef QT_OPENGL_ES
1794  if (!funcs->bufferData) {
1795  funcs->bufferData = (type_glBufferData)
1796  context->getProcAddress(QLatin1String("glBufferDataOES"));
1797  }
1798 #endif
1799  if (!funcs->bufferData) {
1800  funcs->bufferData = (type_glBufferData)
1801  context->getProcAddress(QLatin1String("glBufferDataEXT"));
1802  }
1803  if (!funcs->bufferData) {
1804  funcs->bufferData = (type_glBufferData)
1805  context->getProcAddress(QLatin1String("glBufferDataARB"));
1806  }
1807 
1808  if (funcs->bufferData)
1809  funcs->bufferData(target, size, data, usage);
1810  else
1811  funcs->bufferData = qglfResolveBufferData;
1812 }
1813 
1814 static void qglfResolveBufferSubData(GLenum target, qgl_GLintptr offset, qgl_GLsizeiptr size, const void* data)
1815 {
1816  typedef void (QGLF_APIENTRYP type_glBufferSubData)(GLenum target, qgl_GLintptr offset, qgl_GLsizeiptr size, const void* data);
1817 
1818  const QGLContext *context = QGLContext::currentContext();
1819  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1820 
1821  funcs->bufferSubData = (type_glBufferSubData)
1822  context->getProcAddress(QLatin1String("glBufferSubData"));
1823 #ifdef QT_OPENGL_ES
1824  if (!funcs->bufferSubData) {
1825  funcs->bufferSubData = (type_glBufferSubData)
1826  context->getProcAddress(QLatin1String("glBufferSubDataOES"));
1827  }
1828 #endif
1829  if (!funcs->bufferSubData) {
1830  funcs->bufferSubData = (type_glBufferSubData)
1831  context->getProcAddress(QLatin1String("glBufferSubDataEXT"));
1832  }
1833  if (!funcs->bufferSubData) {
1834  funcs->bufferSubData = (type_glBufferSubData)
1835  context->getProcAddress(QLatin1String("glBufferSubDataARB"));
1836  }
1837 
1838  if (funcs->bufferSubData)
1839  funcs->bufferSubData(target, offset, size, data);
1840  else
1841  funcs->bufferSubData = qglfResolveBufferSubData;
1842 }
1843 
1845 {
1846  typedef GLenum (QGLF_APIENTRYP type_glCheckFramebufferStatus)(GLenum target);
1847 
1848  const QGLContext *context = QGLContext::currentContext();
1849  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1850 
1851  funcs->checkFramebufferStatus = (type_glCheckFramebufferStatus)
1852  context->getProcAddress(QLatin1String("glCheckFramebufferStatus"));
1853 #ifdef QT_OPENGL_ES
1854  if (!funcs->checkFramebufferStatus) {
1855  funcs->checkFramebufferStatus = (type_glCheckFramebufferStatus)
1856  context->getProcAddress(QLatin1String("glCheckFramebufferStatusOES"));
1857  }
1858 #endif
1859  if (!funcs->checkFramebufferStatus) {
1860  funcs->checkFramebufferStatus = (type_glCheckFramebufferStatus)
1861  context->getProcAddress(QLatin1String("glCheckFramebufferStatusEXT"));
1862  }
1863  if (!funcs->checkFramebufferStatus) {
1864  funcs->checkFramebufferStatus = (type_glCheckFramebufferStatus)
1865  context->getProcAddress(QLatin1String("glCheckFramebufferStatusARB"));
1866  }
1867 
1868  if (funcs->checkFramebufferStatus)
1869  return funcs->checkFramebufferStatus(target);
1870  funcs->checkFramebufferStatus = qglfResolveCheckFramebufferStatus;
1871  return GLenum(0);
1872 }
1873 
1874 static void qglfResolveCompileShader(GLuint shader)
1875 {
1876  typedef void (QGLF_APIENTRYP type_glCompileShader)(GLuint shader);
1877 
1878  const QGLContext *context = QGLContext::currentContext();
1879  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1880 
1881  funcs->compileShader = (type_glCompileShader)
1882  context->getProcAddress(QLatin1String("glCompileShader"));
1883  if (!funcs->compileShader) {
1884  funcs->compileShader = (type_glCompileShader)
1885  context->getProcAddress(QLatin1String("glCompileShader"));
1886  }
1887 
1888  if (funcs->compileShader)
1889  funcs->compileShader(shader);
1890  else
1891  funcs->compileShader = qglfResolveCompileShader;
1892 }
1893 
1894 static void qglfResolveCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data)
1895 {
1896  typedef void (QGLF_APIENTRYP type_glCompressedTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data);
1897 
1898  const QGLContext *context = QGLContext::currentContext();
1899  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1900 
1901  funcs->compressedTexImage2D = (type_glCompressedTexImage2D)
1902  context->getProcAddress(QLatin1String("glCompressedTexImage2D"));
1903 #ifdef QT_OPENGL_ES
1904  if (!funcs->compressedTexImage2D) {
1905  funcs->compressedTexImage2D = (type_glCompressedTexImage2D)
1906  context->getProcAddress(QLatin1String("glCompressedTexImage2DOES"));
1907  }
1908 #endif
1909  if (!funcs->compressedTexImage2D) {
1910  funcs->compressedTexImage2D = (type_glCompressedTexImage2D)
1911  context->getProcAddress(QLatin1String("glCompressedTexImage2DEXT"));
1912  }
1913  if (!funcs->compressedTexImage2D) {
1914  funcs->compressedTexImage2D = (type_glCompressedTexImage2D)
1915  context->getProcAddress(QLatin1String("glCompressedTexImage2DARB"));
1916  }
1917 
1918  if (funcs->compressedTexImage2D)
1919  funcs->compressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data);
1920  else
1921  funcs->compressedTexImage2D = qglfResolveCompressedTexImage2D;
1922 }
1923 
1924 static void qglfResolveCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data)
1925 {
1926  typedef void (QGLF_APIENTRYP type_glCompressedTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data);
1927 
1928  const QGLContext *context = QGLContext::currentContext();
1929  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1930 
1931  funcs->compressedTexSubImage2D = (type_glCompressedTexSubImage2D)
1932  context->getProcAddress(QLatin1String("glCompressedTexSubImage2D"));
1933 #ifdef QT_OPENGL_ES
1934  if (!funcs->compressedTexSubImage2D) {
1935  funcs->compressedTexSubImage2D = (type_glCompressedTexSubImage2D)
1936  context->getProcAddress(QLatin1String("glCompressedTexSubImage2DOES"));
1937  }
1938 #endif
1939  if (!funcs->compressedTexSubImage2D) {
1940  funcs->compressedTexSubImage2D = (type_glCompressedTexSubImage2D)
1941  context->getProcAddress(QLatin1String("glCompressedTexSubImage2DEXT"));
1942  }
1943  if (!funcs->compressedTexSubImage2D) {
1944  funcs->compressedTexSubImage2D = (type_glCompressedTexSubImage2D)
1945  context->getProcAddress(QLatin1String("glCompressedTexSubImage2DARB"));
1946  }
1947 
1948  if (funcs->compressedTexSubImage2D)
1949  funcs->compressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data);
1950  else
1951  funcs->compressedTexSubImage2D = qglfResolveCompressedTexSubImage2D;
1952 }
1953 
1955 {
1956  typedef GLuint (QGLF_APIENTRYP type_glCreateProgram)();
1957 
1958  const QGLContext *context = QGLContext::currentContext();
1959  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1960 
1961  funcs->createProgram = (type_glCreateProgram)
1962  context->getProcAddress(QLatin1String("glCreateProgram"));
1963  if (!funcs->createProgram) {
1964  funcs->createProgram = (type_glCreateProgram)
1965  context->getProcAddress(QLatin1String("glCreateProgramObjectARB"));
1966  }
1967 
1968  if (funcs->createProgram)
1969  return funcs->createProgram();
1970  funcs->createProgram = qglfResolveCreateProgram;
1971  return GLuint(0);
1972 }
1973 
1975 {
1976  typedef GLuint (QGLF_APIENTRYP type_glCreateShader)(GLenum type);
1977 
1978  const QGLContext *context = QGLContext::currentContext();
1979  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1980 
1981  funcs->createShader = (type_glCreateShader)
1982  context->getProcAddress(QLatin1String("glCreateShader"));
1983  if (!funcs->createShader) {
1984  funcs->createShader = (type_glCreateShader)
1985  context->getProcAddress(QLatin1String("glCreateShaderObjectARB"));
1986  }
1987 
1988  if (funcs->createShader)
1989  return funcs->createShader(type);
1990  funcs->createShader = qglfResolveCreateShader;
1991  return GLuint(0);
1992 }
1993 
1994 static void qglfResolveDeleteBuffers(GLsizei n, const GLuint* buffers)
1995 {
1996  typedef void (QGLF_APIENTRYP type_glDeleteBuffers)(GLsizei n, const GLuint* buffers);
1997 
1998  const QGLContext *context = QGLContext::currentContext();
1999  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2000 
2001  funcs->deleteBuffers = (type_glDeleteBuffers)
2002  context->getProcAddress(QLatin1String("glDeleteBuffers"));
2003 #ifdef QT_OPENGL_ES
2004  if (!funcs->deleteBuffers) {
2005  funcs->deleteBuffers = (type_glDeleteBuffers)
2006  context->getProcAddress(QLatin1String("glDeleteBuffersOES"));
2007  }
2008 #endif
2009  if (!funcs->deleteBuffers) {
2010  funcs->deleteBuffers = (type_glDeleteBuffers)
2011  context->getProcAddress(QLatin1String("glDeleteBuffersEXT"));
2012  }
2013  if (!funcs->deleteBuffers) {
2014  funcs->deleteBuffers = (type_glDeleteBuffers)
2015  context->getProcAddress(QLatin1String("glDeleteBuffersARB"));
2016  }
2017 
2018  if (funcs->deleteBuffers)
2019  funcs->deleteBuffers(n, buffers);
2020  else
2021  funcs->deleteBuffers = qglfResolveDeleteBuffers;
2022 }
2023 
2024 static void qglfResolveDeleteFramebuffers(GLsizei n, const GLuint* framebuffers)
2025 {
2026  typedef void (QGLF_APIENTRYP type_glDeleteFramebuffers)(GLsizei n, const GLuint* framebuffers);
2027 
2028  const QGLContext *context = QGLContext::currentContext();
2029  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2030 
2031  funcs->deleteFramebuffers = (type_glDeleteFramebuffers)
2032  context->getProcAddress(QLatin1String("glDeleteFramebuffers"));
2033 #ifdef QT_OPENGL_ES
2034  if (!funcs->deleteFramebuffers) {
2035  funcs->deleteFramebuffers = (type_glDeleteFramebuffers)
2036  context->getProcAddress(QLatin1String("glDeleteFramebuffersOES"));
2037  }
2038 #endif
2039  if (!funcs->deleteFramebuffers) {
2040  funcs->deleteFramebuffers = (type_glDeleteFramebuffers)
2041  context->getProcAddress(QLatin1String("glDeleteFramebuffersEXT"));
2042  }
2043  if (!funcs->deleteFramebuffers) {
2044  funcs->deleteFramebuffers = (type_glDeleteFramebuffers)
2045  context->getProcAddress(QLatin1String("glDeleteFramebuffersARB"));
2046  }
2047 
2048  if (funcs->deleteFramebuffers)
2049  funcs->deleteFramebuffers(n, framebuffers);
2050  else
2051  funcs->deleteFramebuffers = qglfResolveDeleteFramebuffers;
2052 }
2053 
2054 static void qglfResolveDeleteProgram(GLuint program)
2055 {
2056  typedef void (QGLF_APIENTRYP type_glDeleteProgram)(GLuint program);
2057 
2058  const QGLContext *context = QGLContext::currentContext();
2059  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2060 
2061  funcs->deleteProgram = (type_glDeleteProgram)
2062  context->getProcAddress(QLatin1String("glDeleteProgram"));
2063  if (!funcs->deleteProgram) {
2064  funcs->deleteProgram = (type_glDeleteProgram)
2065  context->getProcAddress(QLatin1String("glDeleteObjectARB"));
2066  }
2067 
2068  if (funcs->deleteProgram)
2069  funcs->deleteProgram(program);
2070  else
2071  funcs->deleteProgram = qglfResolveDeleteProgram;
2072 }
2073 
2074 static void qglfResolveDeleteRenderbuffers(GLsizei n, const GLuint* renderbuffers)
2075 {
2076  typedef void (QGLF_APIENTRYP type_glDeleteRenderbuffers)(GLsizei n, const GLuint* renderbuffers);
2077 
2078  const QGLContext *context = QGLContext::currentContext();
2079  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2080 
2081  funcs->deleteRenderbuffers = (type_glDeleteRenderbuffers)
2082  context->getProcAddress(QLatin1String("glDeleteRenderbuffers"));
2083 #ifdef QT_OPENGL_ES
2084  if (!funcs->deleteRenderbuffers) {
2085  funcs->deleteRenderbuffers = (type_glDeleteRenderbuffers)
2086  context->getProcAddress(QLatin1String("glDeleteRenderbuffersOES"));
2087  }
2088 #endif
2089  if (!funcs->deleteRenderbuffers) {
2090  funcs->deleteRenderbuffers = (type_glDeleteRenderbuffers)
2091  context->getProcAddress(QLatin1String("glDeleteRenderbuffersEXT"));
2092  }
2093  if (!funcs->deleteRenderbuffers) {
2094  funcs->deleteRenderbuffers = (type_glDeleteRenderbuffers)
2095  context->getProcAddress(QLatin1String("glDeleteRenderbuffersARB"));
2096  }
2097 
2098  if (funcs->deleteRenderbuffers)
2099  funcs->deleteRenderbuffers(n, renderbuffers);
2100  else
2101  funcs->deleteRenderbuffers = qglfResolveDeleteRenderbuffers;
2102 }
2103 
2104 static void qglfResolveDeleteShader(GLuint shader)
2105 {
2106  typedef void (QGLF_APIENTRYP type_glDeleteShader)(GLuint shader);
2107 
2108  const QGLContext *context = QGLContext::currentContext();
2109  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2110 
2111  funcs->deleteShader = (type_glDeleteShader)
2112  context->getProcAddress(QLatin1String("glDeleteShader"));
2113  if (!funcs->deleteShader) {
2114  funcs->deleteShader = (type_glDeleteShader)
2115  context->getProcAddress(QLatin1String("glDeleteObjectARB"));
2116  }
2117 
2118  if (funcs->deleteShader)
2119  funcs->deleteShader(shader);
2120  else
2121  funcs->deleteShader = qglfResolveDeleteShader;
2122 }
2123 
2124 static void qglfResolveDetachShader(GLuint program, GLuint shader)
2125 {
2126  typedef void (QGLF_APIENTRYP type_glDetachShader)(GLuint program, GLuint shader);
2127 
2128  const QGLContext *context = QGLContext::currentContext();
2129  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2130 
2131  funcs->detachShader = (type_glDetachShader)
2132  context->getProcAddress(QLatin1String("glDetachShader"));
2133  if (!funcs->detachShader) {
2134  funcs->detachShader = (type_glDetachShader)
2135  context->getProcAddress(QLatin1String("glDetachObjectARB"));
2136  }
2137 
2138  if (funcs->detachShader)
2139  funcs->detachShader(program, shader);
2140  else
2141  funcs->detachShader = qglfResolveDetachShader;
2142 }
2143 
2145 {
2146  typedef void (QGLF_APIENTRYP type_glDisableVertexAttribArray)(GLuint index);
2147 
2148  const QGLContext *context = QGLContext::currentContext();
2149  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2150 
2151  funcs->disableVertexAttribArray = (type_glDisableVertexAttribArray)
2152  context->getProcAddress(QLatin1String("glDisableVertexAttribArray"));
2153  if (!funcs->disableVertexAttribArray) {
2154  funcs->disableVertexAttribArray = (type_glDisableVertexAttribArray)
2155  context->getProcAddress(QLatin1String("glDisableVertexAttribArrayARB"));
2156  }
2157 
2158  if (funcs->disableVertexAttribArray)
2159  funcs->disableVertexAttribArray(index);
2160  else
2161  funcs->disableVertexAttribArray = qglfResolveDisableVertexAttribArray;
2162 }
2163 
2165 {
2166  typedef void (QGLF_APIENTRYP type_glEnableVertexAttribArray)(GLuint index);
2167 
2168  const QGLContext *context = QGLContext::currentContext();
2169  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2170 
2171  funcs->enableVertexAttribArray = (type_glEnableVertexAttribArray)
2172  context->getProcAddress(QLatin1String("glEnableVertexAttribArray"));
2173  if (!funcs->enableVertexAttribArray) {
2174  funcs->enableVertexAttribArray = (type_glEnableVertexAttribArray)
2175  context->getProcAddress(QLatin1String("glEnableVertexAttribArrayARB"));
2176  }
2177 
2178  if (funcs->enableVertexAttribArray)
2179  funcs->enableVertexAttribArray(index);
2180  else
2181  funcs->enableVertexAttribArray = qglfResolveEnableVertexAttribArray;
2182 }
2183 
2184 static void qglfResolveFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
2185 {
2186  typedef void (QGLF_APIENTRYP type_glFramebufferRenderbuffer)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
2187 
2188  const QGLContext *context = QGLContext::currentContext();
2189  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2190 
2191  funcs->framebufferRenderbuffer = (type_glFramebufferRenderbuffer)
2192  context->getProcAddress(QLatin1String("glFramebufferRenderbuffer"));
2193 #ifdef QT_OPENGL_ES
2194  if (!funcs->framebufferRenderbuffer) {
2195  funcs->framebufferRenderbuffer = (type_glFramebufferRenderbuffer)
2196  context->getProcAddress(QLatin1String("glFramebufferRenderbufferOES"));
2197  }
2198 #endif
2199  if (!funcs->framebufferRenderbuffer) {
2200  funcs->framebufferRenderbuffer = (type_glFramebufferRenderbuffer)
2201  context->getProcAddress(QLatin1String("glFramebufferRenderbufferEXT"));
2202  }
2203  if (!funcs->framebufferRenderbuffer) {
2204  funcs->framebufferRenderbuffer = (type_glFramebufferRenderbuffer)
2205  context->getProcAddress(QLatin1String("glFramebufferRenderbufferARB"));
2206  }
2207 
2208  if (funcs->framebufferRenderbuffer)
2209  funcs->framebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer);
2210  else
2211  funcs->framebufferRenderbuffer = qglfResolveFramebufferRenderbuffer;
2212 }
2213 
2214 static void qglfResolveFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
2215 {
2216  typedef void (QGLF_APIENTRYP type_glFramebufferTexture2D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
2217 
2218  const QGLContext *context = QGLContext::currentContext();
2219  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2220 
2221  funcs->framebufferTexture2D = (type_glFramebufferTexture2D)
2222  context->getProcAddress(QLatin1String("glFramebufferTexture2D"));
2223 #ifdef QT_OPENGL_ES
2224  if (!funcs->framebufferTexture2D) {
2225  funcs->framebufferTexture2D = (type_glFramebufferTexture2D)
2226  context->getProcAddress(QLatin1String("glFramebufferTexture2DOES"));
2227  }
2228 #endif
2229  if (!funcs->framebufferTexture2D) {
2230  funcs->framebufferTexture2D = (type_glFramebufferTexture2D)
2231  context->getProcAddress(QLatin1String("glFramebufferTexture2DEXT"));
2232  }
2233  if (!funcs->framebufferTexture2D) {
2234  funcs->framebufferTexture2D = (type_glFramebufferTexture2D)
2235  context->getProcAddress(QLatin1String("glFramebufferTexture2DARB"));
2236  }
2237 
2238  if (funcs->framebufferTexture2D)
2239  funcs->framebufferTexture2D(target, attachment, textarget, texture, level);
2240  else
2241  funcs->framebufferTexture2D = qglfResolveFramebufferTexture2D;
2242 }
2243 
2244 static void qglfResolveGenBuffers(GLsizei n, GLuint* buffers)
2245 {
2246  typedef void (QGLF_APIENTRYP type_glGenBuffers)(GLsizei n, GLuint* buffers);
2247 
2248  const QGLContext *context = QGLContext::currentContext();
2249  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2250 
2251  funcs->genBuffers = (type_glGenBuffers)
2252  context->getProcAddress(QLatin1String("glGenBuffers"));
2253 #ifdef QT_OPENGL_ES
2254  if (!funcs->genBuffers) {
2255  funcs->genBuffers = (type_glGenBuffers)
2256  context->getProcAddress(QLatin1String("glGenBuffersOES"));
2257  }
2258 #endif
2259  if (!funcs->genBuffers) {
2260  funcs->genBuffers = (type_glGenBuffers)
2261  context->getProcAddress(QLatin1String("glGenBuffersEXT"));
2262  }
2263  if (!funcs->genBuffers) {
2264  funcs->genBuffers = (type_glGenBuffers)
2265  context->getProcAddress(QLatin1String("glGenBuffersARB"));
2266  }
2267 
2268  if (funcs->genBuffers)
2269  funcs->genBuffers(n, buffers);
2270  else
2271  funcs->genBuffers = qglfResolveGenBuffers;
2272 }
2273 
2275 {
2276  typedef void (QGLF_APIENTRYP type_glGenerateMipmap)(GLenum target);
2277 
2278  const QGLContext *context = QGLContext::currentContext();
2279  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2280 
2281  funcs->generateMipmap = (type_glGenerateMipmap)
2282  context->getProcAddress(QLatin1String("glGenerateMipmap"));
2283 #ifdef QT_OPENGL_ES
2284  if (!funcs->generateMipmap) {
2285  funcs->generateMipmap = (type_glGenerateMipmap)
2286  context->getProcAddress(QLatin1String("glGenerateMipmapOES"));
2287  }
2288 #endif
2289  if (!funcs->generateMipmap) {
2290  funcs->generateMipmap = (type_glGenerateMipmap)
2291  context->getProcAddress(QLatin1String("glGenerateMipmapEXT"));
2292  }
2293  if (!funcs->generateMipmap) {
2294  funcs->generateMipmap = (type_glGenerateMipmap)
2295  context->getProcAddress(QLatin1String("glGenerateMipmapARB"));
2296  }
2297 
2298  if (funcs->generateMipmap)
2299  funcs->generateMipmap(target);
2300  else
2301  funcs->generateMipmap = qglfResolveGenerateMipmap;
2302 }
2303 
2304 static void qglfResolveGenFramebuffers(GLsizei n, GLuint* framebuffers)
2305 {
2306  typedef void (QGLF_APIENTRYP type_glGenFramebuffers)(GLsizei n, GLuint* framebuffers);
2307 
2308  const QGLContext *context = QGLContext::currentContext();
2309  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2310 
2311  funcs->genFramebuffers = (type_glGenFramebuffers)
2312  context->getProcAddress(QLatin1String("glGenFramebuffers"));
2313 #ifdef QT_OPENGL_ES
2314  if (!funcs->genFramebuffers) {
2315  funcs->genFramebuffers = (type_glGenFramebuffers)
2316  context->getProcAddress(QLatin1String("glGenFramebuffersOES"));
2317  }
2318 #endif
2319  if (!funcs->genFramebuffers) {
2320  funcs->genFramebuffers = (type_glGenFramebuffers)
2321  context->getProcAddress(QLatin1String("glGenFramebuffersEXT"));
2322  }
2323  if (!funcs->genFramebuffers) {
2324  funcs->genFramebuffers = (type_glGenFramebuffers)
2325  context->getProcAddress(QLatin1String("glGenFramebuffersARB"));
2326  }
2327 
2328  if (funcs->genFramebuffers)
2329  funcs->genFramebuffers(n, framebuffers);
2330  else
2331  funcs->genFramebuffers = qglfResolveGenFramebuffers;
2332 }
2333 
2334 static void qglfResolveGenRenderbuffers(GLsizei n, GLuint* renderbuffers)
2335 {
2336  typedef void (QGLF_APIENTRYP type_glGenRenderbuffers)(GLsizei n, GLuint* renderbuffers);
2337 
2338  const QGLContext *context = QGLContext::currentContext();
2339  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2340 
2341  funcs->genRenderbuffers = (type_glGenRenderbuffers)
2342  context->getProcAddress(QLatin1String("glGenRenderbuffers"));
2343 #ifdef QT_OPENGL_ES
2344  if (!funcs->genRenderbuffers) {
2345  funcs->genRenderbuffers = (type_glGenRenderbuffers)
2346  context->getProcAddress(QLatin1String("glGenRenderbuffersOES"));
2347  }
2348 #endif
2349  if (!funcs->genRenderbuffers) {
2350  funcs->genRenderbuffers = (type_glGenRenderbuffers)
2351  context->getProcAddress(QLatin1String("glGenRenderbuffersEXT"));
2352  }
2353  if (!funcs->genRenderbuffers) {
2354  funcs->genRenderbuffers = (type_glGenRenderbuffers)
2355  context->getProcAddress(QLatin1String("glGenRenderbuffersARB"));
2356  }
2357 
2358  if (funcs->genRenderbuffers)
2359  funcs->genRenderbuffers(n, renderbuffers);
2360  else
2361  funcs->genRenderbuffers = qglfResolveGenRenderbuffers;
2362 }
2363 
2364 static void qglfResolveGetActiveAttrib(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name)
2365 {
2366  typedef void (QGLF_APIENTRYP type_glGetActiveAttrib)(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name);
2367 
2368  const QGLContext *context = QGLContext::currentContext();
2369  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2370 
2371  funcs->getActiveAttrib = (type_glGetActiveAttrib)
2372  context->getProcAddress(QLatin1String("glGetActiveAttrib"));
2373  if (!funcs->getActiveAttrib) {
2374  funcs->getActiveAttrib = (type_glGetActiveAttrib)
2375  context->getProcAddress(QLatin1String("glGetActiveAttribARB"));
2376  }
2377 
2378  if (funcs->getActiveAttrib)
2379  funcs->getActiveAttrib(program, index, bufsize, length, size, type, name);
2380  else
2381  funcs->getActiveAttrib = qglfResolveGetActiveAttrib;
2382 }
2383 
2384 static void qglfResolveGetActiveUniform(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name)
2385 {
2386  typedef void (QGLF_APIENTRYP type_glGetActiveUniform)(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name);
2387 
2388  const QGLContext *context = QGLContext::currentContext();
2389  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2390 
2391  funcs->getActiveUniform = (type_glGetActiveUniform)
2392  context->getProcAddress(QLatin1String("glGetActiveUniform"));
2393  if (!funcs->getActiveUniform) {
2394  funcs->getActiveUniform = (type_glGetActiveUniform)
2395  context->getProcAddress(QLatin1String("glGetActiveUniformARB"));
2396  }
2397 
2398  if (funcs->getActiveUniform)
2399  funcs->getActiveUniform(program, index, bufsize, length, size, type, name);
2400  else
2401  funcs->getActiveUniform = qglfResolveGetActiveUniform;
2402 }
2403 
2404 static void qglfResolveGetAttachedShaders(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders)
2405 {
2406  typedef void (QGLF_APIENTRYP type_glGetAttachedShaders)(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders);
2407 
2408  const QGLContext *context = QGLContext::currentContext();
2409  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2410 
2411  funcs->getAttachedShaders = (type_glGetAttachedShaders)
2412  context->getProcAddress(QLatin1String("glGetAttachedShaders"));
2413  if (!funcs->getAttachedShaders) {
2414  funcs->getAttachedShaders = (type_glGetAttachedShaders)
2415  context->getProcAddress(QLatin1String("glGetAttachedObjectsARB"));
2416  }
2417 
2418  if (funcs->getAttachedShaders)
2419  funcs->getAttachedShaders(program, maxcount, count, shaders);
2420  else
2421  funcs->getAttachedShaders = qglfResolveGetAttachedShaders;
2422 }
2423 
2424 static int qglfResolveGetAttribLocation(GLuint program, const char* name)
2425 {
2426  typedef int (QGLF_APIENTRYP type_glGetAttribLocation)(GLuint program, const char* name);
2427 
2428  const QGLContext *context = QGLContext::currentContext();
2429  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2430 
2431  funcs->getAttribLocation = (type_glGetAttribLocation)
2432  context->getProcAddress(QLatin1String("glGetAttribLocation"));
2433  if (!funcs->getAttribLocation) {
2434  funcs->getAttribLocation = (type_glGetAttribLocation)
2435  context->getProcAddress(QLatin1String("glGetAttribLocationARB"));
2436  }
2437 
2438  if (funcs->getAttribLocation)
2439  return funcs->getAttribLocation(program, name);
2440  funcs->getAttribLocation = qglfResolveGetAttribLocation;
2441  return int(0);
2442 }
2443 
2444 static void qglfResolveGetBufferParameteriv(GLenum target, GLenum pname, GLint* params)
2445 {
2446  typedef void (QGLF_APIENTRYP type_glGetBufferParameteriv)(GLenum target, GLenum pname, GLint* params);
2447 
2448  const QGLContext *context = QGLContext::currentContext();
2449  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2450 
2451  funcs->getBufferParameteriv = (type_glGetBufferParameteriv)
2452  context->getProcAddress(QLatin1String("glGetBufferParameteriv"));
2453 #ifdef QT_OPENGL_ES
2454  if (!funcs->getBufferParameteriv) {
2455  funcs->getBufferParameteriv = (type_glGetBufferParameteriv)
2456  context->getProcAddress(QLatin1String("glGetBufferParameterivOES"));
2457  }
2458 #endif
2459  if (!funcs->getBufferParameteriv) {
2460  funcs->getBufferParameteriv = (type_glGetBufferParameteriv)
2461  context->getProcAddress(QLatin1String("glGetBufferParameterivEXT"));
2462  }
2463  if (!funcs->getBufferParameteriv) {
2464  funcs->getBufferParameteriv = (type_glGetBufferParameteriv)
2465  context->getProcAddress(QLatin1String("glGetBufferParameterivARB"));
2466  }
2467 
2468  if (funcs->getBufferParameteriv)
2469  funcs->getBufferParameteriv(target, pname, params);
2470  else
2471  funcs->getBufferParameteriv = qglfResolveGetBufferParameteriv;
2472 }
2473 
2474 static void qglfResolveGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint* params)
2475 {
2476  typedef void (QGLF_APIENTRYP type_glGetFramebufferAttachmentParameteriv)(GLenum target, GLenum attachment, GLenum pname, GLint* params);
2477 
2478  const QGLContext *context = QGLContext::currentContext();
2479  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2480 
2481  funcs->getFramebufferAttachmentParameteriv = (type_glGetFramebufferAttachmentParameteriv)
2482  context->getProcAddress(QLatin1String("glGetFramebufferAttachmentParameteriv"));
2483 #ifdef QT_OPENGL_ES
2484  if (!funcs->getFramebufferAttachmentParameteriv) {
2485  funcs->getFramebufferAttachmentParameteriv = (type_glGetFramebufferAttachmentParameteriv)
2486  context->getProcAddress(QLatin1String("glGetFramebufferAttachmentParameterivOES"));
2487  }
2488 #endif
2489  if (!funcs->getFramebufferAttachmentParameteriv) {
2490  funcs->getFramebufferAttachmentParameteriv = (type_glGetFramebufferAttachmentParameteriv)
2491  context->getProcAddress(QLatin1String("glGetFramebufferAttachmentParameterivEXT"));
2492  }
2493  if (!funcs->getFramebufferAttachmentParameteriv) {
2494  funcs->getFramebufferAttachmentParameteriv = (type_glGetFramebufferAttachmentParameteriv)
2495  context->getProcAddress(QLatin1String("glGetFramebufferAttachmentParameterivARB"));
2496  }
2497 
2498  if (funcs->getFramebufferAttachmentParameteriv)
2499  funcs->getFramebufferAttachmentParameteriv(target, attachment, pname, params);
2500  else
2501  funcs->getFramebufferAttachmentParameteriv = qglfResolveGetFramebufferAttachmentParameteriv;
2502 }
2503 
2504 static void qglfResolveGetProgramiv(GLuint program, GLenum pname, GLint* params)
2505 {
2506  typedef void (QGLF_APIENTRYP type_glGetProgramiv)(GLuint program, GLenum pname, GLint* params);
2507 
2508  const QGLContext *context = QGLContext::currentContext();
2509  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2510 
2511  funcs->getProgramiv = (type_glGetProgramiv)
2512  context->getProcAddress(QLatin1String("glGetProgramiv"));
2513  if (!funcs->getProgramiv) {
2514  funcs->getProgramiv = (type_glGetProgramiv)
2515  context->getProcAddress(QLatin1String("glGetObjectParameterivARB"));
2516  }
2517 
2518  if (funcs->getProgramiv)
2519  funcs->getProgramiv(program, pname, params);
2520  else
2521  funcs->getProgramiv = qglfResolveGetProgramiv;
2522 }
2523 
2524 static void qglfResolveGetProgramInfoLog(GLuint program, GLsizei bufsize, GLsizei* length, char* infolog)
2525 {
2526  typedef void (QGLF_APIENTRYP type_glGetProgramInfoLog)(GLuint program, GLsizei bufsize, GLsizei* length, char* infolog);
2527 
2528  const QGLContext *context = QGLContext::currentContext();
2529  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2530 
2531  funcs->getProgramInfoLog = (type_glGetProgramInfoLog)
2532  context->getProcAddress(QLatin1String("glGetProgramInfoLog"));
2533  if (!funcs->getProgramInfoLog) {
2534  funcs->getProgramInfoLog = (type_glGetProgramInfoLog)
2535  context->getProcAddress(QLatin1String("glGetInfoLogARB"));
2536  }
2537 
2538  if (funcs->getProgramInfoLog)
2539  funcs->getProgramInfoLog(program, bufsize, length, infolog);
2540  else
2541  funcs->getProgramInfoLog = qglfResolveGetProgramInfoLog;
2542 }
2543 
2544 static void qglfResolveGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* params)
2545 {
2546  typedef void (QGLF_APIENTRYP type_glGetRenderbufferParameteriv)(GLenum target, GLenum pname, GLint* params);
2547 
2548  const QGLContext *context = QGLContext::currentContext();
2549  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2550 
2551  funcs->getRenderbufferParameteriv = (type_glGetRenderbufferParameteriv)
2552  context->getProcAddress(QLatin1String("glGetRenderbufferParameteriv"));
2553 #ifdef QT_OPENGL_ES
2554  if (!funcs->getRenderbufferParameteriv) {
2555  funcs->getRenderbufferParameteriv = (type_glGetRenderbufferParameteriv)
2556  context->getProcAddress(QLatin1String("glGetRenderbufferParameterivOES"));
2557  }
2558 #endif
2559  if (!funcs->getRenderbufferParameteriv) {
2560  funcs->getRenderbufferParameteriv = (type_glGetRenderbufferParameteriv)
2561  context->getProcAddress(QLatin1String("glGetRenderbufferParameterivEXT"));
2562  }
2563  if (!funcs->getRenderbufferParameteriv) {
2564  funcs->getRenderbufferParameteriv = (type_glGetRenderbufferParameteriv)
2565  context->getProcAddress(QLatin1String("glGetRenderbufferParameterivARB"));
2566  }
2567 
2568  if (funcs->getRenderbufferParameteriv)
2569  funcs->getRenderbufferParameteriv(target, pname, params);
2570  else
2571  funcs->getRenderbufferParameteriv = qglfResolveGetRenderbufferParameteriv;
2572 }
2573 
2574 static void qglfResolveGetShaderiv(GLuint shader, GLenum pname, GLint* params)
2575 {
2576  typedef void (QGLF_APIENTRYP type_glGetShaderiv)(GLuint shader, GLenum pname, GLint* params);
2577 
2578  const QGLContext *context = QGLContext::currentContext();
2579  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2580 
2581  funcs->getShaderiv = (type_glGetShaderiv)
2582  context->getProcAddress(QLatin1String("glGetShaderiv"));
2583  if (!funcs->getShaderiv) {
2584  funcs->getShaderiv = (type_glGetShaderiv)
2585  context->getProcAddress(QLatin1String("glGetObjectParameterivARB"));
2586  }
2587 
2588  if (funcs->getShaderiv)
2589  funcs->getShaderiv(shader, pname, params);
2590  else
2591  funcs->getShaderiv = qglfResolveGetShaderiv;
2592 }
2593 
2594 static void qglfResolveGetShaderInfoLog(GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog)
2595 {
2596  typedef void (QGLF_APIENTRYP type_glGetShaderInfoLog)(GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog);
2597 
2598  const QGLContext *context = QGLContext::currentContext();
2599  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2600 
2601  funcs->getShaderInfoLog = (type_glGetShaderInfoLog)
2602  context->getProcAddress(QLatin1String("glGetShaderInfoLog"));
2603  if (!funcs->getShaderInfoLog) {
2604  funcs->getShaderInfoLog = (type_glGetShaderInfoLog)
2605  context->getProcAddress(QLatin1String("glGetInfoLogARB"));
2606  }
2607 
2608  if (funcs->getShaderInfoLog)
2609  funcs->getShaderInfoLog(shader, bufsize, length, infolog);
2610  else
2611  funcs->getShaderInfoLog = qglfResolveGetShaderInfoLog;
2612 }
2613 
2614 static void qglfSpecialGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision)
2615 {
2616  Q_UNUSED(shadertype);
2617  Q_UNUSED(precisiontype);
2618  range[0] = range[1] = precision[0] = 0;
2619 }
2620 
2621 static void qglfResolveGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision)
2622 {
2623  typedef void (QGLF_APIENTRYP type_glGetShaderPrecisionFormat)(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision);
2624 
2625  const QGLContext *context = QGLContext::currentContext();
2626  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2627 
2628  funcs->getShaderPrecisionFormat = (type_glGetShaderPrecisionFormat)
2629  context->getProcAddress(QLatin1String("glGetShaderPrecisionFormat"));
2630 #ifdef QT_OPENGL_ES
2631  if (!funcs->getShaderPrecisionFormat) {
2632  funcs->getShaderPrecisionFormat = (type_glGetShaderPrecisionFormat)
2633  context->getProcAddress(QLatin1String("glGetShaderPrecisionFormatOES"));
2634  }
2635 #endif
2636  if (!funcs->getShaderPrecisionFormat) {
2637  funcs->getShaderPrecisionFormat = (type_glGetShaderPrecisionFormat)
2638  context->getProcAddress(QLatin1String("glGetShaderPrecisionFormatEXT"));
2639  }
2640  if (!funcs->getShaderPrecisionFormat) {
2641  funcs->getShaderPrecisionFormat = (type_glGetShaderPrecisionFormat)
2642  context->getProcAddress(QLatin1String("glGetShaderPrecisionFormatARB"));
2643  }
2644 
2645  if (!funcs->getShaderPrecisionFormat)
2646  funcs->getShaderPrecisionFormat = qglfSpecialGetShaderPrecisionFormat;
2647 
2648  funcs->getShaderPrecisionFormat(shadertype, precisiontype, range, precision);
2649 }
2650 
2651 static void qglfResolveGetShaderSource(GLuint shader, GLsizei bufsize, GLsizei* length, char* source)
2652 {
2653  typedef void (QGLF_APIENTRYP type_glGetShaderSource)(GLuint shader, GLsizei bufsize, GLsizei* length, char* source);
2654 
2655  const QGLContext *context = QGLContext::currentContext();
2656  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2657 
2658  funcs->getShaderSource = (type_glGetShaderSource)
2659  context->getProcAddress(QLatin1String("glGetShaderSource"));
2660  if (!funcs->getShaderSource) {
2661  funcs->getShaderSource = (type_glGetShaderSource)
2662  context->getProcAddress(QLatin1String("glGetShaderSourceARB"));
2663  }
2664 
2665  if (funcs->getShaderSource)
2666  funcs->getShaderSource(shader, bufsize, length, source);
2667  else
2668  funcs->getShaderSource = qglfResolveGetShaderSource;
2669 }
2670 
2671 static void qglfResolveGetUniformfv(GLuint program, GLint location, GLfloat* params)
2672 {
2673  typedef void (QGLF_APIENTRYP type_glGetUniformfv)(GLuint program, GLint location, GLfloat* params);
2674 
2675  const QGLContext *context = QGLContext::currentContext();
2676  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2677 
2678  funcs->getUniformfv = (type_glGetUniformfv)
2679  context->getProcAddress(QLatin1String("glGetUniformfv"));
2680  if (!funcs->getUniformfv) {
2681  funcs->getUniformfv = (type_glGetUniformfv)
2682  context->getProcAddress(QLatin1String("glGetUniformfvARB"));
2683  }
2684 
2685  if (funcs->getUniformfv)
2686  funcs->getUniformfv(program, location, params);
2687  else
2688  funcs->getUniformfv = qglfResolveGetUniformfv;
2689 }
2690 
2691 static void qglfResolveGetUniformiv(GLuint program, GLint location, GLint* params)
2692 {
2693  typedef void (QGLF_APIENTRYP type_glGetUniformiv)(GLuint program, GLint location, GLint* params);
2694 
2695  const QGLContext *context = QGLContext::currentContext();
2696  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2697 
2698  funcs->getUniformiv = (type_glGetUniformiv)
2699  context->getProcAddress(QLatin1String("glGetUniformiv"));
2700  if (!funcs->getUniformiv) {
2701  funcs->getUniformiv = (type_glGetUniformiv)
2702  context->getProcAddress(QLatin1String("glGetUniformivARB"));
2703  }
2704 
2705  if (funcs->getUniformiv)
2706  funcs->getUniformiv(program, location, params);
2707  else
2708  funcs->getUniformiv = qglfResolveGetUniformiv;
2709 }
2710 
2711 static int qglfResolveGetUniformLocation(GLuint program, const char* name)
2712 {
2713  typedef int (QGLF_APIENTRYP type_glGetUniformLocation)(GLuint program, const char* name);
2714 
2715  const QGLContext *context = QGLContext::currentContext();
2716  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2717 
2718  funcs->getUniformLocation = (type_glGetUniformLocation)
2719  context->getProcAddress(QLatin1String("glGetUniformLocation"));
2720  if (!funcs->getUniformLocation) {
2721  funcs->getUniformLocation = (type_glGetUniformLocation)
2722  context->getProcAddress(QLatin1String("glGetUniformLocationARB"));
2723  }
2724 
2725  if (funcs->getUniformLocation)
2726  return funcs->getUniformLocation(program, name);
2727  funcs->getUniformLocation = qglfResolveGetUniformLocation;
2728  return int(0);
2729 }
2730 
2731 static void qglfResolveGetVertexAttribfv(GLuint index, GLenum pname, GLfloat* params)
2732 {
2733  typedef void (QGLF_APIENTRYP type_glGetVertexAttribfv)(GLuint index, GLenum pname, GLfloat* params);
2734 
2735  const QGLContext *context = QGLContext::currentContext();
2736  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2737 
2738  funcs->getVertexAttribfv = (type_glGetVertexAttribfv)
2739  context->getProcAddress(QLatin1String("glGetVertexAttribfv"));
2740  if (!funcs->getVertexAttribfv) {
2741  funcs->getVertexAttribfv = (type_glGetVertexAttribfv)
2742  context->getProcAddress(QLatin1String("glGetVertexAttribfvARB"));
2743  }
2744 
2745  if (funcs->getVertexAttribfv)
2746  funcs->getVertexAttribfv(index, pname, params);
2747  else
2748  funcs->getVertexAttribfv = qglfResolveGetVertexAttribfv;
2749 }
2750 
2751 static void qglfResolveGetVertexAttribiv(GLuint index, GLenum pname, GLint* params)
2752 {
2753  typedef void (QGLF_APIENTRYP type_glGetVertexAttribiv)(GLuint index, GLenum pname, GLint* params);
2754 
2755  const QGLContext *context = QGLContext::currentContext();
2756  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2757 
2758  funcs->getVertexAttribiv = (type_glGetVertexAttribiv)
2759  context->getProcAddress(QLatin1String("glGetVertexAttribiv"));
2760  if (!funcs->getVertexAttribiv) {
2761  funcs->getVertexAttribiv = (type_glGetVertexAttribiv)
2762  context->getProcAddress(QLatin1String("glGetVertexAttribivARB"));
2763  }
2764 
2765  if (funcs->getVertexAttribiv)
2766  funcs->getVertexAttribiv(index, pname, params);
2767  else
2768  funcs->getVertexAttribiv = qglfResolveGetVertexAttribiv;
2769 }
2770 
2771 static void qglfResolveGetVertexAttribPointerv(GLuint index, GLenum pname, void** pointer)
2772 {
2773  typedef void (QGLF_APIENTRYP type_glGetVertexAttribPointerv)(GLuint index, GLenum pname, void** pointer);
2774 
2775  const QGLContext *context = QGLContext::currentContext();
2776  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2777 
2778  funcs->getVertexAttribPointerv = (type_glGetVertexAttribPointerv)
2779  context->getProcAddress(QLatin1String("glGetVertexAttribPointerv"));
2780  if (!funcs->getVertexAttribPointerv) {
2781  funcs->getVertexAttribPointerv = (type_glGetVertexAttribPointerv)
2782  context->getProcAddress(QLatin1String("glGetVertexAttribPointervARB"));
2783  }
2784 
2785  if (funcs->getVertexAttribPointerv)
2786  funcs->getVertexAttribPointerv(index, pname, pointer);
2787  else
2788  funcs->getVertexAttribPointerv = qglfResolveGetVertexAttribPointerv;
2789 }
2790 
2791 static GLboolean qglfResolveIsBuffer(GLuint buffer)
2792 {
2793  typedef GLboolean (QGLF_APIENTRYP type_glIsBuffer)(GLuint buffer);
2794 
2795  const QGLContext *context = QGLContext::currentContext();
2796  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2797 
2798  funcs->isBuffer = (type_glIsBuffer)
2799  context->getProcAddress(QLatin1String("glIsBuffer"));
2800 #ifdef QT_OPENGL_ES
2801  if (!funcs->isBuffer) {
2802  funcs->isBuffer = (type_glIsBuffer)
2803  context->getProcAddress(QLatin1String("glIsBufferOES"));
2804  }
2805 #endif
2806  if (!funcs->isBuffer) {
2807  funcs->isBuffer = (type_glIsBuffer)
2808  context->getProcAddress(QLatin1String("glIsBufferEXT"));
2809  }
2810  if (!funcs->isBuffer) {
2811  funcs->isBuffer = (type_glIsBuffer)
2812  context->getProcAddress(QLatin1String("glIsBufferARB"));
2813  }
2814 
2815  if (funcs->isBuffer)
2816  return funcs->isBuffer(buffer);
2817  funcs->isBuffer = qglfResolveIsBuffer;
2818  return GLboolean(0);
2819 }
2820 
2821 static GLboolean qglfResolveIsFramebuffer(GLuint framebuffer)
2822 {
2823  typedef GLboolean (QGLF_APIENTRYP type_glIsFramebuffer)(GLuint framebuffer);
2824 
2825  const QGLContext *context = QGLContext::currentContext();
2826  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2827 
2828  funcs->isFramebuffer = (type_glIsFramebuffer)
2829  context->getProcAddress(QLatin1String("glIsFramebuffer"));
2830 #ifdef QT_OPENGL_ES
2831  if (!funcs->isFramebuffer) {
2832  funcs->isFramebuffer = (type_glIsFramebuffer)
2833  context->getProcAddress(QLatin1String("glIsFramebufferOES"));
2834  }
2835 #endif
2836  if (!funcs->isFramebuffer) {
2837  funcs->isFramebuffer = (type_glIsFramebuffer)
2838  context->getProcAddress(QLatin1String("glIsFramebufferEXT"));
2839  }
2840  if (!funcs->isFramebuffer) {
2841  funcs->isFramebuffer = (type_glIsFramebuffer)
2842  context->getProcAddress(QLatin1String("glIsFramebufferARB"));
2843  }
2844 
2845  if (funcs->isFramebuffer)
2846  return funcs->isFramebuffer(framebuffer);
2847  funcs->isFramebuffer = qglfResolveIsFramebuffer;
2848  return GLboolean(0);
2849 }
2850 
2851 static GLboolean qglfSpecialIsProgram(GLuint program)
2852 {
2853  return program != 0;
2854 }
2855 
2856 static GLboolean qglfResolveIsProgram(GLuint program)
2857 {
2858  typedef GLboolean (QGLF_APIENTRYP type_glIsProgram)(GLuint program);
2859 
2860  const QGLContext *context = QGLContext::currentContext();
2861  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2862 
2863  funcs->isProgram = (type_glIsProgram)
2864  context->getProcAddress(QLatin1String("glIsProgram"));
2865  if (!funcs->isProgram) {
2866  funcs->isProgram = (type_glIsProgram)
2867  context->getProcAddress(QLatin1String("glIsProgramARB"));
2868  }
2869 
2870  if (!funcs->isProgram)
2871  funcs->isProgram = qglfSpecialIsProgram;
2872 
2873  return funcs->isProgram(program);
2874 }
2875 
2876 static GLboolean qglfResolveIsRenderbuffer(GLuint renderbuffer)
2877 {
2878  typedef GLboolean (QGLF_APIENTRYP type_glIsRenderbuffer)(GLuint renderbuffer);
2879 
2880  const QGLContext *context = QGLContext::currentContext();
2881  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2882 
2883  funcs->isRenderbuffer = (type_glIsRenderbuffer)
2884  context->getProcAddress(QLatin1String("glIsRenderbuffer"));
2885 #ifdef QT_OPENGL_ES
2886  if (!funcs->isRenderbuffer) {
2887  funcs->isRenderbuffer = (type_glIsRenderbuffer)
2888  context->getProcAddress(QLatin1String("glIsRenderbufferOES"));
2889  }
2890 #endif
2891  if (!funcs->isRenderbuffer) {
2892  funcs->isRenderbuffer = (type_glIsRenderbuffer)
2893  context->getProcAddress(QLatin1String("glIsRenderbufferEXT"));
2894  }
2895  if (!funcs->isRenderbuffer) {
2896  funcs->isRenderbuffer = (type_glIsRenderbuffer)
2897  context->getProcAddress(QLatin1String("glIsRenderbufferARB"));
2898  }
2899 
2900  if (funcs->isRenderbuffer)
2901  return funcs->isRenderbuffer(renderbuffer);
2902  funcs->isRenderbuffer = qglfResolveIsRenderbuffer;
2903  return GLboolean(0);
2904 }
2905 
2906 static GLboolean qglfSpecialIsShader(GLuint shader)
2907 {
2908  return shader != 0;
2909 }
2910 
2911 static GLboolean qglfResolveIsShader(GLuint shader)
2912 {
2913  typedef GLboolean (QGLF_APIENTRYP type_glIsShader)(GLuint shader);
2914 
2915  const QGLContext *context = QGLContext::currentContext();
2916  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2917 
2918  funcs->isShader = (type_glIsShader)
2919  context->getProcAddress(QLatin1String("glIsShader"));
2920  if (!funcs->isShader) {
2921  funcs->isShader = (type_glIsShader)
2922  context->getProcAddress(QLatin1String("glIsShaderARB"));
2923  }
2924 
2925  if (!funcs->isShader)
2926  funcs->isShader = qglfSpecialIsShader;
2927 
2928  return funcs->isShader(shader);
2929 }
2930 
2931 static void qglfResolveLinkProgram(GLuint program)
2932 {
2933  typedef void (QGLF_APIENTRYP type_glLinkProgram)(GLuint program);
2934 
2935  const QGLContext *context = QGLContext::currentContext();
2936  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2937 
2938  funcs->linkProgram = (type_glLinkProgram)
2939  context->getProcAddress(QLatin1String("glLinkProgram"));
2940  if (!funcs->linkProgram) {
2941  funcs->linkProgram = (type_glLinkProgram)
2942  context->getProcAddress(QLatin1String("glLinkProgramARB"));
2943  }
2944 
2945  if (funcs->linkProgram)
2946  funcs->linkProgram(program);
2947  else
2948  funcs->linkProgram = qglfResolveLinkProgram;
2949 }
2950 
2952 {
2953 }
2954 
2956 {
2957  typedef void (QGLF_APIENTRYP type_glReleaseShaderCompiler)();
2958 
2959  const QGLContext *context = QGLContext::currentContext();
2960  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2961 
2962  funcs->releaseShaderCompiler = (type_glReleaseShaderCompiler)
2963  context->getProcAddress(QLatin1String("glReleaseShaderCompiler"));
2964  if (!funcs->releaseShaderCompiler) {
2965  funcs->releaseShaderCompiler = (type_glReleaseShaderCompiler)
2966  context->getProcAddress(QLatin1String("glReleaseShaderCompilerARB"));
2967  }
2968 
2969  if (!funcs->releaseShaderCompiler)
2970  funcs->releaseShaderCompiler = qglfSpecialReleaseShaderCompiler;
2971 
2972  funcs->releaseShaderCompiler();
2973 }
2974 
2975 static void qglfResolveRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
2976 {
2977  typedef void (QGLF_APIENTRYP type_glRenderbufferStorage)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
2978 
2979  const QGLContext *context = QGLContext::currentContext();
2980  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2981 
2982  funcs->renderbufferStorage = (type_glRenderbufferStorage)
2983  context->getProcAddress(QLatin1String("glRenderbufferStorage"));
2984 #ifdef QT_OPENGL_ES
2985  if (!funcs->renderbufferStorage) {
2986  funcs->renderbufferStorage = (type_glRenderbufferStorage)
2987  context->getProcAddress(QLatin1String("glRenderbufferStorageOES"));
2988  }
2989 #endif
2990  if (!funcs->renderbufferStorage) {
2991  funcs->renderbufferStorage = (type_glRenderbufferStorage)
2992  context->getProcAddress(QLatin1String("glRenderbufferStorageEXT"));
2993  }
2994  if (!funcs->renderbufferStorage) {
2995  funcs->renderbufferStorage = (type_glRenderbufferStorage)
2996  context->getProcAddress(QLatin1String("glRenderbufferStorageARB"));
2997  }
2998 
2999  if (funcs->renderbufferStorage)
3000  funcs->renderbufferStorage(target, internalformat, width, height);
3001  else
3002  funcs->renderbufferStorage = qglfResolveRenderbufferStorage;
3003 }
3004 
3005 static void qglfResolveSampleCoverage(GLclampf value, GLboolean invert)
3006 {
3007  typedef void (QGLF_APIENTRYP type_glSampleCoverage)(GLclampf value, GLboolean invert);
3008 
3009  const QGLContext *context = QGLContext::currentContext();
3010  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3011 
3012  funcs->sampleCoverage = (type_glSampleCoverage)
3013  context->getProcAddress(QLatin1String("glSampleCoverage"));
3014 #ifdef QT_OPENGL_ES
3015  if (!funcs->sampleCoverage) {
3016  funcs->sampleCoverage = (type_glSampleCoverage)
3017  context->getProcAddress(QLatin1String("glSampleCoverageOES"));
3018  }
3019 #endif
3020  if (!funcs->sampleCoverage) {
3021  funcs->sampleCoverage = (type_glSampleCoverage)
3022  context->getProcAddress(QLatin1String("glSampleCoverageEXT"));
3023  }
3024  if (!funcs->sampleCoverage) {
3025  funcs->sampleCoverage = (type_glSampleCoverage)
3026  context->getProcAddress(QLatin1String("glSampleCoverageARB"));
3027  }
3028 
3029  if (funcs->sampleCoverage)
3030  funcs->sampleCoverage(value, invert);
3031  else
3032  funcs->sampleCoverage = qglfResolveSampleCoverage;
3033 }
3034 
3035 static void qglfResolveShaderBinary(GLint n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLint length)
3036 {
3037  typedef void (QGLF_APIENTRYP type_glShaderBinary)(GLint n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLint length);
3038 
3039  const QGLContext *context = QGLContext::currentContext();
3040  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3041 
3042  funcs->shaderBinary = (type_glShaderBinary)
3043  context->getProcAddress(QLatin1String("glShaderBinary"));
3044  if (!funcs->shaderBinary) {
3045  funcs->shaderBinary = (type_glShaderBinary)
3046  context->getProcAddress(QLatin1String("glShaderBinaryARB"));
3047  }
3048 
3049  if (funcs->shaderBinary)
3050  funcs->shaderBinary(n, shaders, binaryformat, binary, length);
3051  else
3052  funcs->shaderBinary = qglfResolveShaderBinary;
3053 }
3054 
3055 static void qglfResolveShaderSource(GLuint shader, GLsizei count, const char** string, const GLint* length)
3056 {
3057  typedef void (QGLF_APIENTRYP type_glShaderSource)(GLuint shader, GLsizei count, const char** string, const GLint* length);
3058 
3059  const QGLContext *context = QGLContext::currentContext();
3060  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3061 
3062  funcs->shaderSource = (type_glShaderSource)
3063  context->getProcAddress(QLatin1String("glShaderSource"));
3064  if (!funcs->shaderSource) {
3065  funcs->shaderSource = (type_glShaderSource)
3066  context->getProcAddress(QLatin1String("glShaderSourceARB"));
3067  }
3068 
3069  if (funcs->shaderSource)
3070  funcs->shaderSource(shader, count, string, length);
3071  else
3072  funcs->shaderSource = qglfResolveShaderSource;
3073 }
3074 
3075 static void qglfResolveStencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask)
3076 {
3077  typedef void (QGLF_APIENTRYP type_glStencilFuncSeparate)(GLenum face, GLenum func, GLint ref, GLuint mask);
3078 
3079  const QGLContext *context = QGLContext::currentContext();
3080  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3081 
3082  funcs->stencilFuncSeparate = (type_glStencilFuncSeparate)
3083  context->getProcAddress(QLatin1String("glStencilFuncSeparate"));
3084 #ifdef QT_OPENGL_ES
3085  if (!funcs->stencilFuncSeparate) {
3086  funcs->stencilFuncSeparate = (type_glStencilFuncSeparate)
3087  context->getProcAddress(QLatin1String("glStencilFuncSeparateOES"));
3088  }
3089 #endif
3090  if (!funcs->stencilFuncSeparate) {
3091  funcs->stencilFuncSeparate = (type_glStencilFuncSeparate)
3092  context->getProcAddress(QLatin1String("glStencilFuncSeparateEXT"));
3093  }
3094  if (!funcs->stencilFuncSeparate) {
3095  funcs->stencilFuncSeparate = (type_glStencilFuncSeparate)
3096  context->getProcAddress(QLatin1String("glStencilFuncSeparateARB"));
3097  }
3098 
3099  if (funcs->stencilFuncSeparate)
3100  funcs->stencilFuncSeparate(face, func, ref, mask);
3101  else
3102  funcs->stencilFuncSeparate = qglfResolveStencilFuncSeparate;
3103 }
3104 
3105 static void qglfResolveStencilMaskSeparate(GLenum face, GLuint mask)
3106 {
3107  typedef void (QGLF_APIENTRYP type_glStencilMaskSeparate)(GLenum face, GLuint mask);
3108 
3109  const QGLContext *context = QGLContext::currentContext();
3110  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3111 
3112  funcs->stencilMaskSeparate = (type_glStencilMaskSeparate)
3113  context->getProcAddress(QLatin1String("glStencilMaskSeparate"));
3114 #ifdef QT_OPENGL_ES
3115  if (!funcs->stencilMaskSeparate) {
3116  funcs->stencilMaskSeparate = (type_glStencilMaskSeparate)
3117  context->getProcAddress(QLatin1String("glStencilMaskSeparateOES"));
3118  }
3119 #endif
3120  if (!funcs->stencilMaskSeparate) {
3121  funcs->stencilMaskSeparate = (type_glStencilMaskSeparate)
3122  context->getProcAddress(QLatin1String("glStencilMaskSeparateEXT"));
3123  }
3124  if (!funcs->stencilMaskSeparate) {
3125  funcs->stencilMaskSeparate = (type_glStencilMaskSeparate)
3126  context->getProcAddress(QLatin1String("glStencilMaskSeparateARB"));
3127  }
3128 
3129  if (funcs->stencilMaskSeparate)
3130  funcs->stencilMaskSeparate(face, mask);
3131  else
3132  funcs->stencilMaskSeparate = qglfResolveStencilMaskSeparate;
3133 }
3134 
3135 static void qglfResolveStencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass)
3136 {
3137  typedef void (QGLF_APIENTRYP type_glStencilOpSeparate)(GLenum face, GLenum fail, GLenum zfail, GLenum zpass);
3138 
3139  const QGLContext *context = QGLContext::currentContext();
3140  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3141 
3142  funcs->stencilOpSeparate = (type_glStencilOpSeparate)
3143  context->getProcAddress(QLatin1String("glStencilOpSeparate"));
3144 #ifdef QT_OPENGL_ES
3145  if (!funcs->stencilOpSeparate) {
3146  funcs->stencilOpSeparate = (type_glStencilOpSeparate)
3147  context->getProcAddress(QLatin1String("glStencilOpSeparateOES"));
3148  }
3149 #endif
3150  if (!funcs->stencilOpSeparate) {
3151  funcs->stencilOpSeparate = (type_glStencilOpSeparate)
3152  context->getProcAddress(QLatin1String("glStencilOpSeparateEXT"));
3153  }
3154  if (!funcs->stencilOpSeparate) {
3155  funcs->stencilOpSeparate = (type_glStencilOpSeparate)
3156  context->getProcAddress(QLatin1String("glStencilOpSeparateARB"));
3157  }
3158 
3159  if (funcs->stencilOpSeparate)
3160  funcs->stencilOpSeparate(face, fail, zfail, zpass);
3161  else
3162  funcs->stencilOpSeparate = qglfResolveStencilOpSeparate;
3163 }
3164 
3165 static void qglfResolveUniform1f(GLint location, GLfloat x)
3166 {
3167  typedef void (QGLF_APIENTRYP type_glUniform1f)(GLint location, GLfloat x);
3168 
3169  const QGLContext *context = QGLContext::currentContext();
3170  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3171 
3172  funcs->uniform1f = (type_glUniform1f)
3173  context->getProcAddress(QLatin1String("glUniform1f"));
3174  if (!funcs->uniform1f) {
3175  funcs->uniform1f = (type_glUniform1f)
3176  context->getProcAddress(QLatin1String("glUniform1fARB"));
3177  }
3178 
3179  if (funcs->uniform1f)
3180  funcs->uniform1f(location, x);
3181  else
3182  funcs->uniform1f = qglfResolveUniform1f;
3183 }
3184 
3185 static void qglfResolveUniform1fv(GLint location, GLsizei count, const GLfloat* v)
3186 {
3187  typedef void (QGLF_APIENTRYP type_glUniform1fv)(GLint location, GLsizei count, const GLfloat* v);
3188 
3189  const QGLContext *context = QGLContext::currentContext();
3190  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3191 
3192  funcs->uniform1fv = (type_glUniform1fv)
3193  context->getProcAddress(QLatin1String("glUniform1fv"));
3194  if (!funcs->uniform1fv) {
3195  funcs->uniform1fv = (type_glUniform1fv)
3196  context->getProcAddress(QLatin1String("glUniform1fvARB"));
3197  }
3198 
3199  if (funcs->uniform1fv)
3200  funcs->uniform1fv(location, count, v);
3201  else
3202  funcs->uniform1fv = qglfResolveUniform1fv;
3203 }
3204 
3206 {
3207  typedef void (QGLF_APIENTRYP type_glUniform1i)(GLint location, GLint x);
3208 
3209  const QGLContext *context = QGLContext::currentContext();
3210  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3211 
3212  funcs->uniform1i = (type_glUniform1i)
3213  context->getProcAddress(QLatin1String("glUniform1i"));
3214  if (!funcs->uniform1i) {
3215  funcs->uniform1i = (type_glUniform1i)
3216  context->getProcAddress(QLatin1String("glUniform1iARB"));
3217  }
3218 
3219  if (funcs->uniform1i)
3220  funcs->uniform1i(location, x);
3221  else
3222  funcs->uniform1i = qglfResolveUniform1i;
3223 }
3224 
3225 static void qglfResolveUniform1iv(GLint location, GLsizei count, const GLint* v)
3226 {
3227  typedef void (QGLF_APIENTRYP type_glUniform1iv)(GLint location, GLsizei count, const GLint* v);
3228 
3229  const QGLContext *context = QGLContext::currentContext();
3230  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3231 
3232  funcs->uniform1iv = (type_glUniform1iv)
3233  context->getProcAddress(QLatin1String("glUniform1iv"));
3234  if (!funcs->uniform1iv) {
3235  funcs->uniform1iv = (type_glUniform1iv)
3236  context->getProcAddress(QLatin1String("glUniform1ivARB"));
3237  }
3238 
3239  if (funcs->uniform1iv)
3240  funcs->uniform1iv(location, count, v);
3241  else
3242  funcs->uniform1iv = qglfResolveUniform1iv;
3243 }
3244 
3245 static void qglfResolveUniform2f(GLint location, GLfloat x, GLfloat y)
3246 {
3247  typedef void (QGLF_APIENTRYP type_glUniform2f)(GLint location, GLfloat x, GLfloat y);
3248 
3249  const QGLContext *context = QGLContext::currentContext();
3250  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3251 
3252  funcs->uniform2f = (type_glUniform2f)
3253  context->getProcAddress(QLatin1String("glUniform2f"));
3254  if (!funcs->uniform2f) {
3255  funcs->uniform2f = (type_glUniform2f)
3256  context->getProcAddress(QLatin1String("glUniform2fARB"));
3257  }
3258 
3259  if (funcs->uniform2f)
3260  funcs->uniform2f(location, x, y);
3261  else
3262  funcs->uniform2f = qglfResolveUniform2f;
3263 }
3264 
3265 static void qglfResolveUniform2fv(GLint location, GLsizei count, const GLfloat* v)
3266 {
3267  typedef void (QGLF_APIENTRYP type_glUniform2fv)(GLint location, GLsizei count, const GLfloat* v);
3268 
3269  const QGLContext *context = QGLContext::currentContext();
3270  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3271 
3272  funcs->uniform2fv = (type_glUniform2fv)
3273  context->getProcAddress(QLatin1String("glUniform2fv"));
3274  if (!funcs->uniform2fv) {
3275  funcs->uniform2fv = (type_glUniform2fv)
3276  context->getProcAddress(QLatin1String("glUniform2fvARB"));
3277  }
3278 
3279  if (funcs->uniform2fv)
3280  funcs->uniform2fv(location, count, v);
3281  else
3282  funcs->uniform2fv = qglfResolveUniform2fv;
3283 }
3284 
3286 {
3287  typedef void (QGLF_APIENTRYP type_glUniform2i)(GLint location, GLint x, GLint y);
3288 
3289  const QGLContext *context = QGLContext::currentContext();
3290  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3291 
3292  funcs->uniform2i = (type_glUniform2i)
3293  context->getProcAddress(QLatin1String("glUniform2i"));
3294  if (!funcs->uniform2i) {
3295  funcs->uniform2i = (type_glUniform2i)
3296  context->getProcAddress(QLatin1String("glUniform2iARB"));
3297  }
3298 
3299  if (funcs->uniform2i)
3300  funcs->uniform2i(location, x, y);
3301  else
3302  funcs->uniform2i = qglfResolveUniform2i;
3303 }
3304 
3305 static void qglfResolveUniform2iv(GLint location, GLsizei count, const GLint* v)
3306 {
3307  typedef void (QGLF_APIENTRYP type_glUniform2iv)(GLint location, GLsizei count, const GLint* v);
3308 
3309  const QGLContext *context = QGLContext::currentContext();
3310  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3311 
3312  funcs->uniform2iv = (type_glUniform2iv)
3313  context->getProcAddress(QLatin1String("glUniform2iv"));
3314  if (!funcs->uniform2iv) {
3315  funcs->uniform2iv = (type_glUniform2iv)
3316  context->getProcAddress(QLatin1String("glUniform2ivARB"));
3317  }
3318 
3319  if (funcs->uniform2iv)
3320  funcs->uniform2iv(location, count, v);
3321  else
3322  funcs->uniform2iv = qglfResolveUniform2iv;
3323 }
3324 
3325 static void qglfResolveUniform3f(GLint location, GLfloat x, GLfloat y, GLfloat z)
3326 {
3327  typedef void (QGLF_APIENTRYP type_glUniform3f)(GLint location, GLfloat x, GLfloat y, GLfloat z);
3328 
3329  const QGLContext *context = QGLContext::currentContext();
3330  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3331 
3332  funcs->uniform3f = (type_glUniform3f)
3333  context->getProcAddress(QLatin1String("glUniform3f"));
3334  if (!funcs->uniform3f) {
3335  funcs->uniform3f = (type_glUniform3f)
3336  context->getProcAddress(QLatin1String("glUniform3fARB"));
3337  }
3338 
3339  if (funcs->uniform3f)
3340  funcs->uniform3f(location, x, y, z);
3341  else
3342  funcs->uniform3f = qglfResolveUniform3f;
3343 }
3344 
3345 static void qglfResolveUniform3fv(GLint location, GLsizei count, const GLfloat* v)
3346 {
3347  typedef void (QGLF_APIENTRYP type_glUniform3fv)(GLint location, GLsizei count, const GLfloat* v);
3348 
3349  const QGLContext *context = QGLContext::currentContext();
3350  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3351 
3352  funcs->uniform3fv = (type_glUniform3fv)
3353  context->getProcAddress(QLatin1String("glUniform3fv"));
3354  if (!funcs->uniform3fv) {
3355  funcs->uniform3fv = (type_glUniform3fv)
3356  context->getProcAddress(QLatin1String("glUniform3fvARB"));
3357  }
3358 
3359  if (funcs->uniform3fv)
3360  funcs->uniform3fv(location, count, v);
3361  else
3362  funcs->uniform3fv = qglfResolveUniform3fv;
3363 }
3364 
3366 {
3367  typedef void (QGLF_APIENTRYP type_glUniform3i)(GLint location, GLint x, GLint y, GLint z);
3368 
3369  const QGLContext *context = QGLContext::currentContext();
3370  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3371 
3372  funcs->uniform3i = (type_glUniform3i)
3373  context->getProcAddress(QLatin1String("glUniform3i"));
3374  if (!funcs->uniform3i) {
3375  funcs->uniform3i = (type_glUniform3i)
3376  context->getProcAddress(QLatin1String("glUniform3iARB"));
3377  }
3378 
3379  if (funcs->uniform3i)
3380  funcs->uniform3i(location, x, y, z);
3381  else
3382  funcs->uniform3i = qglfResolveUniform3i;
3383 }
3384 
3385 static void qglfResolveUniform3iv(GLint location, GLsizei count, const GLint* v)
3386 {
3387  typedef void (QGLF_APIENTRYP type_glUniform3iv)(GLint location, GLsizei count, const GLint* v);
3388 
3389  const QGLContext *context = QGLContext::currentContext();
3390  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3391 
3392  funcs->uniform3iv = (type_glUniform3iv)
3393  context->getProcAddress(QLatin1String("glUniform3iv"));
3394  if (!funcs->uniform3iv) {
3395  funcs->uniform3iv = (type_glUniform3iv)
3396  context->getProcAddress(QLatin1String("glUniform3ivARB"));
3397  }
3398 
3399  if (funcs->uniform3iv)
3400  funcs->uniform3iv(location, count, v);
3401  else
3402  funcs->uniform3iv = qglfResolveUniform3iv;
3403 }
3404 
3405 static void qglfResolveUniform4f(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
3406 {
3407  typedef void (QGLF_APIENTRYP type_glUniform4f)(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
3408 
3409  const QGLContext *context = QGLContext::currentContext();
3410  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3411 
3412  funcs->uniform4f = (type_glUniform4f)
3413  context->getProcAddress(QLatin1String("glUniform4f"));
3414  if (!funcs->uniform4f) {
3415  funcs->uniform4f = (type_glUniform4f)
3416  context->getProcAddress(QLatin1String("glUniform4fARB"));
3417  }
3418 
3419  if (funcs->uniform4f)
3420  funcs->uniform4f(location, x, y, z, w);
3421  else
3422  funcs->uniform4f = qglfResolveUniform4f;
3423 }
3424 
3425 static void qglfResolveUniform4fv(GLint location, GLsizei count, const GLfloat* v)
3426 {
3427  typedef void (QGLF_APIENTRYP type_glUniform4fv)(GLint location, GLsizei count, const GLfloat* v);
3428 
3429  const QGLContext *context = QGLContext::currentContext();
3430  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3431 
3432  funcs->uniform4fv = (type_glUniform4fv)
3433  context->getProcAddress(QLatin1String("glUniform4fv"));
3434  if (!funcs->uniform4fv) {
3435  funcs->uniform4fv = (type_glUniform4fv)
3436  context->getProcAddress(QLatin1String("glUniform4fvARB"));
3437  }
3438 
3439  if (funcs->uniform4fv)
3440  funcs->uniform4fv(location, count, v);
3441  else
3442  funcs->uniform4fv = qglfResolveUniform4fv;
3443 }
3444 
3446 {
3447  typedef void (QGLF_APIENTRYP type_glUniform4i)(GLint location, GLint x, GLint y, GLint z, GLint w);
3448 
3449  const QGLContext *context = QGLContext::currentContext();
3450  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3451 
3452  funcs->uniform4i = (type_glUniform4i)
3453  context->getProcAddress(QLatin1String("glUniform4i"));
3454  if (!funcs->uniform4i) {
3455  funcs->uniform4i = (type_glUniform4i)
3456  context->getProcAddress(QLatin1String("glUniform4iARB"));
3457  }
3458 
3459  if (funcs->uniform4i)
3460  funcs->uniform4i(location, x, y, z, w);
3461  else
3462  funcs->uniform4i = qglfResolveUniform4i;
3463 }
3464 
3465 static void qglfResolveUniform4iv(GLint location, GLsizei count, const GLint* v)
3466 {
3467  typedef void (QGLF_APIENTRYP type_glUniform4iv)(GLint location, GLsizei count, const GLint* v);
3468 
3469  const QGLContext *context = QGLContext::currentContext();
3470  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3471 
3472  funcs->uniform4iv = (type_glUniform4iv)
3473  context->getProcAddress(QLatin1String("glUniform4iv"));
3474  if (!funcs->uniform4iv) {
3475  funcs->uniform4iv = (type_glUniform4iv)
3476  context->getProcAddress(QLatin1String("glUniform4ivARB"));
3477  }
3478 
3479  if (funcs->uniform4iv)
3480  funcs->uniform4iv(location, count, v);
3481  else
3482  funcs->uniform4iv = qglfResolveUniform4iv;
3483 }
3484 
3485 static void qglfResolveUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
3486 {
3487  typedef void (QGLF_APIENTRYP type_glUniformMatrix2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
3488 
3489  const QGLContext *context = QGLContext::currentContext();
3490  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3491 
3492  funcs->uniformMatrix2fv = (type_glUniformMatrix2fv)
3493  context->getProcAddress(QLatin1String("glUniformMatrix2fv"));
3494  if (!funcs->uniformMatrix2fv) {
3495  funcs->uniformMatrix2fv = (type_glUniformMatrix2fv)
3496  context->getProcAddress(QLatin1String("glUniformMatrix2fvARB"));
3497  }
3498 
3499  if (funcs->uniformMatrix2fv)
3500  funcs->uniformMatrix2fv(location, count, transpose, value);
3501  else
3502  funcs->uniformMatrix2fv = qglfResolveUniformMatrix2fv;
3503 }
3504 
3505 static void qglfResolveUniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
3506 {
3507  typedef void (QGLF_APIENTRYP type_glUniformMatrix3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
3508 
3509  const QGLContext *context = QGLContext::currentContext();
3510  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3511 
3512  funcs->uniformMatrix3fv = (type_glUniformMatrix3fv)
3513  context->getProcAddress(QLatin1String("glUniformMatrix3fv"));
3514  if (!funcs->uniformMatrix3fv) {
3515  funcs->uniformMatrix3fv = (type_glUniformMatrix3fv)
3516  context->getProcAddress(QLatin1String("glUniformMatrix3fvARB"));
3517  }
3518 
3519  if (funcs->uniformMatrix3fv)
3520  funcs->uniformMatrix3fv(location, count, transpose, value);
3521  else
3522  funcs->uniformMatrix3fv = qglfResolveUniformMatrix3fv;
3523 }
3524 
3525 static void qglfResolveUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
3526 {
3527  typedef void (QGLF_APIENTRYP type_glUniformMatrix4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
3528 
3529  const QGLContext *context = QGLContext::currentContext();
3530  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3531 
3532  funcs->uniformMatrix4fv = (type_glUniformMatrix4fv)
3533  context->getProcAddress(QLatin1String("glUniformMatrix4fv"));
3534  if (!funcs->uniformMatrix4fv) {
3535  funcs->uniformMatrix4fv = (type_glUniformMatrix4fv)
3536  context->getProcAddress(QLatin1String("glUniformMatrix4fvARB"));
3537  }
3538 
3539  if (funcs->uniformMatrix4fv)
3540  funcs->uniformMatrix4fv(location, count, transpose, value);
3541  else
3542  funcs->uniformMatrix4fv = qglfResolveUniformMatrix4fv;
3543 }
3544 
3545 static void qglfResolveUseProgram(GLuint program)
3546 {
3547  typedef void (QGLF_APIENTRYP type_glUseProgram)(GLuint program);
3548 
3549  const QGLContext *context = QGLContext::currentContext();
3550  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3551 
3552  funcs->useProgram = (type_glUseProgram)
3553  context->getProcAddress(QLatin1String("glUseProgram"));
3554  if (!funcs->useProgram) {
3555  funcs->useProgram = (type_glUseProgram)
3556  context->getProcAddress(QLatin1String("glUseProgramObjectARB"));
3557  }
3558 
3559  if (funcs->useProgram)
3560  funcs->useProgram(program);
3561  else
3562  funcs->useProgram = qglfResolveUseProgram;
3563 }
3564 
3565 static void qglfResolveValidateProgram(GLuint program)
3566 {
3567  typedef void (QGLF_APIENTRYP type_glValidateProgram)(GLuint program);
3568 
3569  const QGLContext *context = QGLContext::currentContext();
3570  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3571 
3572  funcs->validateProgram = (type_glValidateProgram)
3573  context->getProcAddress(QLatin1String("glValidateProgram"));
3574  if (!funcs->validateProgram) {
3575  funcs->validateProgram = (type_glValidateProgram)
3576  context->getProcAddress(QLatin1String("glValidateProgramARB"));
3577  }
3578 
3579  if (funcs->validateProgram)
3580  funcs->validateProgram(program);
3581  else
3582  funcs->validateProgram = qglfResolveValidateProgram;
3583 }
3584 
3585 static void qglfResolveVertexAttrib1f(GLuint indx, GLfloat x)
3586 {
3587  typedef void (QGLF_APIENTRYP type_glVertexAttrib1f)(GLuint indx, GLfloat x);
3588 
3589  const QGLContext *context = QGLContext::currentContext();
3590  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3591 
3592  funcs->vertexAttrib1f = (type_glVertexAttrib1f)
3593  context->getProcAddress(QLatin1String("glVertexAttrib1f"));
3594  if (!funcs->vertexAttrib1f) {
3595  funcs->vertexAttrib1f = (type_glVertexAttrib1f)
3596  context->getProcAddress(QLatin1String("glVertexAttrib1fARB"));
3597  }
3598 
3599  if (funcs->vertexAttrib1f)
3600  funcs->vertexAttrib1f(indx, x);
3601  else
3602  funcs->vertexAttrib1f = qglfResolveVertexAttrib1f;
3603 }
3604 
3605 static void qglfResolveVertexAttrib1fv(GLuint indx, const GLfloat* values)
3606 {
3607  typedef void (QGLF_APIENTRYP type_glVertexAttrib1fv)(GLuint indx, const GLfloat* values);
3608 
3609  const QGLContext *context = QGLContext::currentContext();
3610  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3611 
3612  funcs->vertexAttrib1fv = (type_glVertexAttrib1fv)
3613  context->getProcAddress(QLatin1String("glVertexAttrib1fv"));
3614  if (!funcs->vertexAttrib1fv) {
3615  funcs->vertexAttrib1fv = (type_glVertexAttrib1fv)
3616  context->getProcAddress(QLatin1String("glVertexAttrib1fvARB"));
3617  }
3618 
3619  if (funcs->vertexAttrib1fv)
3620  funcs->vertexAttrib1fv(indx, values);
3621  else
3622  funcs->vertexAttrib1fv = qglfResolveVertexAttrib1fv;
3623 }
3624 
3625 static void qglfResolveVertexAttrib2f(GLuint indx, GLfloat x, GLfloat y)
3626 {
3627  typedef void (QGLF_APIENTRYP type_glVertexAttrib2f)(GLuint indx, GLfloat x, GLfloat y);
3628 
3629  const QGLContext *context = QGLContext::currentContext();
3630  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3631 
3632  funcs->vertexAttrib2f = (type_glVertexAttrib2f)
3633  context->getProcAddress(QLatin1String("glVertexAttrib2f"));
3634  if (!funcs->vertexAttrib2f) {
3635  funcs->vertexAttrib2f = (type_glVertexAttrib2f)
3636  context->getProcAddress(QLatin1String("glVertexAttrib2fARB"));
3637  }
3638 
3639  if (funcs->vertexAttrib2f)
3640  funcs->vertexAttrib2f(indx, x, y);
3641  else
3642  funcs->vertexAttrib2f = qglfResolveVertexAttrib2f;
3643 }
3644 
3645 static void qglfResolveVertexAttrib2fv(GLuint indx, const GLfloat* values)
3646 {
3647  typedef void (QGLF_APIENTRYP type_glVertexAttrib2fv)(GLuint indx, const GLfloat* values);
3648 
3649  const QGLContext *context = QGLContext::currentContext();
3650  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3651 
3652  funcs->vertexAttrib2fv = (type_glVertexAttrib2fv)
3653  context->getProcAddress(QLatin1String("glVertexAttrib2fv"));
3654  if (!funcs->vertexAttrib2fv) {
3655  funcs->vertexAttrib2fv = (type_glVertexAttrib2fv)
3656  context->getProcAddress(QLatin1String("glVertexAttrib2fvARB"));
3657  }
3658 
3659  if (funcs->vertexAttrib2fv)
3660  funcs->vertexAttrib2fv(indx, values);
3661  else
3662  funcs->vertexAttrib2fv = qglfResolveVertexAttrib2fv;
3663 }
3664 
3665 static void qglfResolveVertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z)
3666 {
3667  typedef void (QGLF_APIENTRYP type_glVertexAttrib3f)(GLuint indx, GLfloat x, GLfloat y, GLfloat z);
3668 
3669  const QGLContext *context = QGLContext::currentContext();
3670  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3671 
3672  funcs->vertexAttrib3f = (type_glVertexAttrib3f)
3673  context->getProcAddress(QLatin1String("glVertexAttrib3f"));
3674  if (!funcs->vertexAttrib3f) {
3675  funcs->vertexAttrib3f = (type_glVertexAttrib3f)
3676  context->getProcAddress(QLatin1String("glVertexAttrib3fARB"));
3677  }
3678 
3679  if (funcs->vertexAttrib3f)
3680  funcs->vertexAttrib3f(indx, x, y, z);
3681  else
3682  funcs->vertexAttrib3f = qglfResolveVertexAttrib3f;
3683 }
3684 
3685 static void qglfResolveVertexAttrib3fv(GLuint indx, const GLfloat* values)
3686 {
3687  typedef void (QGLF_APIENTRYP type_glVertexAttrib3fv)(GLuint indx, const GLfloat* values);
3688 
3689  const QGLContext *context = QGLContext::currentContext();
3690  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3691 
3692  funcs->vertexAttrib3fv = (type_glVertexAttrib3fv)
3693  context->getProcAddress(QLatin1String("glVertexAttrib3fv"));
3694  if (!funcs->vertexAttrib3fv) {
3695  funcs->vertexAttrib3fv = (type_glVertexAttrib3fv)
3696  context->getProcAddress(QLatin1String("glVertexAttrib3fvARB"));
3697  }
3698 
3699  if (funcs->vertexAttrib3fv)
3700  funcs->vertexAttrib3fv(indx, values);
3701  else
3702  funcs->vertexAttrib3fv = qglfResolveVertexAttrib3fv;
3703 }
3704 
3705 static void qglfResolveVertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
3706 {
3707  typedef void (QGLF_APIENTRYP type_glVertexAttrib4f)(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
3708 
3709  const QGLContext *context = QGLContext::currentContext();
3710  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3711 
3712  funcs->vertexAttrib4f = (type_glVertexAttrib4f)
3713  context->getProcAddress(QLatin1String("glVertexAttrib4f"));
3714  if (!funcs->vertexAttrib4f) {
3715  funcs->vertexAttrib4f = (type_glVertexAttrib4f)
3716  context->getProcAddress(QLatin1String("glVertexAttrib4fARB"));
3717  }
3718 
3719  if (funcs->vertexAttrib4f)
3720  funcs->vertexAttrib4f(indx, x, y, z, w);
3721  else
3722  funcs->vertexAttrib4f = qglfResolveVertexAttrib4f;
3723 }
3724 
3725 static void qglfResolveVertexAttrib4fv(GLuint indx, const GLfloat* values)
3726 {
3727  typedef void (QGLF_APIENTRYP type_glVertexAttrib4fv)(GLuint indx, const GLfloat* values);
3728 
3729  const QGLContext *context = QGLContext::currentContext();
3730  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3731 
3732  funcs->vertexAttrib4fv = (type_glVertexAttrib4fv)
3733  context->getProcAddress(QLatin1String("glVertexAttrib4fv"));
3734  if (!funcs->vertexAttrib4fv) {
3735  funcs->vertexAttrib4fv = (type_glVertexAttrib4fv)
3736  context->getProcAddress(QLatin1String("glVertexAttrib4fvARB"));
3737  }
3738 
3739  if (funcs->vertexAttrib4fv)
3740  funcs->vertexAttrib4fv(indx, values);
3741  else
3742  funcs->vertexAttrib4fv = qglfResolveVertexAttrib4fv;
3743 }
3744 
3745 static void qglfResolveVertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr)
3746 {
3747  typedef void (QGLF_APIENTRYP type_glVertexAttribPointer)(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr);
3748 
3749  const QGLContext *context = QGLContext::currentContext();
3750  QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3751 
3752  funcs->vertexAttribPointer = (type_glVertexAttribPointer)
3753  context->getProcAddress(QLatin1String("glVertexAttribPointer"));
3754  if (!funcs->vertexAttribPointer) {
3755  funcs->vertexAttribPointer = (type_glVertexAttribPointer)
3756  context->getProcAddress(QLatin1String("glVertexAttribPointerARB"));
3757  }
3758 
3759  if (funcs->vertexAttribPointer)
3760  funcs->vertexAttribPointer(indx, size, type, normalized, stride, ptr);
3761  else
3762  funcs->vertexAttribPointer = qglfResolveVertexAttribPointer;
3763 }
3764 
3765 #endif // !QT_OPENGL_ES_2
3766 
3768 {
3769 #ifndef QT_OPENGL_ES_2
3770  activeTexture = qglfResolveActiveTexture;
3771  attachShader = qglfResolveAttachShader;
3772  bindAttribLocation = qglfResolveBindAttribLocation;
3773  bindBuffer = qglfResolveBindBuffer;
3774  bindFramebuffer = qglfResolveBindFramebuffer;
3775  bindRenderbuffer = qglfResolveBindRenderbuffer;
3777  blendEquation = qglfResolveBlendEquation;
3778  blendEquationSeparate = qglfResolveBlendEquationSeparate;
3779  blendFuncSeparate = qglfResolveBlendFuncSeparate;
3780  bufferData = qglfResolveBufferData;
3781  bufferSubData = qglfResolveBufferSubData;
3782  checkFramebufferStatus = qglfResolveCheckFramebufferStatus;
3783  compileShader = qglfResolveCompileShader;
3784  compressedTexImage2D = qglfResolveCompressedTexImage2D;
3785  compressedTexSubImage2D = qglfResolveCompressedTexSubImage2D;
3786  createProgram = qglfResolveCreateProgram;
3787  createShader = qglfResolveCreateShader;
3788  deleteBuffers = qglfResolveDeleteBuffers;
3789  deleteFramebuffers = qglfResolveDeleteFramebuffers;
3790  deleteProgram = qglfResolveDeleteProgram;
3791  deleteRenderbuffers = qglfResolveDeleteRenderbuffers;
3792  deleteShader = qglfResolveDeleteShader;
3793  detachShader = qglfResolveDetachShader;
3794  disableVertexAttribArray = qglfResolveDisableVertexAttribArray;
3795  enableVertexAttribArray = qglfResolveEnableVertexAttribArray;
3796  framebufferRenderbuffer = qglfResolveFramebufferRenderbuffer;
3797  framebufferTexture2D = qglfResolveFramebufferTexture2D;
3798  genBuffers = qglfResolveGenBuffers;
3799  generateMipmap = qglfResolveGenerateMipmap;
3800  genFramebuffers = qglfResolveGenFramebuffers;
3801  genRenderbuffers = qglfResolveGenRenderbuffers;
3802  getActiveAttrib = qglfResolveGetActiveAttrib;
3803  getActiveUniform = qglfResolveGetActiveUniform;
3804  getAttachedShaders = qglfResolveGetAttachedShaders;
3805  getAttribLocation = qglfResolveGetAttribLocation;
3806  getBufferParameteriv = qglfResolveGetBufferParameteriv;
3807  getFramebufferAttachmentParameteriv = qglfResolveGetFramebufferAttachmentParameteriv;
3808  getProgramiv = qglfResolveGetProgramiv;
3809  getProgramInfoLog = qglfResolveGetProgramInfoLog;
3810  getRenderbufferParameteriv = qglfResolveGetRenderbufferParameteriv;
3811  getShaderiv = qglfResolveGetShaderiv;
3812  getShaderInfoLog = qglfResolveGetShaderInfoLog;
3813  getShaderPrecisionFormat = qglfResolveGetShaderPrecisionFormat;
3814  getShaderSource = qglfResolveGetShaderSource;
3815  getUniformfv = qglfResolveGetUniformfv;
3816  getUniformiv = qglfResolveGetUniformiv;
3817  getUniformLocation = qglfResolveGetUniformLocation;
3818  getVertexAttribfv = qglfResolveGetVertexAttribfv;
3819  getVertexAttribiv = qglfResolveGetVertexAttribiv;
3820  getVertexAttribPointerv = qglfResolveGetVertexAttribPointerv;
3821  isBuffer = qglfResolveIsBuffer;
3822  isFramebuffer = qglfResolveIsFramebuffer;
3823  isProgram = qglfResolveIsProgram;
3824  isRenderbuffer = qglfResolveIsRenderbuffer;
3825  isShader = qglfResolveIsShader;
3826  linkProgram = qglfResolveLinkProgram;
3827  releaseShaderCompiler = qglfResolveReleaseShaderCompiler;
3828  renderbufferStorage = qglfResolveRenderbufferStorage;
3829  sampleCoverage = qglfResolveSampleCoverage;
3830  shaderBinary = qglfResolveShaderBinary;
3831  shaderSource = qglfResolveShaderSource;
3832  stencilFuncSeparate = qglfResolveStencilFuncSeparate;
3833  stencilMaskSeparate = qglfResolveStencilMaskSeparate;
3834  stencilOpSeparate = qglfResolveStencilOpSeparate;
3835  uniform1f = qglfResolveUniform1f;
3836  uniform1fv = qglfResolveUniform1fv;
3837  uniform1i = qglfResolveUniform1i;
3838  uniform1iv = qglfResolveUniform1iv;
3839  uniform2f = qglfResolveUniform2f;
3840  uniform2fv = qglfResolveUniform2fv;
3841  uniform2i = qglfResolveUniform2i;
3842  uniform2iv = qglfResolveUniform2iv;
3843  uniform3f = qglfResolveUniform3f;
3844  uniform3fv = qglfResolveUniform3fv;
3845  uniform3i = qglfResolveUniform3i;
3846  uniform3iv = qglfResolveUniform3iv;
3847  uniform4f = qglfResolveUniform4f;
3848  uniform4fv = qglfResolveUniform4fv;
3849  uniform4i = qglfResolveUniform4i;
3850  uniform4iv = qglfResolveUniform4iv;
3851  uniformMatrix2fv = qglfResolveUniformMatrix2fv;
3852  uniformMatrix3fv = qglfResolveUniformMatrix3fv;
3853  uniformMatrix4fv = qglfResolveUniformMatrix4fv;
3854  useProgram = qglfResolveUseProgram;
3855  validateProgram = qglfResolveValidateProgram;
3856  vertexAttrib1f = qglfResolveVertexAttrib1f;
3857  vertexAttrib1fv = qglfResolveVertexAttrib1fv;
3858  vertexAttrib2f = qglfResolveVertexAttrib2f;
3859  vertexAttrib2fv = qglfResolveVertexAttrib2fv;
3860  vertexAttrib3f = qglfResolveVertexAttrib3f;
3861  vertexAttrib3fv = qglfResolveVertexAttrib3fv;
3862  vertexAttrib4f = qglfResolveVertexAttrib4f;
3863  vertexAttrib4fv = qglfResolveVertexAttrib4fv;
3864  vertexAttribPointer = qglfResolveVertexAttribPointer;
3865 #endif // !QT_OPENGL_ES_2
3866 }
3867 
double d
Definition: qnumeric_p.h:62
static GLuint qglfResolveCreateShader(GLenum type)
QGLFunctionsPrivate * d_ptr
Definition: qglfunctions.h:307
static void qglfResolveGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint *params)
int type
Definition: qmetatype.cpp:239
QGLFunctions::OpenGLFeatures openGLFeatures() const
Returns the set of features that are present on this system&#39;s OpenGL implementation.
static void qglfResolveFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
static OpenGLVersionFlags openGLVersionFlags()
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
static void qglfResolveBindRenderbuffer(GLenum target, GLuint renderbuffer)
static void qglfResolveVertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z)
static void usage()
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)
ptrdiff_t qgl_GLintptr
Definition: qglfunctions.h:59
#define QGLF_APIENTRYP
Definition: qglfunctions.h:73
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.
Definition: qglfunctions.h:185
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)
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
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()
Definition: qegl.cpp:785
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.
Definition: qgl.cpp:3545
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&#39;s OpenGL implementation; false otherwise.
static void qglfResolveDisableVertexAttribArray(GLuint index)
ptrdiff_t qgl_GLsizeiptr
Definition: qglfunctions.h:60
static void qglfResolveGenBuffers(GLsizei n, GLuint *buffers)
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
The QGLContext class encapsulates an OpenGL rendering context.
Definition: qgl.h:310
static void qglfResolveUniform3iv(GLint location, GLsizei count, const GLint *v)
static void qglfSpecialGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision)
const char * name
#define Q_GLOBAL_STATIC(TYPE, NAME)
Declares a global static variable with the given type and name.
Definition: qglobal.h:1968
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...
Definition: qstring.h:654
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)
quint16 values[128]
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)
unsigned int GLenum
Definition: main.cpp:50
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
Definition: qtestresult.cpp:63
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
Definition: qgl_p.h:906
static void qglfResolveBindAttribLocation(GLuint program, GLuint index, const char *name)
static GLboolean qglfResolveIsShader(GLuint shader)
quint16 index
int GLsizei
Definition: main.cpp:49
typedef GLint
Definition: glfunctions.h:67
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...
Definition: qglobal.h:1729
typedef GLboolean
Definition: glfunctions.h:67
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.
Definition: qglobal.h:1982
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
Definition: qglfunctions.h:328
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)