[2] | 1 | /****************************************************************************
|
---|
| 2 | **
|
---|
[846] | 3 | ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
---|
[561] | 4 | ** All rights reserved.
|
---|
| 5 | ** Contact: Nokia Corporation (qt-info@nokia.com)
|
---|
[2] | 6 | **
|
---|
| 7 | ** This file is part of the QtOpenGL module of the Qt Toolkit.
|
---|
| 8 | **
|
---|
| 9 | ** $QT_BEGIN_LICENSE:LGPL$
|
---|
| 10 | ** Commercial Usage
|
---|
| 11 | ** Licensees holding valid Qt Commercial licenses may use this file in
|
---|
| 12 | ** accordance with the Qt Commercial License Agreement provided with the
|
---|
| 13 | ** Software or, alternatively, in accordance with the terms contained in
|
---|
| 14 | ** a written agreement between you and Nokia.
|
---|
| 15 | **
|
---|
| 16 | ** GNU Lesser General Public License Usage
|
---|
| 17 | ** Alternatively, this file may be used under the terms of the GNU Lesser
|
---|
| 18 | ** General Public License version 2.1 as published by the Free Software
|
---|
| 19 | ** Foundation and appearing in the file LICENSE.LGPL included in the
|
---|
| 20 | ** packaging of this file. Please review the following information to
|
---|
| 21 | ** ensure the GNU Lesser General Public License version 2.1 requirements
|
---|
| 22 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
---|
| 23 | **
|
---|
[561] | 24 | ** In addition, as a special exception, Nokia gives you certain additional
|
---|
| 25 | ** rights. These rights are described in the Nokia Qt LGPL Exception
|
---|
| 26 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
---|
[2] | 27 | **
|
---|
| 28 | ** GNU General Public License Usage
|
---|
| 29 | ** Alternatively, this file may be used under the terms of the GNU
|
---|
| 30 | ** General Public License version 3.0 as published by the Free Software
|
---|
| 31 | ** Foundation and appearing in the file LICENSE.GPL included in the
|
---|
| 32 | ** packaging of this file. Please review the following information to
|
---|
| 33 | ** ensure the GNU General Public License version 3.0 requirements will be
|
---|
| 34 | ** met: http://www.gnu.org/copyleft/gpl.html.
|
---|
| 35 | **
|
---|
[561] | 36 | ** If you have questions regarding the use of this file, please contact
|
---|
| 37 | ** Nokia at qt-info@nokia.com.
|
---|
[2] | 38 | ** $QT_END_LICENSE$
|
---|
| 39 | **
|
---|
| 40 | ****************************************************************************/
|
---|
| 41 |
|
---|
| 42 | #ifndef QGL_EXTENSIONS_P_H
|
---|
| 43 | #define QGL_EXTENSIONS_P_H
|
---|
| 44 |
|
---|
| 45 | //
|
---|
| 46 | // W A R N I N G
|
---|
| 47 | // -------------
|
---|
| 48 | //
|
---|
| 49 | // This file is not part of the Qt API. It exists for the convenience
|
---|
| 50 | // of the Qt OpenGL classes. This header file may change from
|
---|
| 51 | // version to version without notice, or even be removed.
|
---|
| 52 | //
|
---|
| 53 | // We mean it.
|
---|
| 54 | //
|
---|
| 55 |
|
---|
| 56 | // extension prototypes
|
---|
| 57 | #ifndef Q_WS_MAC
|
---|
| 58 | # ifndef APIENTRYP
|
---|
| 59 | # ifdef APIENTRY
|
---|
| 60 | # define APIENTRYP APIENTRY *
|
---|
| 61 | # else
|
---|
| 62 | # define APIENTRY
|
---|
| 63 | # define APIENTRYP *
|
---|
| 64 | # endif
|
---|
| 65 | # endif
|
---|
| 66 | #else
|
---|
| 67 | # define APIENTRY
|
---|
| 68 | # define APIENTRYP *
|
---|
| 69 | #endif
|
---|
| 70 |
|
---|
[846] | 71 | #ifndef QT_NO_EGL
|
---|
| 72 | // Needed for EGLImageKHR definition:
|
---|
| 73 | #include <QtGui/private/qegl_p.h>
|
---|
| 74 | #endif
|
---|
| 75 |
|
---|
[2] | 76 | #include <QtCore/qglobal.h>
|
---|
| 77 |
|
---|
| 78 | #ifndef GL_ARB_vertex_buffer_object
|
---|
[846] | 79 | typedef ptrdiff_t GLintptrARB;
|
---|
[2] | 80 | typedef ptrdiff_t GLsizeiptrARB;
|
---|
| 81 | #endif
|
---|
| 82 |
|
---|
[561] | 83 | #ifndef GL_VERSION_2_0
|
---|
| 84 | typedef char GLchar;
|
---|
| 85 | #endif
|
---|
| 86 |
|
---|
[846] | 87 | // ARB_vertex_buffer_object
|
---|
[561] | 88 | typedef void (APIENTRY *_glBindBuffer) (GLenum, GLuint);
|
---|
| 89 | typedef void (APIENTRY *_glDeleteBuffers) (GLsizei, const GLuint *);
|
---|
| 90 | typedef void (APIENTRY *_glGenBuffers) (GLsizei, GLuint *);
|
---|
| 91 | typedef void (APIENTRY *_glBufferData) (GLenum, GLsizeiptrARB, const GLvoid *, GLenum);
|
---|
[846] | 92 | typedef void (APIENTRY *_glBufferSubData) (GLenum, GLintptrARB, GLsizeiptrARB, const GLvoid *);
|
---|
| 93 | typedef void (APIENTRY *_glGetBufferSubData) (GLenum, GLintptrARB, GLsizeiptrARB, GLvoid *);
|
---|
| 94 | typedef void (APIENTRY *_glGetBufferParameteriv) (GLenum, GLenum, GLint *);
|
---|
[2] | 95 | typedef GLvoid* (APIENTRY *_glMapBufferARB) (GLenum, GLenum);
|
---|
| 96 | typedef GLboolean (APIENTRY *_glUnmapBufferARB) (GLenum);
|
---|
[846] | 97 | // We can call the buffer functions directly in OpenGL/ES 1.1 or higher,
|
---|
| 98 | // but all other platforms need to resolve the extensions.
|
---|
| 99 | #if defined(QT_OPENGL_ES)
|
---|
| 100 | #if defined(GL_OES_VERSION_1_0) && !defined(GL_OES_VERSION_1_1)
|
---|
| 101 | #define QGL_RESOLVE_BUFFER_FUNCS 1
|
---|
| 102 | #endif
|
---|
| 103 | #else
|
---|
| 104 | #define QGL_RESOLVE_BUFFER_FUNCS 1
|
---|
| 105 | #endif
|
---|
[2] | 106 |
|
---|
| 107 | // ARB_fragment_program
|
---|
| 108 | typedef void (APIENTRY *_glProgramStringARB) (GLenum, GLenum, GLsizei, const GLvoid *);
|
---|
| 109 | typedef void (APIENTRY *_glBindProgramARB) (GLenum, GLuint);
|
---|
| 110 | typedef void (APIENTRY *_glDeleteProgramsARB) (GLsizei, const GLuint *);
|
---|
| 111 | typedef void (APIENTRY *_glGenProgramsARB) (GLsizei, GLuint *);
|
---|
| 112 | typedef void (APIENTRY *_glProgramLocalParameter4fvARB) (GLenum, GLuint, const GLfloat *);
|
---|
| 113 |
|
---|
| 114 | // GLSL
|
---|
| 115 | typedef GLuint (APIENTRY *_glCreateShader) (GLenum);
|
---|
| 116 | typedef void (APIENTRY *_glShaderSource) (GLuint, GLsizei, const char **, const GLint *);
|
---|
[561] | 117 | typedef void (APIENTRY *_glShaderBinary) (GLint, const GLuint*, GLenum, const void*, GLint);
|
---|
[2] | 118 | typedef void (APIENTRY *_glCompileShader) (GLuint);
|
---|
| 119 | typedef void (APIENTRY *_glDeleteShader) (GLuint);
|
---|
[561] | 120 | typedef GLboolean (APIENTRY *_glIsShader) (GLuint);
|
---|
[2] | 121 |
|
---|
| 122 | typedef GLuint (APIENTRY *_glCreateProgram) ();
|
---|
| 123 | typedef void (APIENTRY *_glAttachShader) (GLuint, GLuint);
|
---|
| 124 | typedef void (APIENTRY *_glDetachShader) (GLuint, GLuint);
|
---|
| 125 | typedef void (APIENTRY *_glLinkProgram) (GLuint);
|
---|
| 126 | typedef void (APIENTRY *_glUseProgram) (GLuint);
|
---|
| 127 | typedef void (APIENTRY *_glDeleteProgram) (GLuint);
|
---|
[561] | 128 | typedef GLboolean (APIENTRY *_glIsProgram) (GLuint);
|
---|
[2] | 129 |
|
---|
| 130 | typedef void (APIENTRY *_glGetShaderInfoLog) (GLuint, GLsizei, GLsizei *, char *);
|
---|
| 131 | typedef void (APIENTRY *_glGetShaderiv) (GLuint, GLenum, GLint *);
|
---|
[561] | 132 | typedef void (APIENTRY *_glGetShaderSource) (GLuint, GLsizei, GLsizei *, char *);
|
---|
[2] | 133 | typedef void (APIENTRY *_glGetProgramiv) (GLuint, GLenum, GLint *);
|
---|
[561] | 134 | typedef void (APIENTRY *_glGetProgramInfoLog) (GLuint, GLsizei, GLsizei *, char *);
|
---|
[2] | 135 |
|
---|
| 136 | typedef GLuint (APIENTRY *_glGetUniformLocation) (GLuint, const char*);
|
---|
[561] | 137 | typedef void (APIENTRY *_glUniform4fv) (GLint, GLsizei, const GLfloat *);
|
---|
| 138 | typedef void (APIENTRY *_glUniform3fv) (GLint, GLsizei, const GLfloat *);
|
---|
| 139 | typedef void (APIENTRY *_glUniform2fv) (GLint, GLsizei, const GLfloat *);
|
---|
| 140 | typedef void (APIENTRY *_glUniform1fv) (GLint, GLsizei, const GLfloat *);
|
---|
[2] | 141 | typedef void (APIENTRY *_glUniform1i) (GLint, GLint);
|
---|
[561] | 142 | typedef void (APIENTRY *_glUniform1iv) (GLint, GLsizei, const GLint *);
|
---|
| 143 | typedef void (APIENTRY *_glUniformMatrix2fv) (GLint, GLsizei, GLboolean, const GLfloat *);
|
---|
| 144 | typedef void (APIENTRY *_glUniformMatrix3fv) (GLint, GLsizei, GLboolean, const GLfloat *);
|
---|
| 145 | typedef void (APIENTRY *_glUniformMatrix4fv) (GLint, GLsizei, GLboolean, const GLfloat *);
|
---|
| 146 | typedef void (APIENTRY *_glUniformMatrix2x3fv) (GLint, GLsizei, GLboolean, const GLfloat *);
|
---|
| 147 | typedef void (APIENTRY *_glUniformMatrix2x4fv) (GLint, GLsizei, GLboolean, const GLfloat *);
|
---|
| 148 | typedef void (APIENTRY *_glUniformMatrix3x2fv) (GLint, GLsizei, GLboolean, const GLfloat *);
|
---|
| 149 | typedef void (APIENTRY *_glUniformMatrix3x4fv) (GLint, GLsizei, GLboolean, const GLfloat *);
|
---|
| 150 | typedef void (APIENTRY *_glUniformMatrix4x2fv) (GLint, GLsizei, GLboolean, const GLfloat *);
|
---|
| 151 | typedef void (APIENTRY *_glUniformMatrix4x3fv) (GLint, GLsizei, GLboolean, const GLfloat *);
|
---|
[2] | 152 |
|
---|
[561] | 153 | typedef void (APIENTRY *_glBindAttribLocation) (GLuint, GLuint, const char *);
|
---|
| 154 | typedef GLint (APIENTRY *_glGetAttribLocation) (GLuint, const char *);
|
---|
| 155 | typedef void (APIENTRY *_glVertexAttrib1fv) (GLuint, const GLfloat *);
|
---|
| 156 | typedef void (APIENTRY *_glVertexAttrib2fv) (GLuint, const GLfloat *);
|
---|
| 157 | typedef void (APIENTRY *_glVertexAttrib3fv) (GLuint, const GLfloat *);
|
---|
| 158 | typedef void (APIENTRY *_glVertexAttrib4fv) (GLuint, const GLfloat *);
|
---|
| 159 | typedef void (APIENTRY *_glVertexAttribPointer) (GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *);
|
---|
| 160 | typedef void (APIENTRY *_glDisableVertexAttribArray) (GLuint);
|
---|
| 161 | typedef void (APIENTRY *_glEnableVertexAttribArray) (GLuint);
|
---|
| 162 |
|
---|
| 163 | typedef void (APIENTRY *_glGetProgramBinaryOES) (GLuint, GLsizei, GLsizei *, GLenum *, void *);
|
---|
| 164 | typedef void (APIENTRY *_glProgramBinaryOES) (GLuint, GLenum, const void *, GLint);
|
---|
| 165 |
|
---|
| 166 |
|
---|
| 167 | typedef void (APIENTRY *_glMultiTexCoord4f) (GLenum, GLfloat, GLfloat, GLfloat, GLfloat);
|
---|
[2] | 168 | typedef void (APIENTRY *_glActiveStencilFaceEXT) (GLenum );
|
---|
| 169 |
|
---|
[561] | 170 | // Needed for GL2 engine:
|
---|
| 171 | typedef void (APIENTRY *_glStencilOpSeparate) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
|
---|
[2] | 172 | typedef void (APIENTRY *_glActiveTexture) (GLenum);
|
---|
[561] | 173 | typedef void (APIENTRY *_glBlendColor) (GLclampf, GLclampf, GLclampf, GLclampf);
|
---|
[2] | 174 |
|
---|
[561] | 175 |
|
---|
[2] | 176 | // EXT_GL_framebuffer_object
|
---|
[561] | 177 | typedef GLboolean (APIENTRY *_glIsRenderbuffer) (GLuint renderbuffer);
|
---|
| 178 | typedef void (APIENTRY *_glBindRenderbuffer) (GLenum target, GLuint renderbuffer);
|
---|
| 179 | typedef void (APIENTRY *_glDeleteRenderbuffers) (GLsizei n, const GLuint *renderbuffers);
|
---|
| 180 | typedef void (APIENTRY *_glGenRenderbuffers) (GLsizei n, GLuint *renderbuffers);
|
---|
| 181 | typedef void (APIENTRY *_glRenderbufferStorage) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
|
---|
| 182 | typedef void (APIENTRY *_glGetRenderbufferParameteriv) (GLenum target, GLenum pname, GLint *params);
|
---|
| 183 | typedef GLboolean (APIENTRY *_glIsFramebuffer) (GLuint framebuffer);
|
---|
| 184 | typedef void (APIENTRY *_glBindFramebuffer) (GLenum target, GLuint framebuffer);
|
---|
| 185 | typedef void (APIENTRY *_glDeleteFramebuffers) (GLsizei n, const GLuint *framebuffers);
|
---|
| 186 | typedef void (APIENTRY *_glGenFramebuffers) (GLsizei n, GLuint *framebuffers);
|
---|
| 187 | typedef GLenum (APIENTRY *_glCheckFramebufferStatus) (GLenum target);
|
---|
| 188 | typedef void (APIENTRY *_glFramebufferTexture2D) (GLenum target, GLenum attachment, GLenum textarget,
|
---|
[2] | 189 | GLuint texture, GLint level);
|
---|
[561] | 190 | typedef void (APIENTRY *_glFramebufferRenderbuffer) (GLenum target, GLenum attachment, GLenum renderbuffertarget,
|
---|
[2] | 191 | GLuint renderbuffer);
|
---|
[561] | 192 | typedef void (APIENTRY *_glGetFramebufferAttachmentParameteriv) (GLenum target, GLenum attachment, GLenum pname,
|
---|
[2] | 193 | GLint *params);
|
---|
[561] | 194 | typedef void (APIENTRY *_glGenerateMipmap) (GLenum target);
|
---|
[2] | 195 |
|
---|
[561] | 196 | // EXT_GL_framebuffer_blit
|
---|
| 197 | typedef void (APIENTRY *_glBlitFramebufferEXT) (int srcX0, int srcY0, int srcX1, int srcY1,
|
---|
| 198 | int dstX0, int dstY0, int dstX1, int dstY1,
|
---|
| 199 | GLbitfield mask, GLenum filter);
|
---|
| 200 |
|
---|
| 201 | // EXT_GL_framebuffer_multisample
|
---|
| 202 | typedef void (APIENTRY *_glRenderbufferStorageMultisampleEXT) (GLenum target, GLsizei samples,
|
---|
| 203 | GLenum internalformat, GLsizei width, GLsizei height);
|
---|
| 204 |
|
---|
[846] | 205 | // GL_EXT_geometry_shader4
|
---|
| 206 | typedef void (APIENTRY *_glProgramParameteriEXT)(GLuint program, GLenum pname, GLint value);
|
---|
| 207 | typedef void (APIENTRY *_glFramebufferTextureEXT)(GLenum target, GLenum attachment,
|
---|
| 208 | GLuint texture, GLint level);
|
---|
| 209 | typedef void (APIENTRY *_glFramebufferTextureLayerEXT)(GLenum target, GLenum attachment,
|
---|
| 210 | GLuint texture, GLint level, GLint layer);
|
---|
| 211 | typedef void (APIENTRY *_glFramebufferTextureFaceEXT)(GLenum target, GLenum attachment,
|
---|
| 212 | GLuint texture, GLint level, GLenum face);
|
---|
| 213 |
|
---|
[561] | 214 | // ARB_texture_compression
|
---|
| 215 | typedef void (APIENTRY *_glCompressedTexImage2DARB) (GLenum, GLint, GLenum, GLsizei,
|
---|
| 216 | GLsizei, GLint, GLsizei, const GLvoid *);
|
---|
| 217 |
|
---|
[846] | 218 | #ifndef QT_NO_EGL
|
---|
| 219 | // OES_EGL_image
|
---|
| 220 | // Note: We define these to take EGLImage whereas spec says they take a new GLeglImageOES
|
---|
| 221 | // type, which the EGL image should be cast to.
|
---|
| 222 | typedef void (APIENTRY *_glEGLImageTargetTexture2DOES) (GLenum, EGLImageKHR);
|
---|
| 223 | typedef void (APIENTRY *_glEGLImageTargetRenderbufferStorageOES) (GLenum, EGLImageKHR);
|
---|
| 224 | #endif
|
---|
| 225 |
|
---|
[2] | 226 | QT_BEGIN_NAMESPACE
|
---|
| 227 |
|
---|
| 228 | struct QGLExtensionFuncs
|
---|
| 229 | {
|
---|
| 230 | QGLExtensionFuncs() {
|
---|
[561] | 231 | #if !defined(QT_OPENGL_ES_2)
|
---|
[2] | 232 | qt_glProgramStringARB = 0;
|
---|
| 233 | qt_glBindProgramARB = 0;
|
---|
| 234 | qt_glDeleteProgramsARB = 0;
|
---|
| 235 | qt_glGenProgramsARB = 0;
|
---|
| 236 | qt_glProgramLocalParameter4fvARB = 0;
|
---|
| 237 |
|
---|
[561] | 238 | // GLSL
|
---|
[2] | 239 | qt_glCreateShader = 0;
|
---|
| 240 | qt_glShaderSource = 0;
|
---|
[561] | 241 | qt_glShaderBinary = 0;
|
---|
[2] | 242 | qt_glCompileShader = 0;
|
---|
| 243 | qt_glDeleteShader = 0;
|
---|
[561] | 244 | qt_glIsShader = 0;
|
---|
[2] | 245 |
|
---|
| 246 | qt_glCreateProgram = 0;
|
---|
| 247 | qt_glAttachShader = 0;
|
---|
| 248 | qt_glDetachShader = 0;
|
---|
| 249 | qt_glLinkProgram = 0;
|
---|
| 250 | qt_glUseProgram = 0;
|
---|
| 251 | qt_glDeleteProgram = 0;
|
---|
[561] | 252 | qt_glIsProgram = 0;
|
---|
[2] | 253 |
|
---|
| 254 | qt_glGetShaderInfoLog = 0;
|
---|
| 255 | qt_glGetShaderiv = 0;
|
---|
[561] | 256 | qt_glGetShaderSource = 0;
|
---|
[2] | 257 | qt_glGetProgramiv = 0;
|
---|
[561] | 258 | qt_glGetProgramInfoLog = 0;
|
---|
[2] | 259 |
|
---|
| 260 | qt_glGetUniformLocation = 0;
|
---|
| 261 | qt_glUniform4fv = 0;
|
---|
| 262 | qt_glUniform3fv = 0;
|
---|
| 263 | qt_glUniform2fv = 0;
|
---|
| 264 | qt_glUniform1fv = 0;
|
---|
| 265 | qt_glUniform1i = 0;
|
---|
[561] | 266 | qt_glUniform1iv = 0;
|
---|
| 267 | qt_glUniformMatrix2fv = 0;
|
---|
| 268 | qt_glUniformMatrix3fv = 0;
|
---|
| 269 | qt_glUniformMatrix4fv = 0;
|
---|
| 270 | qt_glUniformMatrix2x3fv = 0;
|
---|
| 271 | qt_glUniformMatrix2x4fv = 0;
|
---|
| 272 | qt_glUniformMatrix3x2fv = 0;
|
---|
| 273 | qt_glUniformMatrix3x4fv = 0;
|
---|
| 274 | qt_glUniformMatrix4x2fv = 0;
|
---|
| 275 | qt_glUniformMatrix4x3fv = 0;
|
---|
[2] | 276 |
|
---|
[561] | 277 | qt_glBindAttribLocation = 0;
|
---|
| 278 | qt_glGetAttribLocation = 0;
|
---|
| 279 | qt_glVertexAttrib1fv = 0;
|
---|
| 280 | qt_glVertexAttrib2fv = 0;
|
---|
| 281 | qt_glVertexAttrib3fv = 0;
|
---|
| 282 | qt_glVertexAttrib4fv = 0;
|
---|
| 283 | qt_glVertexAttribPointer = 0;
|
---|
| 284 | qt_glDisableVertexAttribArray = 0;
|
---|
| 285 | qt_glEnableVertexAttribArray = 0;
|
---|
[2] | 286 |
|
---|
[561] | 287 | // Extras for GL2 engine:
|
---|
[2] | 288 | qt_glActiveTexture = 0;
|
---|
[561] | 289 | qt_glStencilOpSeparate = 0;
|
---|
| 290 | qt_glBlendColor = 0;
|
---|
[2] | 291 |
|
---|
[561] | 292 | qt_glActiveStencilFaceEXT = 0;
|
---|
| 293 | qt_glMultiTexCoord4f = 0;
|
---|
| 294 | #else
|
---|
| 295 | qt_glslResolved = false;
|
---|
| 296 |
|
---|
| 297 | qt_glGetProgramBinaryOES = 0;
|
---|
| 298 | qt_glProgramBinaryOES = 0;
|
---|
| 299 | #endif
|
---|
| 300 |
|
---|
| 301 | // FBOs
|
---|
[2] | 302 | #if !defined(QT_OPENGL_ES_2)
|
---|
[561] | 303 | qt_glIsRenderbuffer = 0;
|
---|
| 304 | qt_glBindRenderbuffer = 0;
|
---|
| 305 | qt_glDeleteRenderbuffers = 0;
|
---|
| 306 | qt_glGenRenderbuffers = 0;
|
---|
| 307 | qt_glRenderbufferStorage = 0;
|
---|
| 308 | qt_glGetRenderbufferParameteriv = 0;
|
---|
| 309 | qt_glIsFramebuffer = 0;
|
---|
| 310 | qt_glBindFramebuffer = 0;
|
---|
| 311 | qt_glDeleteFramebuffers = 0;
|
---|
| 312 | qt_glGenFramebuffers = 0;
|
---|
| 313 | qt_glCheckFramebufferStatus = 0;
|
---|
| 314 | qt_glFramebufferTexture2D = 0;
|
---|
| 315 | qt_glFramebufferRenderbuffer = 0;
|
---|
| 316 | qt_glGetFramebufferAttachmentParameteriv = 0;
|
---|
| 317 | qt_glGenerateMipmap = 0;
|
---|
[2] | 318 | #endif
|
---|
[561] | 319 | qt_glBlitFramebufferEXT = 0;
|
---|
| 320 | qt_glRenderbufferStorageMultisampleEXT = 0;
|
---|
[2] | 321 |
|
---|
[561] | 322 | // Buffer objects:
|
---|
[846] | 323 | #if defined(QGL_RESOLVE_BUFFER_FUNCS)
|
---|
[561] | 324 | qt_glBindBuffer = 0;
|
---|
| 325 | qt_glDeleteBuffers = 0;
|
---|
| 326 | qt_glGenBuffers = 0;
|
---|
| 327 | qt_glBufferData = 0;
|
---|
[846] | 328 | qt_glBufferSubData = 0;
|
---|
| 329 | qt_glGetBufferSubData = 0;
|
---|
| 330 | qt_glGetBufferParameteriv = 0;
|
---|
[561] | 331 | #endif
|
---|
[2] | 332 | qt_glMapBufferARB = 0;
|
---|
| 333 | qt_glUnmapBufferARB = 0;
|
---|
[561] | 334 |
|
---|
[846] | 335 | qt_glProgramParameteriEXT = 0;
|
---|
| 336 | qt_glFramebufferTextureEXT = 0;
|
---|
| 337 | qt_glFramebufferTextureLayerEXT = 0;
|
---|
| 338 | qt_glFramebufferTextureFaceEXT = 0;
|
---|
[561] | 339 | #if !defined(QT_OPENGL_ES)
|
---|
| 340 | // Texture compression
|
---|
| 341 | qt_glCompressedTexImage2DARB = 0;
|
---|
| 342 | #endif
|
---|
[846] | 343 |
|
---|
| 344 | #ifndef QT_NO_EGL
|
---|
| 345 | // OES_EGL_image
|
---|
| 346 | qt_glEGLImageTargetTexture2DOES = 0;
|
---|
| 347 | qt_glEGLImageTargetRenderbufferStorageOES = 0;
|
---|
| 348 | #endif
|
---|
[2] | 349 | }
|
---|
| 350 |
|
---|
[561] | 351 |
|
---|
| 352 | #if !defined(QT_OPENGL_ES_2)
|
---|
[2] | 353 | _glProgramStringARB qt_glProgramStringARB;
|
---|
| 354 | _glBindProgramARB qt_glBindProgramARB;
|
---|
| 355 | _glDeleteProgramsARB qt_glDeleteProgramsARB;
|
---|
| 356 | _glGenProgramsARB qt_glGenProgramsARB;
|
---|
| 357 | _glProgramLocalParameter4fvARB qt_glProgramLocalParameter4fvARB;
|
---|
| 358 |
|
---|
| 359 | // GLSL definitions
|
---|
| 360 | _glCreateShader qt_glCreateShader;
|
---|
| 361 | _glShaderSource qt_glShaderSource;
|
---|
[561] | 362 | _glShaderBinary qt_glShaderBinary;
|
---|
[2] | 363 | _glCompileShader qt_glCompileShader;
|
---|
| 364 | _glDeleteShader qt_glDeleteShader;
|
---|
[561] | 365 | _glIsShader qt_glIsShader;
|
---|
[2] | 366 |
|
---|
| 367 | _glCreateProgram qt_glCreateProgram;
|
---|
| 368 | _glAttachShader qt_glAttachShader;
|
---|
| 369 | _glDetachShader qt_glDetachShader;
|
---|
| 370 | _glLinkProgram qt_glLinkProgram;
|
---|
| 371 | _glUseProgram qt_glUseProgram;
|
---|
| 372 | _glDeleteProgram qt_glDeleteProgram;
|
---|
[561] | 373 | _glIsProgram qt_glIsProgram;
|
---|
[2] | 374 |
|
---|
| 375 | _glGetShaderInfoLog qt_glGetShaderInfoLog;
|
---|
| 376 | _glGetShaderiv qt_glGetShaderiv;
|
---|
[561] | 377 | _glGetShaderSource qt_glGetShaderSource;
|
---|
[2] | 378 | _glGetProgramiv qt_glGetProgramiv;
|
---|
[561] | 379 | _glGetProgramInfoLog qt_glGetProgramInfoLog;
|
---|
[2] | 380 |
|
---|
| 381 | _glGetUniformLocation qt_glGetUniformLocation;
|
---|
| 382 | _glUniform4fv qt_glUniform4fv;
|
---|
| 383 | _glUniform3fv qt_glUniform3fv;
|
---|
| 384 | _glUniform2fv qt_glUniform2fv;
|
---|
| 385 | _glUniform1fv qt_glUniform1fv;
|
---|
| 386 | _glUniform1i qt_glUniform1i;
|
---|
[561] | 387 | _glUniform1iv qt_glUniform1iv;
|
---|
| 388 | _glUniformMatrix2fv qt_glUniformMatrix2fv;
|
---|
| 389 | _glUniformMatrix3fv qt_glUniformMatrix3fv;
|
---|
| 390 | _glUniformMatrix4fv qt_glUniformMatrix4fv;
|
---|
| 391 | _glUniformMatrix2x3fv qt_glUniformMatrix2x3fv;
|
---|
| 392 | _glUniformMatrix2x4fv qt_glUniformMatrix2x4fv;
|
---|
| 393 | _glUniformMatrix3x2fv qt_glUniformMatrix3x2fv;
|
---|
| 394 | _glUniformMatrix3x4fv qt_glUniformMatrix3x4fv;
|
---|
| 395 | _glUniformMatrix4x2fv qt_glUniformMatrix4x2fv;
|
---|
| 396 | _glUniformMatrix4x3fv qt_glUniformMatrix4x3fv;
|
---|
[2] | 397 |
|
---|
[561] | 398 | _glBindAttribLocation qt_glBindAttribLocation;
|
---|
| 399 | _glGetAttribLocation qt_glGetAttribLocation;
|
---|
| 400 | _glVertexAttrib1fv qt_glVertexAttrib1fv;
|
---|
| 401 | _glVertexAttrib2fv qt_glVertexAttrib2fv;
|
---|
| 402 | _glVertexAttrib3fv qt_glVertexAttrib3fv;
|
---|
| 403 | _glVertexAttrib4fv qt_glVertexAttrib4fv;
|
---|
| 404 | _glVertexAttribPointer qt_glVertexAttribPointer;
|
---|
| 405 | _glDisableVertexAttribArray qt_glDisableVertexAttribArray;
|
---|
| 406 | _glEnableVertexAttribArray qt_glEnableVertexAttribArray;
|
---|
| 407 |
|
---|
| 408 | #else
|
---|
| 409 | bool qt_glslResolved;
|
---|
| 410 |
|
---|
| 411 | _glGetProgramBinaryOES qt_glGetProgramBinaryOES;
|
---|
| 412 | _glProgramBinaryOES qt_glProgramBinaryOES;
|
---|
| 413 | #endif
|
---|
| 414 |
|
---|
[2] | 415 | _glActiveStencilFaceEXT qt_glActiveStencilFaceEXT;
|
---|
[561] | 416 | _glMultiTexCoord4f qt_glMultiTexCoord4f;
|
---|
[2] | 417 |
|
---|
[561] | 418 | #if !defined(QT_OPENGL_ES_2)
|
---|
| 419 | // Extras needed for GL2 engine:
|
---|
[2] | 420 | _glActiveTexture qt_glActiveTexture;
|
---|
[561] | 421 | _glStencilOpSeparate qt_glStencilOpSeparate;
|
---|
| 422 | _glBlendColor qt_glBlendColor;
|
---|
[2] | 423 |
|
---|
[561] | 424 | #endif
|
---|
| 425 |
|
---|
| 426 | // FBOs
|
---|
[2] | 427 | #if !defined(QT_OPENGL_ES_2)
|
---|
[561] | 428 | _glIsRenderbuffer qt_glIsRenderbuffer;
|
---|
| 429 | _glBindRenderbuffer qt_glBindRenderbuffer;
|
---|
| 430 | _glDeleteRenderbuffers qt_glDeleteRenderbuffers;
|
---|
| 431 | _glGenRenderbuffers qt_glGenRenderbuffers;
|
---|
| 432 | _glRenderbufferStorage qt_glRenderbufferStorage;
|
---|
| 433 | _glGetRenderbufferParameteriv qt_glGetRenderbufferParameteriv;
|
---|
| 434 | _glIsFramebuffer qt_glIsFramebuffer;
|
---|
| 435 | _glBindFramebuffer qt_glBindFramebuffer;
|
---|
| 436 | _glDeleteFramebuffers qt_glDeleteFramebuffers;
|
---|
| 437 | _glGenFramebuffers qt_glGenFramebuffers;
|
---|
| 438 | _glCheckFramebufferStatus qt_glCheckFramebufferStatus;
|
---|
| 439 | _glFramebufferTexture2D qt_glFramebufferTexture2D;
|
---|
| 440 | _glFramebufferRenderbuffer qt_glFramebufferRenderbuffer;
|
---|
| 441 | _glGetFramebufferAttachmentParameteriv qt_glGetFramebufferAttachmentParameteriv;
|
---|
| 442 | _glGenerateMipmap qt_glGenerateMipmap;
|
---|
[2] | 443 | #endif
|
---|
[561] | 444 | _glBlitFramebufferEXT qt_glBlitFramebufferEXT;
|
---|
| 445 | _glRenderbufferStorageMultisampleEXT qt_glRenderbufferStorageMultisampleEXT;
|
---|
[2] | 446 |
|
---|
[561] | 447 | // Buffer objects
|
---|
[846] | 448 | #if defined(QGL_RESOLVE_BUFFER_FUNCS)
|
---|
[561] | 449 | _glBindBuffer qt_glBindBuffer;
|
---|
| 450 | _glDeleteBuffers qt_glDeleteBuffers;
|
---|
| 451 | _glGenBuffers qt_glGenBuffers;
|
---|
| 452 | _glBufferData qt_glBufferData;
|
---|
[846] | 453 | _glBufferSubData qt_glBufferSubData;
|
---|
| 454 | _glGetBufferSubData qt_glGetBufferSubData;
|
---|
| 455 | _glGetBufferParameteriv qt_glGetBufferParameteriv;
|
---|
[561] | 456 | #endif
|
---|
[2] | 457 | _glMapBufferARB qt_glMapBufferARB;
|
---|
| 458 | _glUnmapBufferARB qt_glUnmapBufferARB;
|
---|
[561] | 459 |
|
---|
[846] | 460 | // Geometry shaders...
|
---|
| 461 | _glProgramParameteriEXT qt_glProgramParameteriEXT;
|
---|
| 462 | _glFramebufferTextureEXT qt_glFramebufferTextureEXT;
|
---|
| 463 | _glFramebufferTextureLayerEXT qt_glFramebufferTextureLayerEXT;
|
---|
| 464 | _glFramebufferTextureFaceEXT qt_glFramebufferTextureFaceEXT;
|
---|
[561] | 465 | #if !defined(QT_OPENGL_ES)
|
---|
| 466 | // Texture compression
|
---|
| 467 | _glCompressedTexImage2DARB qt_glCompressedTexImage2DARB;
|
---|
| 468 | #endif
|
---|
[846] | 469 |
|
---|
| 470 | #ifndef QT_NO_EGL
|
---|
| 471 | // OES_EGL_image
|
---|
| 472 | _glEGLImageTargetTexture2DOES qt_glEGLImageTargetTexture2DOES;
|
---|
| 473 | _glEGLImageTargetRenderbufferStorageOES qt_glEGLImageTargetRenderbufferStorageOES;
|
---|
| 474 | #endif
|
---|
[2] | 475 | };
|
---|
| 476 |
|
---|
| 477 |
|
---|
| 478 | // OpenGL constants
|
---|
| 479 |
|
---|
[846] | 480 | #ifndef GL_ARRAY_BUFFER
|
---|
| 481 | #define GL_ARRAY_BUFFER 0x8892
|
---|
| 482 | #endif
|
---|
| 483 |
|
---|
| 484 | #ifndef GL_STATIC_DRAW
|
---|
| 485 | #define GL_STATIC_DRAW 0x88E4
|
---|
| 486 | #endif
|
---|
| 487 |
|
---|
[2] | 488 | /* NV_texture_rectangle */
|
---|
| 489 | #ifndef GL_NV_texture_rectangle
|
---|
| 490 | #define GL_TEXTURE_RECTANGLE_NV 0x84F5
|
---|
| 491 | #define GL_TEXTURE_BINDING_RECTANGLE_NV 0x84F6
|
---|
| 492 | #define GL_PROXY_TEXTURE_RECTANGLE_NV 0x84F7
|
---|
| 493 | #define GL_MAX_RECTANGLE_TEXTURE_SIZE_NV 0x84F8
|
---|
| 494 | #endif
|
---|
| 495 |
|
---|
| 496 | #ifndef GL_BGRA
|
---|
| 497 | #define GL_BGRA 0x80E1
|
---|
| 498 | #endif
|
---|
| 499 |
|
---|
[561] | 500 | #ifndef GL_RGB16
|
---|
[846] | 501 | #define GL_RGB16 0x8054
|
---|
[561] | 502 | #endif
|
---|
| 503 |
|
---|
| 504 | #ifndef GL_UNSIGNED_SHORT_5_6_5
|
---|
[846] | 505 | #define GL_UNSIGNED_SHORT_5_6_5 0x8363
|
---|
[561] | 506 | #endif
|
---|
| 507 |
|
---|
| 508 | #ifndef GL_UNSIGNED_INT_8_8_8_8_REV
|
---|
| 509 | #define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367
|
---|
| 510 | #endif
|
---|
| 511 |
|
---|
[2] | 512 | #ifndef GL_MULTISAMPLE
|
---|
| 513 | #define GL_MULTISAMPLE 0x809D
|
---|
| 514 | #endif
|
---|
| 515 |
|
---|
| 516 | #ifndef GL_CLAMP_TO_EDGE
|
---|
| 517 | #define GL_CLAMP_TO_EDGE 0x812F
|
---|
| 518 | #endif
|
---|
| 519 |
|
---|
| 520 | #ifndef GL_IBM_texture_mirrored_repeat
|
---|
| 521 | #define GL_MIRRORED_REPEAT_IBM 0x8370
|
---|
| 522 | #endif
|
---|
| 523 |
|
---|
| 524 | #ifndef GL_SGIS_generate_mipmap
|
---|
| 525 | #define GL_GENERATE_MIPMAP_SGIS 0x8191
|
---|
| 526 | #define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192
|
---|
| 527 | #endif
|
---|
| 528 |
|
---|
| 529 | // ARB_fragment_program extension protos
|
---|
| 530 | #ifndef GL_FRAGMENT_PROGRAM_ARB
|
---|
| 531 | #define GL_FRAGMENT_PROGRAM_ARB 0x8804
|
---|
| 532 | #define GL_PROGRAM_FORMAT_ASCII_ARB 0x8875
|
---|
| 533 | #endif
|
---|
| 534 |
|
---|
| 535 | #ifndef GL_PIXEL_UNPACK_BUFFER_ARB
|
---|
| 536 | #define GL_PIXEL_UNPACK_BUFFER_ARB 0x88EC
|
---|
| 537 | #endif
|
---|
| 538 |
|
---|
| 539 | #ifndef GL_WRITE_ONLY_ARB
|
---|
| 540 | #define GL_WRITE_ONLY_ARB 0x88B9
|
---|
| 541 | #endif
|
---|
| 542 |
|
---|
| 543 | #ifndef GL_STREAM_DRAW_ARB
|
---|
| 544 | #define GL_STREAM_DRAW_ARB 0x88E0
|
---|
| 545 | #endif
|
---|
| 546 |
|
---|
| 547 | // Stencil wrap and two-side defines
|
---|
| 548 | #ifndef GL_STENCIL_TEST_TWO_SIDE_EXT
|
---|
| 549 | #define GL_STENCIL_TEST_TWO_SIDE_EXT 0x8910
|
---|
| 550 | #endif
|
---|
| 551 | #ifndef GL_INCR_WRAP_EXT
|
---|
| 552 | #define GL_INCR_WRAP_EXT 0x8507
|
---|
| 553 | #endif
|
---|
| 554 | #ifndef GL_DECR_WRAP_EXT
|
---|
| 555 | #define GL_DECR_WRAP_EXT 0x8508
|
---|
| 556 | #endif
|
---|
| 557 |
|
---|
| 558 | #ifndef GL_TEXTURE0
|
---|
| 559 | #define GL_TEXTURE0 0x84C0
|
---|
| 560 | #endif
|
---|
| 561 |
|
---|
| 562 | #ifndef GL_TEXTURE1
|
---|
| 563 | #define GL_TEXTURE1 0x84C1
|
---|
| 564 | #endif
|
---|
| 565 |
|
---|
[846] | 566 | #ifndef GL_DEPTH_COMPONENT16
|
---|
| 567 | #define GL_DEPTH_COMPONENT16 0x81A5
|
---|
| 568 | #endif
|
---|
| 569 |
|
---|
| 570 | #ifndef GL_DEPTH_COMPONENT24_OES
|
---|
| 571 | #define GL_DEPTH_COMPONENT24_OES 0x81A6
|
---|
| 572 | #endif
|
---|
| 573 |
|
---|
[2] | 574 | #ifndef GL_EXT_framebuffer_object
|
---|
| 575 | #define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506
|
---|
| 576 | #define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8
|
---|
| 577 | #define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6
|
---|
| 578 | #define GL_RENDERBUFFER_BINDING_EXT 0x8CA7
|
---|
| 579 | #define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0
|
---|
| 580 | #define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1
|
---|
| 581 | #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2
|
---|
| 582 | #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3
|
---|
| 583 | #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4
|
---|
| 584 | #define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5
|
---|
| 585 | #define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6
|
---|
| 586 | #define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7
|
---|
| 587 | #define GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT 0x8CD8
|
---|
| 588 | #define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9
|
---|
| 589 | #define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA
|
---|
| 590 | #define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB
|
---|
| 591 | #define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC
|
---|
| 592 | #define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD
|
---|
| 593 | #define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF
|
---|
| 594 | #define GL_COLOR_ATTACHMENT0_EXT 0x8CE0
|
---|
| 595 | #define GL_COLOR_ATTACHMENT1_EXT 0x8CE1
|
---|
| 596 | #define GL_COLOR_ATTACHMENT2_EXT 0x8CE2
|
---|
| 597 | #define GL_COLOR_ATTACHMENT3_EXT 0x8CE3
|
---|
| 598 | #define GL_COLOR_ATTACHMENT4_EXT 0x8CE4
|
---|
| 599 | #define GL_COLOR_ATTACHMENT5_EXT 0x8CE5
|
---|
| 600 | #define GL_COLOR_ATTACHMENT6_EXT 0x8CE6
|
---|
| 601 | #define GL_COLOR_ATTACHMENT7_EXT 0x8CE7
|
---|
| 602 | #define GL_COLOR_ATTACHMENT8_EXT 0x8CE8
|
---|
| 603 | #define GL_COLOR_ATTACHMENT9_EXT 0x8CE9
|
---|
| 604 | #define GL_COLOR_ATTACHMENT10_EXT 0x8CEA
|
---|
| 605 | #define GL_COLOR_ATTACHMENT11_EXT 0x8CEB
|
---|
| 606 | #define GL_COLOR_ATTACHMENT12_EXT 0x8CEC
|
---|
| 607 | #define GL_COLOR_ATTACHMENT13_EXT 0x8CED
|
---|
| 608 | #define GL_COLOR_ATTACHMENT14_EXT 0x8CEE
|
---|
| 609 | #define GL_COLOR_ATTACHMENT15_EXT 0x8CEF
|
---|
| 610 | #define GL_DEPTH_ATTACHMENT_EXT 0x8D00
|
---|
| 611 | #define GL_STENCIL_ATTACHMENT_EXT 0x8D20
|
---|
| 612 | #define GL_FRAMEBUFFER_EXT 0x8D40
|
---|
| 613 | #define GL_RENDERBUFFER_EXT 0x8D41
|
---|
| 614 | #define GL_RENDERBUFFER_WIDTH_EXT 0x8D42
|
---|
| 615 | #define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43
|
---|
| 616 | #define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44
|
---|
| 617 | #define GL_STENCIL_INDEX_EXT 0x8D45
|
---|
| 618 | #define GL_STENCIL_INDEX1_EXT 0x8D46
|
---|
| 619 | #define GL_STENCIL_INDEX4_EXT 0x8D47
|
---|
| 620 | #define GL_STENCIL_INDEX8_EXT 0x8D48
|
---|
| 621 | #define GL_STENCIL_INDEX16_EXT 0x8D49
|
---|
| 622 | #define GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50
|
---|
| 623 | #define GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51
|
---|
| 624 | #define GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52
|
---|
| 625 | #define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53
|
---|
| 626 | #define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54
|
---|
| 627 | #define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55
|
---|
| 628 | #endif
|
---|
| 629 |
|
---|
[561] | 630 | // GL_EXT_framebuffer_blit
|
---|
| 631 | #ifndef GL_READ_FRAMEBUFFER_EXT
|
---|
| 632 | #define GL_READ_FRAMEBUFFER_EXT 0x8CA8
|
---|
| 633 | #endif
|
---|
| 634 |
|
---|
| 635 | // GL_EXT_framebuffer_multisample
|
---|
| 636 | #ifndef GL_RENDERBUFFER_SAMPLES_EXT
|
---|
| 637 | #define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB
|
---|
| 638 | #endif
|
---|
| 639 |
|
---|
| 640 | #ifndef GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT
|
---|
| 641 | #define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56
|
---|
| 642 | #endif
|
---|
| 643 |
|
---|
| 644 | #ifndef GL_MAX_SAMPLES_EXT
|
---|
| 645 | #define GL_MAX_SAMPLES_EXT 0x8D57
|
---|
| 646 | #endif
|
---|
| 647 |
|
---|
| 648 | #ifndef GL_DRAW_FRAMEBUFFER_EXT
|
---|
| 649 | #define GL_DRAW_FRAMEBUFFER_EXT 0x8CA9
|
---|
| 650 | #endif
|
---|
| 651 |
|
---|
[2] | 652 | #ifndef GL_EXT_packed_depth_stencil
|
---|
| 653 | #define GL_DEPTH_STENCIL_EXT 0x84F9
|
---|
| 654 | #define GL_UNSIGNED_INT_24_8_EXT 0x84FA
|
---|
| 655 | #define GL_DEPTH24_STENCIL8_EXT 0x88F0
|
---|
| 656 | #define GL_TEXTURE_STENCIL_SIZE_EXT 0x88F1
|
---|
| 657 | #endif
|
---|
| 658 |
|
---|
| 659 | // ### hm. should be part of the GL 1.2 spec..
|
---|
| 660 | #ifndef GL_CLAMP_TO_EDGE
|
---|
| 661 | #define GL_CLAMP_TO_EDGE 0x812F
|
---|
| 662 | #endif
|
---|
| 663 |
|
---|
| 664 | #ifndef GL_VERSION_1_2
|
---|
| 665 | #define GL_PACK_SKIP_IMAGES 0x806B
|
---|
| 666 | #define GL_PACK_IMAGE_HEIGHT 0x806C
|
---|
| 667 | #define GL_UNPACK_SKIP_IMAGES 0x806D
|
---|
| 668 | #define GL_UNPACK_IMAGE_HEIGHT 0x806E
|
---|
| 669 | #endif
|
---|
| 670 |
|
---|
[561] | 671 | #ifndef GL_VERSION_1_4
|
---|
| 672 | #define GL_CONSTANT_COLOR 0x8001
|
---|
| 673 | #define GL_ONE_MINUS_CONSTANT_COLOR 0x8002
|
---|
| 674 | #define GL_CONSTANT_ALPHA 0x8003
|
---|
| 675 | #define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004
|
---|
| 676 | #define GL_INCR_WRAP 0x8507
|
---|
| 677 | #define GL_DECR_WRAP 0x8508
|
---|
| 678 | #endif
|
---|
[2] | 679 |
|
---|
[846] | 680 | #ifndef GL_VERSION_1_5
|
---|
| 681 | #define GL_ARRAY_BUFFER 0x8892
|
---|
| 682 | #define GL_ELEMENT_ARRAY_BUFFER 0x8893
|
---|
| 683 | #define GL_STREAM_DRAW 0x88E0
|
---|
| 684 | #define GL_STREAM_READ 0x88E1
|
---|
| 685 | #define GL_STREAM_COPY 0x88E2
|
---|
| 686 | #define GL_STATIC_DRAW 0x88E4
|
---|
| 687 | #define GL_STATIC_READ 0x88E5
|
---|
| 688 | #define GL_STATIC_COPY 0x88E6
|
---|
| 689 | #define GL_DYNAMIC_DRAW 0x88E8
|
---|
| 690 | #define GL_DYNAMIC_READ 0x88E9
|
---|
| 691 | #define GL_DYNAMIC_COPY 0x88EA
|
---|
| 692 | #endif
|
---|
| 693 |
|
---|
[561] | 694 | #ifndef GL_VERSION_2_0
|
---|
| 695 | #define GL_FRAGMENT_SHADER 0x8B30
|
---|
| 696 | #define GL_VERTEX_SHADER 0x8B31
|
---|
| 697 | #define GL_FLOAT_VEC2 0x8B50
|
---|
| 698 | #define GL_FLOAT_VEC3 0x8B51
|
---|
| 699 | #define GL_FLOAT_VEC4 0x8B52
|
---|
| 700 | #define GL_INT_VEC2 0x8B53
|
---|
| 701 | #define GL_INT_VEC3 0x8B54
|
---|
| 702 | #define GL_INT_VEC4 0x8B55
|
---|
| 703 | #define GL_BOOL 0x8B56
|
---|
| 704 | #define GL_BOOL_VEC2 0x8B57
|
---|
| 705 | #define GL_BOOL_VEC3 0x8B58
|
---|
| 706 | #define GL_BOOL_VEC4 0x8B59
|
---|
| 707 | #define GL_FLOAT_MAT2 0x8B5A
|
---|
| 708 | #define GL_FLOAT_MAT3 0x8B5B
|
---|
| 709 | #define GL_FLOAT_MAT4 0x8B5C
|
---|
| 710 | #define GL_SAMPLER_1D 0x8B5D
|
---|
| 711 | #define GL_SAMPLER_2D 0x8B5E
|
---|
| 712 | #define GL_SAMPLER_3D 0x8B5F
|
---|
| 713 | #define GL_SAMPLER_CUBE 0x8B60
|
---|
| 714 | #define GL_COMPILE_STATUS 0x8B81
|
---|
| 715 | #define GL_LINK_STATUS 0x8B82
|
---|
| 716 | #define GL_INFO_LOG_LENGTH 0x8B84
|
---|
| 717 | #define GL_ACTIVE_UNIFORMS 0x8B86
|
---|
| 718 | #define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87
|
---|
| 719 | #define GL_ACTIVE_ATTRIBUTES 0x8B89
|
---|
| 720 | #define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A
|
---|
| 721 | #endif
|
---|
[2] | 722 |
|
---|
[846] | 723 | // Geometry shader defines
|
---|
| 724 | #ifndef GL_GEOMETRY_SHADER_EXT
|
---|
| 725 | # define GL_GEOMETRY_SHADER_EXT 0x8DD9
|
---|
| 726 | # define GL_GEOMETRY_VERTICES_OUT_EXT 0x8DDA
|
---|
| 727 | # define GL_GEOMETRY_INPUT_TYPE_EXT 0x8DDB
|
---|
| 728 | # define GL_GEOMETRY_OUTPUT_TYPE_EXT 0x8DDC
|
---|
| 729 | # define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29
|
---|
| 730 | # define GL_MAX_GEOMETRY_VARYING_COMPONENTS_EXT 0x8DDD
|
---|
| 731 | # define GL_MAX_VERTEX_VARYING_COMPONENTS_EXT 0x8DDE
|
---|
| 732 | # define GL_MAX_VARYING_COMPONENTS_EXT 0x8B4B
|
---|
| 733 | # define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF
|
---|
| 734 | # define GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0
|
---|
| 735 | # define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1
|
---|
| 736 | # define GL_LINES_ADJACENCY_EXT 0xA
|
---|
| 737 | # define GL_LINE_STRIP_ADJACENCY_EXT 0xB
|
---|
| 738 | # define GL_TRIANGLES_ADJACENCY_EXT 0xC
|
---|
| 739 | # define GL_TRIANGLE_STRIP_ADJACENCY_EXT 0xD
|
---|
| 740 | # define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8
|
---|
| 741 | # define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT 0x8DA9
|
---|
| 742 | # define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7
|
---|
| 743 | # define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4
|
---|
| 744 | # define GL_PROGRAM_POINT_SIZE_EXT 0x8642
|
---|
| 745 | #endif
|
---|
[2] | 746 |
|
---|
| 747 | #if !defined(QT_OPENGL_ES_2)
|
---|
[561] | 748 | #define glProgramStringARB QGLContextPrivate::extensionFuncs(ctx).qt_glProgramStringARB
|
---|
| 749 | #define glBindProgramARB QGLContextPrivate::extensionFuncs(ctx).qt_glBindProgramARB
|
---|
| 750 | #define glDeleteProgramsARB QGLContextPrivate::extensionFuncs(ctx).qt_glDeleteProgramsARB
|
---|
| 751 | #define glGenProgramsARB QGLContextPrivate::extensionFuncs(ctx).qt_glGenProgramsARB
|
---|
| 752 | #define glProgramLocalParameter4fvARB QGLContextPrivate::extensionFuncs(ctx).qt_glProgramLocalParameter4fvARB
|
---|
| 753 |
|
---|
| 754 | #define glActiveStencilFaceEXT QGLContextPrivate::extensionFuncs(ctx).qt_glActiveStencilFaceEXT
|
---|
| 755 |
|
---|
| 756 | #define glMultiTexCoord4f QGLContextPrivate::extensionFuncs(ctx).qt_glMultiTexCoord4f
|
---|
| 757 |
|
---|
| 758 | #define glActiveTexture QGLContextPrivate::extensionFuncs(ctx).qt_glActiveTexture
|
---|
| 759 | #endif // !defined(QT_OPENGL_ES_2)
|
---|
| 760 |
|
---|
| 761 |
|
---|
| 762 | // FBOs
|
---|
| 763 | #if !defined(QT_OPENGL_ES_2)
|
---|
| 764 | #define glIsRenderbuffer QGLContextPrivate::extensionFuncs(ctx).qt_glIsRenderbuffer
|
---|
| 765 | #define glBindRenderbuffer QGLContextPrivate::extensionFuncs(ctx).qt_glBindRenderbuffer
|
---|
| 766 | #define glDeleteRenderbuffers QGLContextPrivate::extensionFuncs(ctx).qt_glDeleteRenderbuffers
|
---|
| 767 | #define glGenRenderbuffers QGLContextPrivate::extensionFuncs(ctx).qt_glGenRenderbuffers
|
---|
| 768 | #define glRenderbufferStorage QGLContextPrivate::extensionFuncs(ctx).qt_glRenderbufferStorage
|
---|
| 769 | #define glGetRenderbufferParameteriv QGLContextPrivate::extensionFuncs(ctx).qt_glGetRenderbufferParameteriv
|
---|
| 770 | #define glIsFramebuffer QGLContextPrivate::extensionFuncs(ctx).qt_glIsFramebuffer
|
---|
| 771 | #define glBindFramebuffer QGLContextPrivate::extensionFuncs(ctx).qt_glBindFramebuffer
|
---|
| 772 | #define glDeleteFramebuffers QGLContextPrivate::extensionFuncs(ctx).qt_glDeleteFramebuffers
|
---|
| 773 | #define glGenFramebuffers QGLContextPrivate::extensionFuncs(ctx).qt_glGenFramebuffers
|
---|
| 774 | #define glCheckFramebufferStatus QGLContextPrivate::extensionFuncs(ctx).qt_glCheckFramebufferStatus
|
---|
| 775 | #define glFramebufferTexture2D QGLContextPrivate::extensionFuncs(ctx).qt_glFramebufferTexture2D
|
---|
| 776 | #define glFramebufferRenderbuffer QGLContextPrivate::extensionFuncs(ctx).qt_glFramebufferRenderbuffer
|
---|
| 777 | #define glGetFramebufferAttachmentParameteriv QGLContextPrivate::extensionFuncs(ctx).qt_glGetFramebufferAttachmentParameteriv
|
---|
| 778 | #define glGenerateMipmap QGLContextPrivate::extensionFuncs(ctx).qt_glGenerateMipmap
|
---|
| 779 | #endif // QT_OPENGL_ES_2
|
---|
| 780 | #define glBlitFramebufferEXT QGLContextPrivate::extensionFuncs(ctx).qt_glBlitFramebufferEXT
|
---|
| 781 | #define glRenderbufferStorageMultisampleEXT QGLContextPrivate::extensionFuncs(ctx).qt_glRenderbufferStorageMultisampleEXT
|
---|
| 782 |
|
---|
| 783 |
|
---|
| 784 | // Buffer objects
|
---|
[846] | 785 | #if defined(QGL_RESOLVE_BUFFER_FUNCS)
|
---|
[561] | 786 | #define glBindBuffer QGLContextPrivate::extensionFuncs(ctx).qt_glBindBuffer
|
---|
| 787 | #define glDeleteBuffers QGLContextPrivate::extensionFuncs(ctx).qt_glDeleteBuffers
|
---|
| 788 | #define glGenBuffers QGLContextPrivate::extensionFuncs(ctx).qt_glGenBuffers
|
---|
| 789 | #define glBufferData QGLContextPrivate::extensionFuncs(ctx).qt_glBufferData
|
---|
[846] | 790 | #define glBufferSubData QGLContextPrivate::extensionFuncs(ctx).qt_glBufferSubData
|
---|
| 791 | #define glGetBufferSubData QGLContextPrivate::extensionFuncs(ctx).qt_glGetBufferSubData
|
---|
| 792 | #define glGetBufferParameteriv QGLContextPrivate::extensionFuncs(ctx).qt_glGetBufferParameteriv
|
---|
[2] | 793 | #endif
|
---|
[561] | 794 | #define glMapBufferARB QGLContextPrivate::extensionFuncs(ctx).qt_glMapBufferARB
|
---|
| 795 | #define glUnmapBufferARB QGLContextPrivate::extensionFuncs(ctx).qt_glUnmapBufferARB
|
---|
[2] | 796 |
|
---|
[561] | 797 |
|
---|
| 798 | // GLSL
|
---|
[2] | 799 | #if !defined(QT_OPENGL_ES_2)
|
---|
| 800 |
|
---|
[561] | 801 | #define glCreateShader QGLContextPrivate::extensionFuncs(ctx).qt_glCreateShader
|
---|
| 802 | #define glShaderSource QGLContextPrivate::extensionFuncs(ctx).qt_glShaderSource
|
---|
| 803 | #define glShaderBinary QGLContextPrivate::extensionFuncs(ctx).qt_glShaderBinary
|
---|
| 804 | #define glCompileShader QGLContextPrivate::extensionFuncs(ctx).qt_glCompileShader
|
---|
| 805 | #define glDeleteShader QGLContextPrivate::extensionFuncs(ctx).qt_glDeleteShader
|
---|
| 806 | #define glIsShader QGLContextPrivate::extensionFuncs(ctx).qt_glIsShader
|
---|
[2] | 807 |
|
---|
[561] | 808 | #define glCreateProgram QGLContextPrivate::extensionFuncs(ctx).qt_glCreateProgram
|
---|
| 809 | #define glAttachShader QGLContextPrivate::extensionFuncs(ctx).qt_glAttachShader
|
---|
| 810 | #define glDetachShader QGLContextPrivate::extensionFuncs(ctx).qt_glDetachShader
|
---|
| 811 | #define glLinkProgram QGLContextPrivate::extensionFuncs(ctx).qt_glLinkProgram
|
---|
| 812 | #define glUseProgram QGLContextPrivate::extensionFuncs(ctx).qt_glUseProgram
|
---|
| 813 | #define glDeleteProgram QGLContextPrivate::extensionFuncs(ctx).qt_glDeleteProgram
|
---|
| 814 | #define glIsProgram QGLContextPrivate::extensionFuncs(ctx).qt_glIsProgram
|
---|
| 815 |
|
---|
| 816 | #define glGetShaderInfoLog QGLContextPrivate::extensionFuncs(ctx).qt_glGetShaderInfoLog
|
---|
| 817 | #define glGetShaderiv QGLContextPrivate::extensionFuncs(ctx).qt_glGetShaderiv
|
---|
| 818 | #define glGetShaderSource QGLContextPrivate::extensionFuncs(ctx).qt_glGetShaderSource
|
---|
| 819 | #define glGetProgramiv QGLContextPrivate::extensionFuncs(ctx).qt_glGetProgramiv
|
---|
| 820 | #define glGetProgramInfoLog QGLContextPrivate::extensionFuncs(ctx).qt_glGetProgramInfoLog
|
---|
| 821 |
|
---|
| 822 | #define glGetUniformLocation QGLContextPrivate::extensionFuncs(ctx).qt_glGetUniformLocation
|
---|
| 823 | #define glUniform4fv QGLContextPrivate::extensionFuncs(ctx).qt_glUniform4fv
|
---|
| 824 | #define glUniform3fv QGLContextPrivate::extensionFuncs(ctx).qt_glUniform3fv
|
---|
| 825 | #define glUniform2fv QGLContextPrivate::extensionFuncs(ctx).qt_glUniform2fv
|
---|
| 826 | #define glUniform1fv QGLContextPrivate::extensionFuncs(ctx).qt_glUniform1fv
|
---|
| 827 | #define glUniform1i QGLContextPrivate::extensionFuncs(ctx).qt_glUniform1i
|
---|
| 828 | #define glUniform1iv QGLContextPrivate::extensionFuncs(ctx).qt_glUniform1iv
|
---|
| 829 | #define glUniformMatrix2fv QGLContextPrivate::extensionFuncs(ctx).qt_glUniformMatrix2fv
|
---|
| 830 | #define glUniformMatrix3fv QGLContextPrivate::extensionFuncs(ctx).qt_glUniformMatrix3fv
|
---|
| 831 | #define glUniformMatrix4fv QGLContextPrivate::extensionFuncs(ctx).qt_glUniformMatrix4fv
|
---|
| 832 | #define glUniformMatrix2x3fv QGLContextPrivate::extensionFuncs(ctx).qt_glUniformMatrix2x3fv
|
---|
| 833 | #define glUniformMatrix2x4fv QGLContextPrivate::extensionFuncs(ctx).qt_glUniformMatrix2x4fv
|
---|
| 834 | #define glUniformMatrix3x2fv QGLContextPrivate::extensionFuncs(ctx).qt_glUniformMatrix3x2fv
|
---|
| 835 | #define glUniformMatrix3x4fv QGLContextPrivate::extensionFuncs(ctx).qt_glUniformMatrix3x4fv
|
---|
| 836 | #define glUniformMatrix4x2fv QGLContextPrivate::extensionFuncs(ctx).qt_glUniformMatrix4x2fv
|
---|
| 837 | #define glUniformMatrix4x3fv QGLContextPrivate::extensionFuncs(ctx).qt_glUniformMatrix4x3fv
|
---|
| 838 |
|
---|
| 839 | #define glBindAttribLocation QGLContextPrivate::extensionFuncs(ctx).qt_glBindAttribLocation
|
---|
| 840 | #define glGetAttribLocation QGLContextPrivate::extensionFuncs(ctx).qt_glGetAttribLocation
|
---|
| 841 | #define glVertexAttrib1fv QGLContextPrivate::extensionFuncs(ctx).qt_glVertexAttrib1fv
|
---|
| 842 | #define glVertexAttrib2fv QGLContextPrivate::extensionFuncs(ctx).qt_glVertexAttrib2fv
|
---|
| 843 | #define glVertexAttrib3fv QGLContextPrivate::extensionFuncs(ctx).qt_glVertexAttrib3fv
|
---|
| 844 | #define glVertexAttrib4fv QGLContextPrivate::extensionFuncs(ctx).qt_glVertexAttrib4fv
|
---|
| 845 | #define glVertexAttribPointer QGLContextPrivate::extensionFuncs(ctx).qt_glVertexAttribPointer
|
---|
| 846 | #define glDisableVertexAttribArray QGLContextPrivate::extensionFuncs(ctx).qt_glDisableVertexAttribArray
|
---|
| 847 | #define glEnableVertexAttribArray QGLContextPrivate::extensionFuncs(ctx).qt_glEnableVertexAttribArray
|
---|
| 848 |
|
---|
[2] | 849 | #else // QT_OPENGL_ES_2
|
---|
| 850 |
|
---|
[561] | 851 | #define glGetProgramBinaryOES QGLContextPrivate::extensionFuncs(ctx).qt_glGetProgramBinaryOES
|
---|
| 852 | #define glProgramBinaryOES QGLContextPrivate::extensionFuncs(ctx).qt_glProgramBinaryOES
|
---|
[2] | 853 |
|
---|
| 854 | #endif // QT_OPENGL_ES_2
|
---|
| 855 |
|
---|
| 856 |
|
---|
[561] | 857 | #if !defined(QT_OPENGL_ES_2)
|
---|
| 858 | #define glStencilOpSeparate QGLContextPrivate::extensionFuncs(ctx).qt_glStencilOpSeparate
|
---|
| 859 | #define glBlendColor QGLContextPrivate::extensionFuncs(ctx).qt_glBlendColor
|
---|
| 860 | #endif
|
---|
[2] | 861 |
|
---|
[561] | 862 | #if defined(QT_OPENGL_ES_2)
|
---|
| 863 | #define glClearDepth glClearDepthf
|
---|
| 864 | #endif
|
---|
[2] | 865 |
|
---|
[846] | 866 | #define glProgramParameteriEXT QGLContextPrivate::extensionFuncs(ctx).qt_glProgramParameteriEXT
|
---|
| 867 | #define glFramebufferTextureEXT QGLContextPrivate::extensionFuncs(ctx).qt_glFramebufferTextureEXT
|
---|
| 868 | #define glFramebufferTextureLayerEXT QGLContextPrivate::extensionFuncs(ctx).qt_glFramebufferTextureLayerEXT
|
---|
| 869 | #define glFramebufferTextureFaceEXT QGLContextPrivate::extensionFuncs(ctx).qt_glFramebufferTextureFaceEXT
|
---|
| 870 |
|
---|
[561] | 871 | #if !defined(QT_OPENGL_ES)
|
---|
| 872 | #define glCompressedTexImage2D QGLContextPrivate::extensionFuncs(ctx).qt_glCompressedTexImage2DARB
|
---|
| 873 | #endif
|
---|
[2] | 874 |
|
---|
[846] | 875 | #ifndef QT_NO_EGL
|
---|
| 876 | // OES_EGL_image
|
---|
| 877 | #define glEGLImageTargetTexture2DOES QGLContextPrivate::extensionFuncs(ctx).qt_glEGLImageTargetTexture2DOES
|
---|
| 878 | #define glEGLImageTargetRenderbufferStorageOES QGLContextPrivate::extensionFuncs(ctx).qt_glEGLImageTargetRenderbufferStorageOES
|
---|
| 879 | #endif
|
---|
| 880 |
|
---|
[2] | 881 | extern bool qt_resolve_framebufferobject_extensions(QGLContext *ctx);
|
---|
| 882 | bool qt_resolve_buffer_extensions(QGLContext *ctx);
|
---|
| 883 |
|
---|
| 884 | bool qt_resolve_version_1_3_functions(QGLContext *ctx);
|
---|
[561] | 885 | bool qt_resolve_version_2_0_functions(QGLContext *ctx);
|
---|
[2] | 886 | bool qt_resolve_stencil_face_extension(QGLContext *ctx);
|
---|
| 887 | bool qt_resolve_frag_program_extensions(QGLContext *ctx);
|
---|
| 888 |
|
---|
| 889 | bool qt_resolve_glsl_extensions(QGLContext *ctx);
|
---|
| 890 |
|
---|
[846] | 891 | #ifndef QT_NO_EGL
|
---|
| 892 | Q_OPENGL_EXPORT bool qt_resolve_eglimage_gl_extensions(QGLContext *ctx);
|
---|
| 893 | #endif
|
---|
| 894 |
|
---|
[2] | 895 | QT_END_NAMESPACE
|
---|
| 896 |
|
---|
| 897 | #endif // QGL_EXTENSIONS_P_H
|
---|