Pyrogenesis  trunk
glext_funcs.h
Go to the documentation of this file.
1 /* Copyright (c) 2013 Wildfire Games
2  *
3  * Permission is hereby granted, free of charge, to any person obtaining
4  * a copy of this software and associated documentation files (the
5  * "Software"), to deal in the Software without restriction, including
6  * without limitation the rights to use, copy, modify, merge, publish,
7  * distribute, sublicense, and/or sell copies of the Software, and to
8  * permit persons to whom the Software is furnished to do so, subject to
9  * the following conditions:
10  *
11  * The above copyright notice and this permission notice shall be included
12  * in all copies or substantial portions of the Software.
13  *
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21  */
22 
23 /*
24  * OpenGL extension function declarations (X macros).
25  */
26 
27 #include "lib/config2.h" // CONFIG2_GLES
28 
29 #if CONFIG2_GLES
30 # include <GLES2/gl2ext.h>
31 #elif OS_MACOSX
32 # include <OpenGL/glext.h>
33 #else
34 # include <GL/glext.h>
35 #endif
36 
37 #if OS_WIN
38 # include <GL/wglext.h>
39 #endif
40 
41 /*
42 
43 FUNC is used for functions that are only extensions.
44 FUNC2 is used for functions that have been promoted to core features.
45 FUNC3 is used for functions that have been promoted to core features
46 but have slightly changed semantics and need to be referred to by their
47 core name instead of extension name.
48 
49 The FUNC2/FUNC3 calls include the version of OpenGL in which the extension was promoted,
50 and the pre- and post-promotion names (e.g. "glBindBufferARB" vs "glBindBuffer").
51 
52 If the GL driver is advertising a sufficiently high version, we load the promoted
53 name; otherwise we use the *ARB name. (The spec says:
54  "GL implementations of such later revisions should continue to export the name
55  strings of promoted extensions in the EXTENSIONS string, and continue to support
56  the ARB-affixed versions of functions and enumerants as a transition aid."
57 but some drivers might be stupid/buggy and fail to do that, so we don't just use
58 the ARB names unconditionally.)
59 
60 The names are made accessible to engine code only via the ARB name, to make it
61 obvious that care must be taken (i.e. by being certain that the extension is
62 actually supported).
63 
64 */
65 
66 #if CONFIG2_GLES
67 
68 // no GLES extensions used yet
69 
70 // some functions that are extensions in GL are core functions in GLES,
71 // so we should use them without the function pointer indirection
72 #define pglActiveTextureARB glActiveTexture
73 #define pglBlendColorEXT glBlendColor
74 #define pglBlendEquationEXT glBlendEquation
75 #define pglClientActiveTextureARB glClientActiveTexture
76 #define pglCompressedTexImage2DARB glCompressedTexImage2D
77 
78 #define pglAttachObjectARB glAttachShader
79 #define pglBindAttribLocationARB glBindAttribLocation
80 #define pglCompileShaderARB glCompileShader
81 #define pglCreateProgramObjectARB glCreateProgram
82 #define pglCreateShaderObjectARB glCreateShader
83 #define pglDeleteProgram glDeleteProgram
84 #define pglDeleteShader glDeleteShader
85 #define pglDisableVertexAttribArrayARB glDisableVertexAttribArray
86 #define pglEnableVertexAttribArrayARB glEnableVertexAttribArray
87 #define pglGetActiveUniformARB glGetActiveUniform
88 #define pglGetProgramiv glGetProgramiv
89 #define pglGetProgramInfoLog glGetProgramInfoLog
90 #define pglGetShaderiv glGetShaderiv
91 #define pglGetShaderInfoLog glGetShaderInfoLog
92 #define pglGetUniformLocationARB glGetUniformLocation
93 #define pglLinkProgramARB glLinkProgram
94 #define pglShaderSourceARB glShaderSource
95 #define pglUniform1fARB glUniform1f
96 #define pglUniform2fARB glUniform2f
97 #define pglUniform3fARB glUniform3f
98 #define pglUniform4fARB glUniform4f
99 #define pglUniform1iARB glUniform1i
100 #define pglUniformMatrix4fvARB glUniformMatrix4fv
101 #define pglUseProgramObjectARB glUseProgram
102 #define pglVertexAttribPointerARB glVertexAttribPointer
103 
104 #define pglBindBufferARB glBindBuffer
105 #define pglBufferDataARB glBufferData
106 #define pglBufferSubDataARB glBufferSubData
107 #define pglDeleteBuffersARB glDeleteBuffers
108 #define pglGenBuffersARB glGenBuffers
109 #define pglMapBufferARB glMapBuffer
110 #define pglUnmapBufferARB glUnmapBuffer
111 
112 #define pglBindFramebufferEXT glBindFramebuffer
113 #define pglCheckFramebufferStatusEXT glCheckFramebufferStatus
114 #define pglDeleteFramebuffersEXT glDeleteFramebuffers
115 #define pglFramebufferTexture2DEXT glFramebufferTexture2D
116 #define pglGenFramebuffersEXT glGenFramebuffers
117 
118 #define GL_DEPTH_ATTACHMENT_EXT GL_DEPTH_ATTACHMENT
119 #define GL_COLOR_ATTACHMENT0_EXT GL_COLOR_ATTACHMENT0
120 #define GL_FRAMEBUFFER_BINDING_EXT GL_FRAMEBUFFER_BINDING
121 #define GL_FRAMEBUFFER_COMPLETE_EXT GL_FRAMEBUFFER_COMPLETE
122 #define GL_FRAMEBUFFER_EXT GL_FRAMEBUFFER
123 
124 #define GL_CLAMP_TO_BORDER GL_CLAMP_TO_EDGE // TODO: should fix code that relies on GL_CLAMP_TO_BORDER
125 
126 typedef GLuint GLhandleARB;
127 
128 #else
129 
130 // were these defined as real functions in gl.h already?
131 
132 // GL_EXT_draw_range_elements / GL1.2:
133 FUNC2(void, glDrawRangeElementsEXT, glDrawRangeElements, "1.2", (GLenum, GLuint, GLuint, GLsizei, GLenum, GLvoid*))
134 
135 // GL_ARB_multitexture / GL1.3:
136 FUNC2(void, glMultiTexCoord2fARB, glMultiTexCoord2f, "1.3", (int, float, float))
137 FUNC2(void, glMultiTexCoord3fARB, glMultiTexCoord3f, "1.3", (int, float, float, float))
138 FUNC2(void, glActiveTextureARB, glActiveTexture, "1.3", (int))
139 FUNC2(void, glClientActiveTextureARB, glClientActiveTexture, "1.3", (int))
140 
141 // GL_EXT_blend_color / GL1.4 (optional in 1.2):
142 FUNC2(void, glBlendColorEXT, glBlendColor, "1.4", (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha))
143 
144 // GL_EXT_blend_minmax / GL1.4 (optional in 1.2):
145 FUNC2(void, glBlendEquationEXT, glBlendEquation, "1.4", (GLenum mode))
146 
147 // GL_ARB_vertex_buffer_object / GL1.5:
148 FUNC2(void, glBindBufferARB, glBindBuffer, "1.5", (int target, GLuint buffer))
149 FUNC2(void, glDeleteBuffersARB, glDeleteBuffers, "1.5", (GLsizei n, const GLuint* buffers))
150 FUNC2(void, glGenBuffersARB, glGenBuffers, "1.5", (GLsizei n, GLuint* buffers))
151 FUNC2(bool, glIsBufferARB, glIsBuffer, "1.5", (GLuint buffer))
152 FUNC2(void, glBufferDataARB, glBufferData, "1.5", (int target, GLsizeiptrARB size, const void* data, int usage))
153 FUNC2(void, glBufferSubDataARB, glBufferSubData, "1.5", (int target, GLintptrARB offset, GLsizeiptrARB size, const void* data))
154 FUNC2(void, glGetBufferSubDataARB, glGetBufferSubData, "1.5", (int target, GLintptrARB offset, GLsizeiptrARB size, void* data))
155 FUNC2(void*, glMapBufferARB, glMapBuffer, "1.5", (int target, int access))
156 FUNC2(bool, glUnmapBufferARB, glUnmapBuffer, "1.5", (int target))
157 FUNC2(void, glGetBufferParameterivARB, glGetBufferParameteriv, "1.5", (int target, int pname, int* params))
158 FUNC2(void, glGetBufferPointervARB, glGetBufferPointerv, "1.5", (int target, int pname, void** params))
159 
160 // GL_ARB_texture_compression / GL1.3
161 FUNC2(void, glCompressedTexImage3DARB, glCompressedTexImage3D, "1.3", (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid*))
162 FUNC2(void, glCompressedTexImage2DARB, glCompressedTexImage2D, "1.3", (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid*))
163 FUNC2(void, glCompressedTexImage1DARB, glCompressedTexImage1D, "1.3", (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid*))
164 FUNC2(void, glCompressedTexSubImage3DARB, glCompressedTexSubImage3D, "1.3", (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid*))
165 FUNC2(void, glCompressedTexSubImage2DARB, glCompressedTexSubImage2D, "1.3", (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid*))
166 FUNC2(void, glCompressedTexSubImage1DARB, glCompressedTexSubImage1D, "1.3", (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid*))
167 FUNC2(void, glGetCompressedTexImageARB, glGetCompressedTexImage, "1.3", (GLenum, GLint, GLvoid*))
168 
169 // GL_EXT_framebuffer_object
170 FUNC(GLboolean, glIsRenderbufferEXT, (GLuint renderbuffer))
171 FUNC(void, glBindRenderbufferEXT, (GLenum target, GLuint renderbuffer))
172 FUNC(void, glDeleteRenderbuffersEXT, (GLsizei n, const GLuint *renderbuffers))
173 FUNC(void, glGenRenderbuffersEXT, (GLsizei n, GLuint *renderbuffers))
174 FUNC(void, glRenderbufferStorageEXT, (GLenum target, GLenum internalformat, GLsizei width, GLsizei height))
175 FUNC(void, glGetRenderbufferParameterivEXT, (GLenum target, GLenum pname, GLint *params))
176 FUNC(GLboolean, glIsFramebufferEXT, (GLuint framebuffer))
177 FUNC(void, glBindFramebufferEXT, (GLenum target, GLuint framebuffer))
178 FUNC(void, glDeleteFramebuffersEXT, (GLsizei n, const GLuint *framebuffers))
179 FUNC(void, glGenFramebuffersEXT, (GLsizei n, GLuint *framebuffers))
180 FUNC(GLenum, glCheckFramebufferStatusEXT, (GLenum target))
181 FUNC(void, glFramebufferTexture1DEXT, (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level))
182 FUNC(void, glFramebufferTexture2DEXT, (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level))
183 FUNC(void, glFramebufferTexture3DEXT, (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset))
184 FUNC(void, glFramebufferRenderbufferEXT, (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer))
185 FUNC(void, glGetFramebufferAttachmentParameterivEXT, (GLenum target, GLenum attachment, GLenum pname, GLint *params))
186 FUNC(void, glGenerateMipmapEXT, (GLenum target))
187 FUNC(void, glBlitFramebufferEXT, (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter))
188 FUNC(void, glDrawBuffers, (GLsizei n, const GLenum *bufs))
189 
190 // GL_ARB_vertex_program, GL_ARB_fragment_program
191 FUNC(void, glProgramStringARB, (GLenum target, GLenum format, GLsizei len, const GLvoid *string))
192 FUNC(void, glBindProgramARB, (GLenum target, GLuint program))
193 FUNC(void, glDeleteProgramsARB, (GLsizei n, const GLuint *programs))
194 FUNC(void, glGenProgramsARB, (GLsizei n, GLuint *programs))
195 FUNC(void, glProgramEnvParameter4dARB, (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w))
196 FUNC(void, glProgramEnvParameter4dvARB, (GLenum target, GLuint index, const GLdouble *params))
197 FUNC(void, glProgramEnvParameter4fARB, (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w))
198 FUNC(void, glProgramEnvParameter4fvARB, (GLenum target, GLuint index, const GLfloat *params))
199 FUNC(void, glProgramLocalParameter4dARB, (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w))
200 FUNC(void, glProgramLocalParameter4dvARB, (GLenum target, GLuint index, const GLdouble *params))
201 FUNC(void, glProgramLocalParameter4fARB, (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w))
202 FUNC(void, glProgramLocalParameter4fvARB, (GLenum target, GLuint index, const GLfloat *params))
203 FUNC(void, glGetProgramEnvParameterdvARB, (GLenum target, GLuint index, GLdouble *params))
204 FUNC(void, glGetProgramEnvParameterfvARB, (GLenum target, GLuint index, GLfloat *params))
205 FUNC(void, glGetProgramLocalParameterdvARB, (GLenum target, GLuint index, GLdouble *params))
206 FUNC(void, glGetProgramLocalParameterfvARB, (GLenum target, GLuint index, GLfloat *params))
207 FUNC(void, glGetProgramivARB, (GLenum target, GLenum pname, GLint *params))
208 FUNC(void, glGetProgramStringARB, (GLenum target, GLenum pname, GLvoid *string))
209 FUNC(GLboolean, glIsProgramARB, (GLuint program))
210 
211 // GL_ARB_shader_objects
212 // (NOTE: Many of these have "Object" in their ARB names, but "Program" or "Shader" in their core names.
213 // When both Program and Shader versions exist, we use FUNC3 here and the engine must call the specific
214 // core name instead of the generic ARB name.)
215 FUNC3(void, glDeleteObjectARB, glDeleteShader, "2.0", (GLhandleARB obj))
216 FUNC3(void, glDeleteObjectARB, glDeleteProgram, "2.0", (GLhandleARB obj))
217 // FUNC2(GLhandleARB, glGetHandleARB, glGetHandle, "2.0", (GLenum pname))
218  // there is no analog to the ARB function in GL 2.0 (the functionality is probably moved into glGetIntegerv(GL_CURRENT_PROGRAM))
219  // so we can't represent it in this FUNC2 system, so just pretend it doesn't exist
220 FUNC2(void, glDetachObjectARB, glDetachShader, "2.0", (GLhandleARB containerObj, GLhandleARB attachedObj))
221 FUNC2(GLhandleARB, glCreateShaderObjectARB, glCreateShader, "2.0", (GLenum shaderType))
222 FUNC2(void, glShaderSourceARB, glShaderSource, "2.0", (GLhandleARB shaderObj, GLsizei count, const char **string, const GLint *length))
223 FUNC2(void, glCompileShaderARB, glCompileShader, "2.0", (GLhandleARB shaderObj))
224 FUNC2(GLhandleARB, glCreateProgramObjectARB, glCreateProgram, "2.0", (void))
225 FUNC2(void, glAttachObjectARB, glAttachShader, "2.0", (GLhandleARB containerObj, GLhandleARB obj))
226 FUNC2(void, glLinkProgramARB, glLinkProgram, "2.0", (GLhandleARB programObj))
227 FUNC2(void, glUseProgramObjectARB, glUseProgram, "2.0", (GLhandleARB programObj))
228 FUNC2(void, glValidateProgramARB, glValidateProgram, "2.0", (GLhandleARB programObj))
229 FUNC2(void, glUniform1fARB, glUniform1f, "2.0", (GLint location, GLfloat v0))
230 FUNC2(void, glUniform2fARB, glUniform2f, "2.0", (GLint location, GLfloat v0, GLfloat v1))
231 FUNC2(void, glUniform3fARB, glUniform3f, "2.0", (GLint location, GLfloat v0, GLfloat v1, GLfloat v2))
232 FUNC2(void, glUniform4fARB, glUniform4f, "2.0", (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3))
233 FUNC2(void, glUniform1iARB, glUniform1i, "2.0", (GLint location, GLint v0))
234 FUNC2(void, glUniform2iARB, glUniform2i, "2.0", (GLint location, GLint v0, GLint v1))
235 FUNC2(void, glUniform3iARB, glUniform3i, "2.0", (GLint location, GLint v0, GLint v1, GLint v2))
236 FUNC2(void, glUniform4iARB, glUniform4i, "2.0", (GLint location, GLint v0, GLint v1, GLint v2, GLint v3))
237 FUNC2(void, glUniform1fvARB, glUniform1fv, "2.0", (GLint location, GLsizei count, const GLfloat *value))
238 FUNC2(void, glUniform2fvARB, glUniform2fv, "2.0", (GLint location, GLsizei count, const GLfloat *value))
239 FUNC2(void, glUniform3fvARB, glUniform3fv, "2.0", (GLint location, GLsizei count, const GLfloat *value))
240 FUNC2(void, glUniform4fvARB, glUniform4fv, "2.0", (GLint location, GLsizei count, const GLfloat *value))
241 FUNC2(void, glUniform1ivARB, glUniform1iv, "2.0", (GLint location, GLsizei count, const GLint *value))
242 FUNC2(void, glUniform2ivARB, glUniform2iv, "2.0", (GLint location, GLsizei count, const GLint *value))
243 FUNC2(void, glUniform3ivARB, glUniform3iv, "2.0", (GLint location, GLsizei count, const GLint *value))
244 FUNC2(void, glUniform4ivARB, glUniform4iv, "2.0", (GLint location, GLsizei count, const GLint *value))
245 FUNC2(void, glUniformMatrix2fvARB, glUniformMatrix2fv, "2.0", (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value))
246 FUNC2(void, glUniformMatrix3fvARB, glUniformMatrix3fv, "2.0", (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value))
247 FUNC2(void, glUniformMatrix4fvARB, glUniformMatrix4fv, "2.0", (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value))
248 FUNC3(void, glGetObjectParameterfvARB, glGetProgramfv, "2.0", (GLhandleARB obj, GLenum pname, GLfloat *params))
249 FUNC3(void, glGetObjectParameterfvARB, glGetShaderfv, "2.0", (GLhandleARB obj, GLenum pname, GLfloat *params))
250 FUNC3(void, glGetObjectParameterivARB, glGetProgramiv, "2.0", (GLhandleARB obj, GLenum pname, GLint *params))
251 FUNC3(void, glGetObjectParameterivARB, glGetShaderiv, "2.0", (GLhandleARB obj, GLenum pname, GLint *params))
252 FUNC3(void, glGetInfoLogARB, glGetProgramInfoLog, "2.0", (GLhandleARB obj, GLsizei maxLength, GLsizei *length, char *infoLog))
253 FUNC3(void, glGetInfoLogARB, glGetShaderInfoLog, "2.0", (GLhandleARB obj, GLsizei maxLength, GLsizei *length, char *infoLog))
254 FUNC2(void, glGetAttachedObjectsARB, glGetAttachedShaders, "2.0", (GLhandleARB containerObj, GLsizei maxCount, GLsizei *count, GLhandleARB *obj))
255 FUNC2(GLint, glGetUniformLocationARB, glGetUniformLocation, "2.0", (GLhandleARB programObj, const char *name))
256 FUNC2(void, glGetActiveUniformARB, glGetActiveUniform, "2.0", (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, char *name))
257 FUNC2(void, glGetUniformfvARB, glGetUniformfv, "2.0", (GLhandleARB programObj, GLint location, GLfloat *params))
258 FUNC2(void, glGetUniformivARB, glGetUniformiv, "2.0", (GLhandleARB programObj, GLint location, GLint *params))
259 FUNC2(void, glGetShaderSourceARB, glGetShaderSource, "2.0", (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source))
260 
261 // GL_ARB_vertex_shader
262 FUNC2(void, glVertexAttrib1fARB, glVertexAttrib1f, "2.0", (GLuint index, GLfloat v0))
263 FUNC2(void, glVertexAttrib1sARB, glVertexAttrib1s, "2.0", (GLuint index, GLshort v0))
264 FUNC2(void, glVertexAttrib1dARB, glVertexAttrib1d, "2.0", (GLuint index, GLdouble v0))
265 FUNC2(void, glVertexAttrib2fARB, glVertexAttrib2f, "2.0", (GLuint index, GLfloat v0, GLfloat v1))
266 FUNC2(void, glVertexAttrib2sARB, glVertexAttrib2s, "2.0", (GLuint index, GLshort v0, GLshort v1))
267 FUNC2(void, glVertexAttrib2dARB, glVertexAttrib2d, "2.0", (GLuint index, GLdouble v0, GLdouble v1))
268 FUNC2(void, glVertexAttrib3fARB, glVertexAttrib3f, "2.0", (GLuint index, GLfloat v0, GLfloat v1, GLfloat v2))
269 FUNC2(void, glVertexAttrib3sARB, glVertexAttrib3s, "2.0", (GLuint index, GLshort v0, GLshort v1, GLshort v2))
270 FUNC2(void, glVertexAttrib3dARB, glVertexAttrib3d, "2.0", (GLuint index, GLdouble v0, GLdouble v1, GLdouble v2))
271 FUNC2(void, glVertexAttrib4fARB, glVertexAttrib4f, "2.0", (GLuint index, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3))
272 FUNC2(void, glVertexAttrib4sARB, glVertexAttrib4s, "2.0", (GLuint index, GLshort v0, GLshort v1, GLshort v2, GLshort v3))
273 FUNC2(void, glVertexAttrib4dARB, glVertexAttrib4d, "2.0", (GLuint index, GLdouble v0, GLdouble v1, GLdouble v2, GLdouble v3))
274 FUNC2(void, glVertexAttrib4NubARB, glVertexAttrib4Nub, "2.0", (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w))
275 FUNC2(void, glVertexAttrib1fvARB, glVertexAttrib1fv, "2.0", (GLuint index, const GLfloat *v))
276 FUNC2(void, glVertexAttrib1svARB, glVertexAttrib1sv, "2.0", (GLuint index, const GLshort *v))
277 FUNC2(void, glVertexAttrib1dvARB, glVertexAttrib1dv, "2.0", (GLuint index, const GLdouble *v))
278 FUNC2(void, glVertexAttrib2fvARB, glVertexAttrib2fv, "2.0", (GLuint index, const GLfloat *v))
279 FUNC2(void, glVertexAttrib2svARB, glVertexAttrib2sv, "2.0", (GLuint index, const GLshort *v))
280 FUNC2(void, glVertexAttrib2dvARB, glVertexAttrib2dv, "2.0", (GLuint index, const GLdouble *v))
281 FUNC2(void, glVertexAttrib3fvARB, glVertexAttrib3fv, "2.0", (GLuint index, const GLfloat *v))
282 FUNC2(void, glVertexAttrib3svARB, glVertexAttrib3sv, "2.0", (GLuint index, const GLshort *v))
283 FUNC2(void, glVertexAttrib3dvARB, glVertexAttrib3dv, "2.0", (GLuint index, const GLdouble *v))
284 FUNC2(void, glVertexAttrib4fvARB, glVertexAttrib4fv, "2.0", (GLuint index, const GLfloat *v))
285 FUNC2(void, glVertexAttrib4svARB, glVertexAttrib4sv, "2.0", (GLuint index, const GLshort *v))
286 FUNC2(void, glVertexAttrib4dvARB, glVertexAttrib4dv, "2.0", (GLuint index, const GLdouble *v))
287 FUNC2(void, glVertexAttrib4ivARB, glVertexAttrib4iv, "2.0", (GLuint index, const GLint *v))
288 FUNC2(void, glVertexAttrib4bvARB, glVertexAttrib4bv, "2.0", (GLuint index, const GLbyte *v))
289 FUNC2(void, glVertexAttrib4ubvARB, glVertexAttrib4ubv, "2.0", (GLuint index, const GLubyte *v))
290 FUNC2(void, glVertexAttrib4usvARB, glVertexAttrib4usv, "2.0", (GLuint index, const GLushort *v))
291 FUNC2(void, glVertexAttrib4uivARB, glVertexAttrib4uiv, "2.0", (GLuint index, const GLuint *v))
292 FUNC2(void, glVertexAttrib4NbvARB, glVertexAttrib4Nbv, "2.0", (GLuint index, const GLbyte *v))
293 FUNC2(void, glVertexAttrib4NsvARB, glVertexAttrib4Nsv, "2.0", (GLuint index, const GLshort *v))
294 FUNC2(void, glVertexAttrib4NivARB, glVertexAttrib4Niv, "2.0", (GLuint index, const GLint *v))
295 FUNC2(void, glVertexAttrib4NubvARB, glVertexAttrib4Nubv, "2.0", (GLuint index, const GLubyte *v))
296 FUNC2(void, glVertexAttrib4NusvARB, glVertexAttrib4Nusv, "2.0", (GLuint index, const GLushort *v))
297 FUNC2(void, glVertexAttrib4NuivARB, glVertexAttrib4Nuiv, "2.0", (GLuint index, const GLuint *v))
298 FUNC2(void, glVertexAttribPointerARB, glVertexAttribPointer, "2.0", (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer))
299 FUNC2(void, glEnableVertexAttribArrayARB, glEnableVertexAttribArray, "2.0", (GLuint index))
300 FUNC2(void, glDisableVertexAttribArrayARB, glDisableVertexAttribArray, "2.0", (GLuint index))
301 FUNC2(void, glBindAttribLocationARB, glBindAttribLocation, "2.0", (GLhandleARB programObj, GLuint index, const char *name))
302 FUNC2(void, glGetActiveAttribARB, glGetActiveAttrib, "2.0", (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, int *size, GLenum *type, char *name))
303 FUNC2(GLint, glGetAttribLocationARB, glGetAttribLocation, "2.0", (GLhandleARB programObj, const char *name))
304 FUNC2(void, glGetVertexAttribdvARB, glGetVertexAttribdv, "2.0", (GLuint index, GLenum pname, GLdouble *params))
305 FUNC2(void, glGetVertexAttribfvARB, glGetVertexAttribfv, "2.0", (GLuint index, GLenum pname, GLfloat *params))
306 FUNC2(void, glGetVertexAttribivARB, glGetVertexAttribiv, "2.0", (GLuint index, GLenum pname, GLint *params))
307 FUNC2(void, glGetVertexAttribPointervARB, glGetVertexAttribPointerv, "2.0", (GLuint index, GLenum pname, void **pointer))
308 
309 // GL_EXT_gpu_shader4 / GL3.0:
310 FUNC2(void, glVertexAttribI1iEXT, glVertexAttribI1i, "3.0", (GLuint index, GLint x))
311 FUNC2(void, glVertexAttribI2iEXT, glVertexAttribI2i, "3.0", (GLuint index, GLint x, GLint y))
312 FUNC2(void, glVertexAttribI3iEXT, glVertexAttribI3i, "3.0", (GLuint index, GLint x, GLint y, GLint z))
313 FUNC2(void, glVertexAttribI4iEXT, glVertexAttribI4i, "3.0", (GLuint index, GLint x, GLint y, GLint z, GLint w))
314 FUNC2(void, glVertexAttribI1uiEXT, glVertexAttribI1ui, "3.0", (GLuint index, GLuint x))
315 FUNC2(void, glVertexAttribI2uiEXT, glVertexAttribI2ui, "3.0", (GLuint index, GLuint x, GLuint y))
316 FUNC2(void, glVertexAttribI3uiEXT, glVertexAttribI3ui, "3.0", (GLuint index, GLuint x, GLuint y, GLuint z))
317 FUNC2(void, glVertexAttribI4uiEXT, glVertexAttribI4ui, "3.0", (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w))
318 FUNC2(void, glVertexAttribI1ivEXT, glVertexAttribI1iv, "3.0", (GLuint index, const GLint *v))
319 FUNC2(void, glVertexAttribI2ivEXT, glVertexAttribI2iv, "3.0", (GLuint index, const GLint *v))
320 FUNC2(void, glVertexAttribI3ivEXT, glVertexAttribI3iv, "3.0", (GLuint index, const GLint *v))
321 FUNC2(void, glVertexAttribI4ivEXT, glVertexAttribI4iv, "3.0", (GLuint index, const GLint *v))
322 FUNC2(void, glVertexAttribI1uivEXT, glVertexAttribI1uiv, "3.0", (GLuint index, const GLuint *v))
323 FUNC2(void, glVertexAttribI2uivEXT, glVertexAttribI2uiv, "3.0", (GLuint index, const GLuint *v))
324 FUNC2(void, glVertexAttribI3uivEXT, glVertexAttribI3uiv, "3.0", (GLuint index, const GLuint *v))
325 FUNC2(void, glVertexAttribI4uivEXT, glVertexAttribI4uiv, "3.0", (GLuint index, const GLuint *v))
326 FUNC2(void, glVertexAttribI4bvEXT, glVertexAttribI4bv, "3.0", (GLuint index, const GLbyte *v))
327 FUNC2(void, glVertexAttribI4svEXT, glVertexAttribI4sv, "3.0", (GLuint index, const GLshort *v))
328 FUNC2(void, glVertexAttribI4ubvEXT, glVertexAttribI4ubv, "3.0", (GLuint index, const GLubyte *v))
329 FUNC2(void, glVertexAttribI4usvEXT, glVertexAttribI4usv, "3.0", (GLuint index, const GLushort *v))
330 FUNC2(void, glVertexAttribIPointerEXT, glVertexAttribIPointer, "3.0", (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer))
331 FUNC2(void, glGetVertexAttribIivEXT, glGetVertexAttribIiv, "3.0", (GLuint index, GLenum pname, GLint *params))
332 FUNC2(void, glGetVertexAttribIuivEXT, glGetVertexAttribIuiv, "3.0", (GLuint index, GLenum pname, GLuint *params))
333 FUNC2(void, glUniform1uiEXT, glUniform1ui, "3.0", (GLint location, GLuint v0))
334 FUNC2(void, glUniform2uiEXT, glUniform2ui, "3.0", (GLint location, GLuint v0, GLuint v1))
335 FUNC2(void, glUniform3uiEXT, glUniform3ui, "3.0", (GLint location, GLuint v0, GLuint v1, GLuint v2))
336 FUNC2(void, glUniform4uiEXT, glUniform4ui, "3.0", (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3))
337 FUNC2(void, glUniform1uivEXT, glUniform1uiv, "3.0", (GLint location, GLsizei count, const GLuint *value))
338 FUNC2(void, glUniform2uivEXT, glUniform2uiv, "3.0", (GLint location, GLsizei count, const GLuint *value))
339 FUNC2(void, glUniform3uivEXT, glUniform3uiv, "3.0", (GLint location, GLsizei count, const GLuint *value))
340 FUNC2(void, glUniform4uivEXT, glUniform4uiv, "3.0", (GLint location, GLsizei count, const GLuint *value))
341 FUNC2(void, glGetUniformuivEXT, glGetUniformuiv, "3.0", (GLuint program, GLint location, GLuint *params))
342 FUNC2(void, glBindFragDataLocationEXT, glBindFragDataLocation, "3.0", (GLuint program, GLuint colorNumber, const char *name))
343 FUNC2(GLint, glGetFragDataLocationEXT, glGetFragDataLocation, "3.0", (GLuint program, const char *name))
344 
345 // GL_ARB_occlusion_query / GL1.5:
346 FUNC2(void, glGenQueriesARB, glGenQueries, "1.5", (GLsizei n, GLuint *ids))
347 FUNC2(void, glDeleteQueriesARB, glDeleteQueries, "1.5", (GLsizei n, const GLuint *ids))
348 FUNC2(GLboolean, glIsQueryARB, glIsQuery, "1.5", (GLuint id))
349 FUNC2(void, glBeginQueryARB, glBeginQuery, "1.5", (GLenum target, GLuint id))
350 FUNC2(void, glEndQueryARB, glEndQuery, "1.5", (GLenum target))
351 FUNC2(void, glGetQueryivARB, glGetQueryiv, "1.5", (GLenum target, GLenum pname, GLint *params))
352 FUNC2(void, glGetQueryObjectivARB, glGetQueryObjectiv, "1.5", (GLuint id, GLenum pname, GLint *params))
353 FUNC2(void, glGetQueryObjectuivARB, glGetQueryObjectuiv, "1.5", (GLuint id, GLenum pname, GLuint *params))
354 
355 // GL_ARB_sync / GL3.2:
356 FUNC2(void, glGetInteger64v, glGetInteger64v, "3.2", (GLenum pname, GLint64 *params))
357 
358 // GL_EXT_timer_query:
359 FUNC(void, glGetQueryObjecti64vEXT, (GLuint id, GLenum pname, GLint64 *params))
360 FUNC(void, glGetQueryObjectui64vEXT, (GLuint id, GLenum pname, GLuint64 *params))
361 
362 // GL_ARB_timer_query / GL3.3:
363 FUNC2(void, glQueryCounter, glQueryCounter, "3.3", (GLuint id, GLenum target))
364 FUNC2(void, glGetQueryObjecti64v, glGetQueryObjecti64v, "3.3", (GLuint id, GLenum pname, GLint64 *params))
365 FUNC2(void, glGetQueryObjectui64v, glGetQueryObjectui64v, "3.3", (GLuint id, GLenum pname, GLuint64 *params))
366 
367 // GL_ARB_map_buffer_range / GL3.0:
368 FUNC2(void*, glMapBufferRange, glMapBufferRange, "3.0", (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access))
369 FUNC2(void, glFlushMappedBufferRange, glFlushMappedBufferRange, "3.0", (GLenum target, GLintptr offset, GLsizeiptr length))
370 
371 // GL_GREMEDY_string_marker (from gDEBugger)
372 FUNC(int, glStringMarkerGREMEDY, (GLsizei len, const GLvoid *string))
373 
374 // GL_INTEL_performance_queries (undocumented, may be unstable, use at own risk;
375 // see http://zaynar.co.uk/docs/gl-intel-performance-queries.html)
376 FUNC(void, glGetFirstPerfQueryIdINTEL, (GLuint *queryId))
377 FUNC(void, glGetNextPerfQueryIdINTEL, (GLuint prevQueryId, GLuint *queryId))
378 FUNC(void, glGetPerfQueryInfoINTEL, (GLuint queryId, GLuint nameMaxLength, char *name, GLuint *counterBufferSize, GLuint *numCounters, GLuint *maxQueries, GLuint *))
379 FUNC(void, glGetPerfCounterInfoINTEL, (GLuint queryId, GLuint counterId, GLuint nameMaxLength, char *name, GLuint descMaxLength, char *desc, GLuint *offset, GLuint *size, GLuint *usage, GLuint *type, GLuint64 *))
380 FUNC(void, glCreatePerfQueryINTEL, (GLuint queryId, GLuint *id))
381 FUNC(void, glBeginPerfQueryINTEL, (GLuint id))
382 FUNC(void, glEndPerfQueryINTEL, (GLuint id))
383 FUNC(void, glDeletePerfQueryINTEL, (GLuint id))
384 FUNC(void, glGetPerfQueryDataINTEL, (GLuint id, GLenum requestType, GLuint maxLength, char *buffer, GLuint *length))
385 
386 #endif // #if CONFIG_GLES2
387 
388 
389 #if OS_WIN
390 // WGL_EXT_swap_control
391 FUNC(int, wglSwapIntervalEXT, (int))
392 
393 // WGL_ARB_pbuffer
394 FUNC(HPBUFFERARB, wglCreatePbufferARB, (HDC, int, int, int, const int*))
395 FUNC(HDC, wglGetPbufferDCARB, (HPBUFFERARB))
396 FUNC(int, wglReleasePbufferDCARB, (HPBUFFERARB, HDC))
397 FUNC(int, wglDestroyPbufferARB, (HPBUFFERARB))
398 FUNC(int, wglQueryPbufferARB, (HPBUFFERARB, int, int*))
399 
400 // GL_ARB_pixel_format
401 FUNC(int, wglGetPixelFormatAttribivARB, (HDC, int, int, unsigned int, const int*, int*))
402 FUNC(int, wglGetPixelFormatAttribfvARB, (HDC, int, int, unsigned int, const int*, float*))
403 FUNC(int, wglChoosePixelFormatARB, (HDC, const int *, const float*, unsigned int, int*, unsigned int*))
404 #endif // OS_WIN
405 
406 
407 // GLX_MESA_query_renderer
408 FUNC(int /*Bool*/, glXQueryRendererIntegerMESA, (void /*Display*/ *dpy, int screen, int renderer, int attribute, unsigned int *value))
409 FUNC(int /*Bool*/, glXQueryCurrentRendererIntegerMESA, (int attribute, unsigned int *value))
410 FUNC(const char *, glXQueryRendererStringMESA, (void /*Display*/ *dpy, int screen, int renderer, int attribute))
411 FUNC(const char *, glXQueryCurrentRendererStringMESA, (int attribute))
int64_t GLint64
Definition: ogl.h:120
#define FUNC3(ret, nameARB, nameCore, version, params)
Definition: ogl.cpp:53
uint64_t GLuint64
Definition: ogl.h:121
#define FUNC(ret, name, params)
Definition: dbghelp.h:143
void format(BasicFormatter< Char > &f, const Char *format_str, const T &value)
Definition: format.h:1705
#define FUNC2(ret, nameARB, nameCore, version, params)
Definition: ogl.cpp:52