2 * Copyright (c) 2012 Carsten Munk <carsten.munk@gmail.com>
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 #define GL_GLEXT_PROTOTYPES
19 #include <GLES2/gl2.h>
20 #include <GLES2/gl2ext.h>
25 #include <hybris/internal/binding.h>
26 #include <hybris/internal/floating_point_abi.h>
28 static void *_libglesv2
= NULL
;
30 static void (*_glActiveTexture
)(GLenum texture
) = NULL
;
31 static void (*_glAttachShader
)(GLuint program
, GLuint shader
) = NULL
;
32 static void (*_glBindAttribLocation
)(GLuint program
, GLuint index
, const GLchar
* name
) = NULL
;
33 static void (*_glBindBuffer
)(GLenum target
, GLuint buffer
) = NULL
;
34 static void (*_glBindFramebuffer
)(GLenum target
, GLuint framebuffer
) = NULL
;
35 static void (*_glBindRenderbuffer
)(GLenum target
, GLuint renderbuffer
) = NULL
;
36 static void (*_glBindTexture
)(GLenum target
, GLuint texture
) = NULL
;
37 static void (*_glBlendColor
)(GLclampf red
, GLclampf green
, GLclampf blue
, GLclampf alpha
) FP_ATTRIB
= NULL
;
38 static void (*_glBlendEquation
)(GLenum mode
) = NULL
;
39 static void (*_glBlendEquationSeparate
)(GLenum modeRGB
, GLenum modeAlpha
) = NULL
;
40 static void (*_glBlendFunc
)(GLenum sfactor
, GLenum dfactor
) = NULL
;
41 static void (*_glBlendFuncSeparate
)(GLenum srcRGB
, GLenum dstRGB
, GLenum srcAlpha
, GLenum dstAlpha
) = NULL
;
42 static void (*_glBufferData
)(GLenum target
, GLsizeiptr size
, const GLvoid
* data
, GLenum usage
) = NULL
;
43 static void (*_glBufferSubData
)(GLenum target
, GLintptr offset
, GLsizeiptr size
, const GLvoid
* data
) = NULL
;
44 static GLenum (*_glCheckFramebufferStatus
)(GLenum target
) = NULL
;
45 static void (*_glClear
)(GLbitfield mask
) = NULL
;
46 static void (*_glClearColor
)(GLclampf red
, GLclampf green
, GLclampf blue
, GLclampf alpha
) FP_ATTRIB
= NULL
;
47 static void (*_glClearDepthf
)(GLclampf depth
) FP_ATTRIB
= NULL
;
48 static void (*_glClearStencil
)(GLint s
) = NULL
;
49 static void (*_glColorMask
)(GLboolean red
, GLboolean green
, GLboolean blue
, GLboolean alpha
) = NULL
;
50 static void (*_glCompileShader
)(GLuint shader
) = NULL
;
51 static void (*_glCompressedTexImage2D
)(GLenum target
, GLint level
, GLenum internalformat
, GLsizei width
, GLsizei height
, GLint border
, GLsizei imageSize
, const GLvoid
* data
) = NULL
;
52 static void (*_glCompressedTexSubImage2D
)(GLenum target
, GLint level
, GLint xoffset
, GLint yoffset
, GLsizei width
, GLsizei height
, GLenum format
, GLsizei imageSize
, const GLvoid
* data
) = NULL
;
53 static void (*_glCopyTexImage2D
)(GLenum target
, GLint level
, GLenum internalformat
, GLint x
, GLint y
, GLsizei width
, GLsizei height
, GLint border
) = NULL
;
54 static void (*_glCopyTexSubImage2D
)(GLenum target
, GLint level
, GLint xoffset
, GLint yoffset
, GLint x
, GLint y
, GLsizei width
, GLsizei height
) = NULL
;
55 static GLuint (*_glCreateProgram
)(void) = NULL
;
56 static GLuint (*_glCreateShader
)(GLenum type
) = NULL
;
57 static void (*_glCullFace
)(GLenum mode
) = NULL
;
58 static void (*_glDeleteBuffers
)(GLsizei n
, const GLuint
* buffers
) = NULL
;
59 static void (*_glDeleteFramebuffers
)(GLsizei n
, const GLuint
* framebuffers
) = NULL
;
60 static void (*_glDeleteProgram
)(GLuint program
) = NULL
;
61 static void (*_glDeleteRenderbuffers
)(GLsizei n
, const GLuint
* renderbuffers
) = NULL
;
62 static void (*_glDeleteShader
)(GLuint shader
) = NULL
;
63 static void (*_glDeleteTextures
)(GLsizei n
, const GLuint
* textures
) = NULL
;
64 static void (*_glDepthFunc
)(GLenum func
) = NULL
;
65 static void (*_glDepthMask
)(GLboolean flag
) = NULL
;
66 static void (*_glDepthRangef
)(GLclampf zNear
, GLclampf zFar
) FP_ATTRIB
= NULL
;
67 static void (*_glDetachShader
)(GLuint program
, GLuint shader
) = NULL
;
68 static void (*_glDisable
)(GLenum cap
) = NULL
;
69 static void (*_glDisableVertexAttribArray
)(GLuint index
) = NULL
;
70 static void (*_glDrawArrays
)(GLenum mode
, GLint first
, GLsizei count
) = NULL
;
71 static void (*_glDrawElements
)(GLenum mode
, GLsizei count
, GLenum type
, const GLvoid
* indices
) = NULL
;
72 static void (*_glEnable
)(GLenum cap
) = NULL
;
73 static void (*_glEnableVertexAttribArray
)(GLuint index
) = NULL
;
74 static void (*_glFinish
)(void) = NULL
;
75 static void (*_glFlush
)(void) = NULL
;
76 static void (*_glFramebufferRenderbuffer
)(GLenum target
, GLenum attachment
, GLenum renderbuffertarget
, GLuint renderbuffer
) = NULL
;
77 static void (*_glFramebufferTexture2D
)(GLenum target
, GLenum attachment
, GLenum textarget
, GLuint texture
, GLint level
) = NULL
;
78 static void (*_glFrontFace
)(GLenum mode
) = NULL
;
79 static void (*_glGenBuffers
)(GLsizei n
, GLuint
* buffers
) = NULL
;
80 static void (*_glGenerateMipmap
)(GLenum target
) = NULL
;
81 static void (*_glGenFramebuffers
)(GLsizei n
, GLuint
* framebuffers
) = NULL
;
82 static void (*_glGenRenderbuffers
)(GLsizei n
, GLuint
* renderbuffers
) = NULL
;
83 static void (*_glGenTextures
)(GLsizei n
, GLuint
* textures
) = NULL
;
84 static void (*_glGetActiveAttrib
)(GLuint program
, GLuint index
, GLsizei bufsize
, GLsizei
* length
, GLint
* size
, GLenum
* type
, GLchar
* name
) = NULL
;
85 static void (*_glGetActiveUniform
)(GLuint program
, GLuint index
, GLsizei bufsize
, GLsizei
* length
, GLint
* size
, GLenum
* type
, GLchar
* name
) = NULL
;
86 static void (*_glGetAttachedShaders
)(GLuint program
, GLsizei maxcount
, GLsizei
* count
, GLuint
* shaders
) = NULL
;
87 static int (*_glGetAttribLocation
)(GLuint program
, const GLchar
* name
) = NULL
;
88 static void (*_glGetBooleanv
)(GLenum pname
, GLboolean
* params
) = NULL
;
89 static void (*_glGetBufferParameteriv
)(GLenum target
, GLenum pname
, GLint
* params
) = NULL
;
90 static GLenum (*_glGetError
)(void) = NULL
;
91 static void (*_glGetFloatv
)(GLenum pname
, GLfloat
* params
) = NULL
;
92 static void (*_glGetFramebufferAttachmentParameteriv
)(GLenum target
, GLenum attachment
, GLenum pname
, GLint
* params
) = NULL
;
93 static void (*_glGetIntegerv
)(GLenum pname
, GLint
* params
) = NULL
;
94 static void (*_glGetProgramiv
)(GLuint program
, GLenum pname
, GLint
* params
) = NULL
;
95 static void (*_glGetProgramInfoLog
)(GLuint program
, GLsizei bufsize
, GLsizei
* length
, GLchar
* infolog
) = NULL
;
96 static void (*_glGetRenderbufferParameteriv
)(GLenum target
, GLenum pname
, GLint
* params
) = NULL
;
97 static void (*_glGetShaderiv
)(GLuint shader
, GLenum pname
, GLint
* params
) = NULL
;
98 static void (*_glGetShaderInfoLog
)(GLuint shader
, GLsizei bufsize
, GLsizei
* length
, GLchar
* infolog
) = NULL
;
99 static void (*_glGetShaderPrecisionFormat
)(GLenum shadertype
, GLenum precisiontype
, GLint
* range
, GLint
* precision
) = NULL
;
100 static void (*_glGetShaderSource
)(GLuint shader
, GLsizei bufsize
, GLsizei
* length
, GLchar
* source
) = NULL
;
101 static const GLubyte
* (*_glGetString
)(GLenum name
) = NULL
;
102 static void (*_glGetTexParameterfv
)(GLenum target
, GLenum pname
, GLfloat
* params
) = NULL
;
103 static void (*_glGetTexParameteriv
)(GLenum target
, GLenum pname
, GLint
* params
) = NULL
;
104 static void (*_glGetUniformfv
)(GLuint program
, GLint location
, GLfloat
* params
) = NULL
;
105 static void (*_glGetUniformiv
)(GLuint program
, GLint location
, GLint
* params
) = NULL
;
106 static int (*_glGetUniformLocation
)(GLuint program
, const GLchar
* name
) = NULL
;
107 static void (*_glGetVertexAttribfv
)(GLuint index
, GLenum pname
, GLfloat
* params
) = NULL
;
108 static void (*_glGetVertexAttribiv
)(GLuint index
, GLenum pname
, GLint
* params
) = NULL
;
109 static void (*_glGetVertexAttribPointerv
)(GLuint index
, GLenum pname
, GLvoid
** pointer
) = NULL
;
110 static void (*_glHint
)(GLenum target
, GLenum mode
) = NULL
;
111 static GLboolean (*_glIsBuffer
)(GLuint buffer
) = NULL
;
112 static GLboolean (*_glIsEnabled
)(GLenum cap
) = NULL
;
113 static GLboolean (*_glIsFramebuffer
)(GLuint framebuffer
) = NULL
;
114 static GLboolean (*_glIsProgram
)(GLuint program
) = NULL
;
115 static GLboolean (*_glIsRenderbuffer
)(GLuint renderbuffer
) = NULL
;
116 static GLboolean (*_glIsShader
)(GLuint shader
) = NULL
;
117 static GLboolean (*_glIsTexture
)(GLuint texture
) = NULL
;
118 static void (*_glLineWidth
)(GLfloat width
) FP_ATTRIB
= NULL
;
119 static void (*_glLinkProgram
)(GLuint program
) = NULL
;
120 static void (*_glPixelStorei
)(GLenum pname
, GLint param
) = NULL
;
121 static void (*_glPolygonOffset
)(GLfloat factor
, GLfloat units
) FP_ATTRIB
= NULL
;
122 static void (*_glReadPixels
)(GLint x
, GLint y
, GLsizei width
, GLsizei height
, GLenum format
, GLenum type
, GLvoid
* pixels
) = NULL
;
123 static void (*_glReleaseShaderCompiler
)(void) = NULL
;
124 static void (*_glRenderbufferStorage
)(GLenum target
, GLenum internalformat
, GLsizei width
, GLsizei height
) = NULL
;
125 static void (*_glSampleCoverage
)(GLclampf value
, GLboolean invert
) FP_ATTRIB
= NULL
;
126 static void (*_glScissor
)(GLint x
, GLint y
, GLsizei width
, GLsizei height
) = NULL
;
127 static void (*_glShaderBinary
)(GLsizei n
, const GLuint
* shaders
, GLenum binaryformat
, const GLvoid
* binary
, GLsizei length
) = NULL
;
128 static void (*_glShaderSource
)(GLuint shader
, GLsizei count
, const GLchar
** string
, const GLint
* length
) = NULL
;
129 static void (*_glStencilFunc
)(GLenum func
, GLint ref
, GLuint mask
) = NULL
;
130 static void (*_glStencilFuncSeparate
)(GLenum face
, GLenum func
, GLint ref
, GLuint mask
) = NULL
;
131 static void (*_glStencilMask
)(GLuint mask
) = NULL
;
132 static void (*_glStencilMaskSeparate
)(GLenum face
, GLuint mask
) = NULL
;
133 static void (*_glStencilOp
)(GLenum fail
, GLenum zfail
, GLenum zpass
) = NULL
;
134 static void (*_glStencilOpSeparate
)(GLenum face
, GLenum fail
, GLenum zfail
, GLenum zpass
) = NULL
;
135 static void (*_glTexImage2D
)(GLenum target
, GLint level
, GLint internalformat
, GLsizei width
, GLsizei height
, GLint border
, GLenum format
, GLenum type
, const GLvoid
* pixels
) = NULL
;
136 static void (*_glTexParameterf
)(GLenum target
, GLenum pname
, GLfloat param
) FP_ATTRIB
= NULL
;
137 static void (*_glTexParameterfv
)(GLenum target
, GLenum pname
, const GLfloat
* params
) = NULL
;
138 static void (*_glTexParameteri
)(GLenum target
, GLenum pname
, GLint param
) = NULL
;
139 static void (*_glTexParameteriv
)(GLenum target
, GLenum pname
, const GLint
* params
) = NULL
;
140 static void (*_glTexSubImage2D
)(GLenum target
, GLint level
, GLint xoffset
, GLint yoffset
, GLsizei width
, GLsizei height
, GLenum format
, GLenum type
, const GLvoid
* pixels
) = NULL
;
141 static void (*_glUniform1f
)(GLint location
, GLfloat x
) FP_ATTRIB
= NULL
;
142 static void (*_glUniform1fv
)(GLint location
, GLsizei count
, const GLfloat
* v
) = NULL
;
143 static void (*_glUniform1i
)(GLint location
, GLint x
) = NULL
;
144 static void (*_glUniform1iv
)(GLint location
, GLsizei count
, const GLint
* v
) = NULL
;
145 static void (*_glUniform2f
)(GLint location
, GLfloat x
, GLfloat y
) FP_ATTRIB
= NULL
;
146 static void (*_glUniform2fv
)(GLint location
, GLsizei count
, const GLfloat
* v
) = NULL
;
147 static void (*_glUniform2i
)(GLint location
, GLint x
, GLint y
) = NULL
;
148 static void (*_glUniform2iv
)(GLint location
, GLsizei count
, const GLint
* v
) = NULL
;
149 static void (*_glUniform3f
)(GLint location
, GLfloat x
, GLfloat y
, GLfloat z
) FP_ATTRIB
= NULL
;
150 static void (*_glUniform3fv
)(GLint location
, GLsizei count
, const GLfloat
* v
) = NULL
;
151 static void (*_glUniform3i
)(GLint location
, GLint x
, GLint y
, GLint z
) = NULL
;
152 static void (*_glUniform3iv
)(GLint location
, GLsizei count
, const GLint
* v
) = NULL
;
153 static void (*_glUniform4f
)(GLint location
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
) FP_ATTRIB
= NULL
;
154 static void (*_glUniform4fv
)(GLint location
, GLsizei count
, const GLfloat
* v
) = NULL
;
155 static void (*_glUniform4i
)(GLint location
, GLint x
, GLint y
, GLint z
, GLint w
) = NULL
;
156 static void (*_glUniform4iv
)(GLint location
, GLsizei count
, const GLint
* v
) = NULL
;
157 static void (*_glUniformMatrix2fv
)(GLint location
, GLsizei count
, GLboolean transpose
, const GLfloat
* value
) = NULL
;
158 static void (*_glUniformMatrix3fv
)(GLint location
, GLsizei count
, GLboolean transpose
, const GLfloat
* value
) = NULL
;
159 static void (*_glUniformMatrix4fv
)(GLint location
, GLsizei count
, GLboolean transpose
, const GLfloat
* value
) = NULL
;
160 static void (*_glUseProgram
)(GLuint program
) = NULL
;
161 static void (*_glValidateProgram
)(GLuint program
) = NULL
;
162 static void (*_glVertexAttrib1f
)(GLuint indx
, GLfloat x
) FP_ATTRIB
= NULL
;
163 static void (*_glVertexAttrib1fv
)(GLuint indx
, const GLfloat
* values
) = NULL
;
164 static void (*_glVertexAttrib2f
)(GLuint indx
, GLfloat x
, GLfloat y
) FP_ATTRIB
= NULL
;
165 static void (*_glVertexAttrib2fv
)(GLuint indx
, const GLfloat
* values
) = NULL
;
166 static void (*_glVertexAttrib3f
)(GLuint indx
, GLfloat x
, GLfloat y
, GLfloat z
) FP_ATTRIB
= NULL
;
167 static void (*_glVertexAttrib3fv
)(GLuint indx
, const GLfloat
* values
) = NULL
;
168 static void (*_glVertexAttrib4f
)(GLuint indx
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
) FP_ATTRIB
= NULL
;
169 static void (*_glVertexAttrib4fv
)(GLuint indx
, const GLfloat
* values
) = NULL
;
170 static void (*_glVertexAttribPointer
)(GLuint indx
, GLint size
, GLenum type
, GLboolean normalized
, GLsizei stride
, const GLvoid
* ptr
) = NULL
;
171 static void (*_glViewport
)(GLint x
, GLint y
, GLsizei width
, GLsizei height
) = NULL
;
172 static void (*_glEGLImageTargetTexture2DOES
) (GLenum target
, GLeglImageOES image
) = NULL
;
175 #define GLES2_LOAD(sym) { *(&_ ## sym) = (void *) android_dlsym(_libglesv2, #sym); }
177 static void __attribute__((constructor
)) _init_androidglesv2() {
178 _libglesv2
= (void *) android_dlopen(getenv("LIBGLESV2") ? getenv("LIBGLESV2") : "libGLESv2.so", RTLD_NOW
);
179 GLES2_LOAD(glActiveTexture
);
180 GLES2_LOAD(glAttachShader
);
181 GLES2_LOAD(glBindAttribLocation
);
182 GLES2_LOAD(glBindBuffer
);
183 GLES2_LOAD(glBindFramebuffer
);
184 GLES2_LOAD(glBindRenderbuffer
);
185 GLES2_LOAD(glBindTexture
);
186 GLES2_LOAD(glBlendColor
);
187 GLES2_LOAD(glBlendEquation
);
188 GLES2_LOAD(glBlendEquationSeparate
);
189 GLES2_LOAD(glBlendFunc
);
190 GLES2_LOAD(glBlendFuncSeparate
);
191 GLES2_LOAD(glBufferData
);
192 GLES2_LOAD(glBufferSubData
);
193 GLES2_LOAD(glCheckFramebufferStatus
);
195 GLES2_LOAD(glClearColor
);
196 GLES2_LOAD(glClearDepthf
);
197 GLES2_LOAD(glClearStencil
);
198 GLES2_LOAD(glColorMask
);
199 GLES2_LOAD(glCompileShader
);
200 GLES2_LOAD(glCompressedTexImage2D
);
201 GLES2_LOAD(glCompressedTexSubImage2D
);
202 GLES2_LOAD(glCopyTexImage2D
);
203 GLES2_LOAD(glCopyTexSubImage2D
);
204 GLES2_LOAD(glCreateProgram
);
205 GLES2_LOAD(glCreateShader
);
206 GLES2_LOAD(glCullFace
);
207 GLES2_LOAD(glDeleteBuffers
);
208 GLES2_LOAD(glDeleteFramebuffers
);
209 GLES2_LOAD(glDeleteProgram
);
210 GLES2_LOAD(glDeleteRenderbuffers
);
211 GLES2_LOAD(glDeleteShader
);
212 GLES2_LOAD(glDeleteTextures
);
213 GLES2_LOAD(glDepthFunc
);
214 GLES2_LOAD(glDepthMask
);
215 GLES2_LOAD(glDepthRangef
);
216 GLES2_LOAD(glDetachShader
);
217 GLES2_LOAD(glDisable
);
218 GLES2_LOAD(glDisableVertexAttribArray
);
219 GLES2_LOAD(glDrawArrays
);
220 GLES2_LOAD(glDrawElements
);
221 GLES2_LOAD(glEnable
);
222 GLES2_LOAD(glEnableVertexAttribArray
);
223 GLES2_LOAD(glFinish
);
225 GLES2_LOAD(glFramebufferRenderbuffer
);
226 GLES2_LOAD(glFramebufferTexture2D
);
227 GLES2_LOAD(glFrontFace
);
228 GLES2_LOAD(glGenBuffers
);
229 GLES2_LOAD(glGenerateMipmap
);
230 GLES2_LOAD(glGenFramebuffers
);
231 GLES2_LOAD(glGenRenderbuffers
);
232 GLES2_LOAD(glGenTextures
);
233 GLES2_LOAD(glGetActiveAttrib
);
234 GLES2_LOAD(glGetActiveUniform
);
235 GLES2_LOAD(glGetAttachedShaders
);
236 GLES2_LOAD(glGetAttribLocation
);
237 GLES2_LOAD(glGetBooleanv
);
238 GLES2_LOAD(glGetBufferParameteriv
);
239 GLES2_LOAD(glGetError
);
240 GLES2_LOAD(glGetFloatv
);
241 GLES2_LOAD(glGetFramebufferAttachmentParameteriv
);
242 GLES2_LOAD(glGetIntegerv
);
243 GLES2_LOAD(glGetProgramiv
);
244 GLES2_LOAD(glGetProgramInfoLog
);
245 GLES2_LOAD(glGetRenderbufferParameteriv
);
246 GLES2_LOAD(glGetShaderiv
);
247 GLES2_LOAD(glGetShaderInfoLog
);
248 GLES2_LOAD(glGetShaderPrecisionFormat
);
249 GLES2_LOAD(glGetShaderSource
);
250 GLES2_LOAD(glGetString
);
251 GLES2_LOAD(glGetTexParameterfv
);
252 GLES2_LOAD(glGetTexParameteriv
);
253 GLES2_LOAD(glGetUniformfv
);
254 GLES2_LOAD(glGetUniformiv
);
255 GLES2_LOAD(glGetUniformLocation
);
256 GLES2_LOAD(glGetVertexAttribfv
);
257 GLES2_LOAD(glGetVertexAttribiv
);
258 GLES2_LOAD(glGetVertexAttribPointerv
);
260 GLES2_LOAD(glIsBuffer
);
261 GLES2_LOAD(glIsEnabled
);
262 GLES2_LOAD(glIsFramebuffer
);
263 GLES2_LOAD(glIsProgram
);
264 GLES2_LOAD(glIsRenderbuffer
);
265 GLES2_LOAD(glIsShader
);
266 GLES2_LOAD(glIsTexture
);
267 GLES2_LOAD(glLineWidth
);
268 GLES2_LOAD(glLinkProgram
);
269 GLES2_LOAD(glPixelStorei
);
270 GLES2_LOAD(glPolygonOffset
);
271 GLES2_LOAD(glReadPixels
);
272 GLES2_LOAD(glReleaseShaderCompiler
);
273 GLES2_LOAD(glRenderbufferStorage
);
274 GLES2_LOAD(glSampleCoverage
);
275 GLES2_LOAD(glScissor
);
276 GLES2_LOAD(glShaderBinary
);
277 GLES2_LOAD(glShaderSource
);
278 GLES2_LOAD(glStencilFunc
);
279 GLES2_LOAD(glStencilFuncSeparate
);
280 GLES2_LOAD(glStencilMask
);
281 GLES2_LOAD(glStencilMaskSeparate
);
282 GLES2_LOAD(glStencilOp
);
283 GLES2_LOAD(glStencilOpSeparate
);
284 GLES2_LOAD(glTexImage2D
);
285 GLES2_LOAD(glTexParameterf
);
286 GLES2_LOAD(glTexParameterfv
);
287 GLES2_LOAD(glTexParameteri
);
288 GLES2_LOAD(glTexParameteriv
);
289 GLES2_LOAD(glTexSubImage2D
);
290 GLES2_LOAD(glUniform1f
);
291 GLES2_LOAD(glUniform1fv
);
292 GLES2_LOAD(glUniform1i
);
293 GLES2_LOAD(glUniform1iv
);
294 GLES2_LOAD(glUniform2f
);
295 GLES2_LOAD(glUniform2fv
);
296 GLES2_LOAD(glUniform2i
);
297 GLES2_LOAD(glUniform2iv
);
298 GLES2_LOAD(glUniform3f
);
299 GLES2_LOAD(glUniform3fv
);
300 GLES2_LOAD(glUniform3i
);
301 GLES2_LOAD(glUniform3iv
);
302 GLES2_LOAD(glUniform4f
);
303 GLES2_LOAD(glUniform4fv
);
304 GLES2_LOAD(glUniform4i
);
305 GLES2_LOAD(glUniform4iv
);
306 GLES2_LOAD(glUniformMatrix2fv
);
307 GLES2_LOAD(glUniformMatrix3fv
);
308 GLES2_LOAD(glUniformMatrix4fv
);
309 GLES2_LOAD(glUseProgram
);
310 GLES2_LOAD(glValidateProgram
);
311 GLES2_LOAD(glVertexAttrib1f
);
312 GLES2_LOAD(glVertexAttrib1fv
);
313 GLES2_LOAD(glVertexAttrib2f
);
314 GLES2_LOAD(glVertexAttrib2fv
);
315 GLES2_LOAD(glVertexAttrib3f
);
316 GLES2_LOAD(glVertexAttrib3fv
);
317 GLES2_LOAD(glVertexAttrib4f
);
318 GLES2_LOAD(glVertexAttrib4fv
);
319 GLES2_LOAD(glVertexAttribPointer
);
320 GLES2_LOAD(glViewport
);
321 GLES2_LOAD(glEGLImageTargetTexture2DOES
);
326 void glActiveTexture (GLenum texture
)
328 return (*_glActiveTexture
)(texture
);
331 void glAttachShader (GLuint program
, GLuint shader
)
333 return (*_glAttachShader
)(program
, shader
);
336 void glBindAttribLocation (GLuint program
, GLuint index
, const GLchar
* name
)
338 return (*_glBindAttribLocation
)(program
, index
, name
);
341 void glBindBuffer (GLenum target
, GLuint buffer
)
343 return (*_glBindBuffer
)(target
, buffer
);
346 void glBindFramebuffer (GLenum target
, GLuint framebuffer
)
348 return (*_glBindFramebuffer
)(target
, framebuffer
);
351 void glBindRenderbuffer (GLenum target
, GLuint renderbuffer
)
353 return (*_glBindRenderbuffer
)(target
, renderbuffer
);
356 void glBindTexture (GLenum target
, GLuint texture
)
358 return (*_glBindTexture
)(target
, texture
);
361 void glBlendColor (GLclampf red
, GLclampf green
, GLclampf blue
, GLclampf alpha
)
363 return (*_glBlendColor
)(red
, green
, blue
, alpha
);
366 void glBlendEquation ( GLenum mode
)
368 return (*_glBlendEquation
)(mode
);
371 void glBlendEquationSeparate (GLenum modeRGB
, GLenum modeAlpha
)
373 return (*_glBlendEquationSeparate
)(modeRGB
, modeAlpha
);
376 void glBlendFunc (GLenum sfactor
, GLenum dfactor
)
378 return (*_glBlendFunc
)(sfactor
, dfactor
);
381 void glBlendFuncSeparate (GLenum srcRGB
, GLenum dstRGB
, GLenum srcAlpha
, GLenum dstAlpha
)
383 return (*_glBlendFuncSeparate
)(srcRGB
, dstRGB
, srcAlpha
, dstAlpha
);
386 void glBufferData (GLenum target
, GLsizeiptr size
, const GLvoid
* data
, GLenum usage
)
388 return (*_glBufferData
)(target
, size
, data
, usage
);
391 void glBufferSubData (GLenum target
, GLintptr offset
, GLsizeiptr size
, const GLvoid
* data
)
393 return (*_glBufferSubData
)(target
, offset
, size
, data
);
396 GLenum
glCheckFramebufferStatus (GLenum target
)
398 return (*_glCheckFramebufferStatus
)(target
);
401 void glClear (GLbitfield mask
)
403 return (*_glClear
)(mask
);
406 void glClearColor (GLclampf red
, GLclampf green
, GLclampf blue
, GLclampf alpha
)
408 return (*_glClearColor
)(red
, green
, blue
, alpha
);
411 void glClearDepthf (GLclampf depth
)
413 return (*_glClearDepthf
)(depth
);
416 void glClearStencil (GLint s
)
418 return (*_glClearStencil
)(s
);
421 void glColorMask (GLboolean red
, GLboolean green
, GLboolean blue
, GLboolean alpha
)
423 return (*_glColorMask
)(red
, green
, blue
, alpha
);
426 void glCompileShader (GLuint shader
)
428 return (*_glCompileShader
)(shader
);
431 void glCompressedTexImage2D (GLenum target
, GLint level
, GLenum internalformat
, GLsizei width
, GLsizei height
, GLint border
, GLsizei imageSize
, const GLvoid
* data
)
433 return (*_glCompressedTexImage2D
)(target
, level
, internalformat
, width
, height
, border
, imageSize
, data
);
436 void glCompressedTexSubImage2D (GLenum target
, GLint level
, GLint xoffset
, GLint yoffset
, GLsizei width
, GLsizei height
, GLenum format
, GLsizei imageSize
, const GLvoid
* data
)
438 return (*_glCompressedTexSubImage2D
)(target
, level
, xoffset
, yoffset
, width
, height
, format
, imageSize
, data
);
441 void glCopyTexImage2D (GLenum target
, GLint level
, GLenum internalformat
, GLint x
, GLint y
, GLsizei width
, GLsizei height
, GLint border
)
443 return (*_glCopyTexImage2D
)(target
, level
, internalformat
, x
, y
, width
, height
, border
);
446 void glCopyTexSubImage2D (GLenum target
, GLint level
, GLint xoffset
, GLint yoffset
, GLint x
, GLint y
, GLsizei width
, GLsizei height
)
448 return (*_glCopyTexSubImage2D
)(target
, level
, xoffset
, yoffset
, x
, y
, width
, height
);
451 GLuint
glCreateProgram (void)
453 return (*_glCreateProgram
)();
456 GLuint
glCreateShader (GLenum type
)
458 return (*_glCreateShader
)(type
);
461 void glCullFace (GLenum mode
)
463 return (*_glCullFace
)(mode
);
466 void glDeleteBuffers (GLsizei n
, const GLuint
* buffers
)
468 return (*_glDeleteBuffers
)(n
, buffers
);
471 void glDeleteFramebuffers (GLsizei n
, const GLuint
* framebuffers
)
473 return (*_glDeleteFramebuffers
)(n
, framebuffers
);
476 void glDeleteProgram (GLuint program
)
478 return (*_glDeleteProgram
)(program
);
481 void glDeleteRenderbuffers (GLsizei n
, const GLuint
* renderbuffers
)
483 return (*_glDeleteRenderbuffers
)(n
, renderbuffers
);
486 void glDeleteShader (GLuint shader
)
488 return (*_glDeleteShader
)(shader
);
491 void glDeleteTextures (GLsizei n
, const GLuint
* textures
)
493 return (*_glDeleteTextures
)(n
, textures
);
496 void glDepthFunc (GLenum func
)
498 return (*_glDepthFunc
)(func
);
501 void glDepthMask (GLboolean flag
)
503 return (*_glDepthMask
)(flag
);
506 void glDepthRangef (GLclampf zNear
, GLclampf zFar
)
508 return (*_glDepthRangef
)(zNear
, zFar
);
511 void glDetachShader (GLuint program
, GLuint shader
)
513 return (*_glDetachShader
)(program
, shader
);
516 void glDisable (GLenum cap
)
518 return (*_glDisable
)(cap
);
521 void glDisableVertexAttribArray (GLuint index
)
523 return (*_glDisableVertexAttribArray
)(index
);
526 void glDrawArrays (GLenum mode
, GLint first
, GLsizei count
)
528 return (*_glDrawArrays
)(mode
, first
, count
);
531 void glDrawElements (GLenum mode
, GLsizei count
, GLenum type
, const GLvoid
* indices
)
533 return (*_glDrawElements
)(mode
, count
, type
, indices
);
536 void glEnable (GLenum cap
)
538 return (*_glEnable
)(cap
);
541 void glEnableVertexAttribArray (GLuint index
)
543 return (*_glEnableVertexAttribArray
)(index
);
548 return (*_glFinish
)();
553 return (*_glFlush
)();
556 void glFramebufferRenderbuffer (GLenum target
, GLenum attachment
, GLenum renderbuffertarget
, GLuint renderbuffer
)
558 return (*_glFramebufferRenderbuffer
)(target
, attachment
, renderbuffertarget
, renderbuffer
);
561 void glFramebufferTexture2D (GLenum target
, GLenum attachment
, GLenum textarget
, GLuint texture
, GLint level
)
563 return (*_glFramebufferTexture2D
)(target
, attachment
, textarget
, texture
, level
);
566 void glFrontFace (GLenum mode
)
568 return (*_glFrontFace
)(mode
);
571 void glGenBuffers (GLsizei n
, GLuint
* buffers
)
573 return (*_glGenBuffers
)(n
, buffers
);
576 void glGenerateMipmap (GLenum target
)
578 return (*_glGenerateMipmap
)(target
);
581 void glGenFramebuffers (GLsizei n
, GLuint
* framebuffers
)
583 return (*_glGenFramebuffers
)(n
, framebuffers
);
586 void glGenRenderbuffers (GLsizei n
, GLuint
* renderbuffers
)
588 return (*_glGenRenderbuffers
)(n
, renderbuffers
);
591 void glGenTextures (GLsizei n
, GLuint
* textures
)
593 return (*_glGenTextures
)(n
, textures
);
596 void glGetActiveAttrib (GLuint program
, GLuint index
, GLsizei bufsize
, GLsizei
* length
, GLint
* size
, GLenum
* type
, GLchar
* name
)
598 return (*_glGetActiveAttrib
)(program
, index
, bufsize
, length
, size
, type
, name
);
601 void glGetActiveUniform (GLuint program
, GLuint index
, GLsizei bufsize
, GLsizei
* length
, GLint
* size
, GLenum
* type
, GLchar
* name
)
603 return (*_glGetActiveUniform
)(program
, index
, bufsize
, length
, size
, type
, name
);
606 void glGetAttachedShaders (GLuint program
, GLsizei maxcount
, GLsizei
* count
, GLuint
* shaders
)
608 return (*_glGetAttachedShaders
)(program
, maxcount
, count
, shaders
);
611 int glGetAttribLocation (GLuint program
, const GLchar
* name
)
613 return (*_glGetAttribLocation
)(program
, name
);
616 void glGetBooleanv (GLenum pname
, GLboolean
* params
)
618 return (*_glGetBooleanv
)(pname
, params
);
621 void glGetBufferParameteriv (GLenum target
, GLenum pname
, GLint
* params
)
623 return (*_glGetBufferParameteriv
)(target
, pname
, params
);
626 GLenum
glGetError (void)
628 return (*_glGetError
)();
631 void glGetFloatv (GLenum pname
, GLfloat
* params
)
633 return (*_glGetFloatv
)(pname
, params
);
636 void glGetFramebufferAttachmentParameteriv (GLenum target
, GLenum attachment
, GLenum pname
, GLint
* params
)
638 return (*_glGetFramebufferAttachmentParameteriv
)(target
, attachment
, pname
, params
);
641 void glGetIntegerv (GLenum pname
, GLint
* params
)
643 return (*_glGetIntegerv
)(pname
, params
);
646 void glGetProgramiv (GLuint program
, GLenum pname
, GLint
* params
)
648 return (*_glGetProgramiv
)(program
, pname
, params
);
651 void glGetProgramInfoLog (GLuint program
, GLsizei bufsize
, GLsizei
* length
, GLchar
* infolog
)
653 return (*_glGetProgramInfoLog
)(program
, bufsize
, length
, infolog
);
656 void glGetRenderbufferParameteriv (GLenum target
, GLenum pname
, GLint
* params
)
658 return (*_glGetRenderbufferParameteriv
)(target
, pname
, params
);
661 void glGetShaderiv (GLuint shader
, GLenum pname
, GLint
* params
)
663 return (*_glGetShaderiv
)(shader
, pname
, params
);
666 void glGetShaderInfoLog (GLuint shader
, GLsizei bufsize
, GLsizei
* length
, GLchar
* infolog
)
668 return (*_glGetShaderInfoLog
)(shader
, bufsize
, length
, infolog
);
671 void glGetShaderPrecisionFormat (GLenum shadertype
, GLenum precisiontype
, GLint
* range
, GLint
* precision
)
673 return (*_glGetShaderPrecisionFormat
)(shadertype
, precisiontype
, range
, precision
);
676 void glGetShaderSource (GLuint shader
, GLsizei bufsize
, GLsizei
* length
, GLchar
* source
)
678 return (*_glGetShaderSource
)(shader
, bufsize
, length
, source
);
681 const GLubyte
* glGetString (GLenum name
)
683 return (*_glGetString
)(name
);
686 void glGetTexParameterfv (GLenum target
, GLenum pname
, GLfloat
* params
)
688 return (*_glGetTexParameterfv
)(target
, pname
, params
);
691 void glGetTexParameteriv (GLenum target
, GLenum pname
, GLint
* params
)
693 return (*_glGetTexParameteriv
)(target
, pname
, params
);
696 void glGetUniformfv (GLuint program
, GLint location
, GLfloat
* params
)
698 return (*_glGetUniformfv
)(program
, location
, params
);
701 void glGetUniformiv (GLuint program
, GLint location
, GLint
* params
)
703 return (*_glGetUniformiv
)(program
, location
, params
);
706 int glGetUniformLocation (GLuint program
, const GLchar
* name
)
708 return (*_glGetUniformLocation
)(program
, name
);
711 void glGetVertexAttribfv (GLuint index
, GLenum pname
, GLfloat
* params
)
713 return (*_glGetVertexAttribfv
)(index
, pname
, params
);
716 void glGetVertexAttribiv (GLuint index
, GLenum pname
, GLint
* params
)
718 return (*_glGetVertexAttribiv
)(index
, pname
, params
);
721 void glGetVertexAttribPointerv (GLuint index
, GLenum pname
, GLvoid
** pointer
)
723 return (*_glGetVertexAttribPointerv
)(index
, pname
, pointer
);
726 void glHint (GLenum target
, GLenum mode
)
728 return (*_glHint
)(target
, mode
);
731 GLboolean
glIsBuffer (GLuint buffer
)
733 return (*_glIsBuffer
)(buffer
);
736 GLboolean
glIsEnabled (GLenum cap
)
738 return (*_glIsEnabled
)(cap
);
741 GLboolean
glIsFramebuffer (GLuint framebuffer
)
743 return (*_glIsFramebuffer
)(framebuffer
);
746 GLboolean
glIsProgram (GLuint program
)
748 return (*_glIsProgram
)(program
);
751 GLboolean
glIsRenderbuffer (GLuint renderbuffer
)
753 return (*_glIsRenderbuffer
)(renderbuffer
);
756 GLboolean
glIsShader (GLuint shader
)
758 return (*_glIsShader
)(shader
);
761 GLboolean
glIsTexture (GLuint texture
)
763 return (*_glIsTexture
)(texture
);
766 void glLineWidth (GLfloat width
)
768 return (*_glLineWidth
)(width
);
771 void glLinkProgram (GLuint program
)
773 return (*_glLinkProgram
)(program
);
776 void glPixelStorei (GLenum pname
, GLint param
)
778 return (*_glPixelStorei
)(pname
, param
);
781 void glPolygonOffset (GLfloat factor
, GLfloat units
)
783 return (*_glPolygonOffset
)(factor
, units
);
786 void glReadPixels (GLint x
, GLint y
, GLsizei width
, GLsizei height
, GLenum format
, GLenum type
, GLvoid
* pixels
)
788 return (*_glReadPixels
)(x
, y
, width
, height
, format
, type
, pixels
);
792 void glReleaseShaderCompiler (void)
794 return (*_glReleaseShaderCompiler
)();
797 void glRenderbufferStorage (GLenum target
, GLenum internalformat
, GLsizei width
, GLsizei height
)
799 return (*_glRenderbufferStorage
)(target
, internalformat
, width
, height
);
802 void glSampleCoverage (GLclampf value
, GLboolean invert
)
804 return (*_glSampleCoverage
)(value
, invert
);
807 void glScissor (GLint x
, GLint y
, GLsizei width
, GLsizei height
)
809 return (*_glScissor
)(x
, y
, width
, height
);
812 void glShaderBinary (GLsizei n
, const GLuint
* shaders
, GLenum binaryformat
, const GLvoid
* binary
, GLsizei length
)
814 return (*_glShaderBinary
)(n
, shaders
, binaryformat
, binary
, length
);
817 void glShaderSource (GLuint shader
, GLsizei count
, const GLchar
** string
, const GLint
* length
)
819 return (*_glShaderSource
)(shader
, count
, string
, length
);
822 void glStencilFunc (GLenum func
, GLint ref
, GLuint mask
)
824 return (*_glStencilFunc
)(func
, ref
, mask
);
827 void glStencilFuncSeparate (GLenum face
, GLenum func
, GLint ref
, GLuint mask
)
829 return (*_glStencilFuncSeparate
)(face
, func
, ref
, mask
);
832 void glStencilMask (GLuint mask
)
834 return (*_glStencilMask
)(mask
);
837 void glStencilMaskSeparate (GLenum face
, GLuint mask
)
839 return (*_glStencilMaskSeparate
)(face
, mask
);
842 void glStencilOp (GLenum fail
, GLenum zfail
, GLenum zpass
)
844 return (*_glStencilOp
)(fail
, zfail
, zpass
);
847 void glStencilOpSeparate (GLenum face
, GLenum fail
, GLenum zfail
, GLenum zpass
)
849 return (*_glStencilOpSeparate
)(face
, fail
, zfail
, zpass
);
852 void glTexImage2D (GLenum target
, GLint level
, GLint internalformat
, GLsizei width
, GLsizei height
, GLint border
, GLenum format
, GLenum type
, const GLvoid
* pixels
)
854 return (*_glTexImage2D
)(target
, level
, internalformat
, width
, height
, border
, format
, type
, pixels
);
857 void glTexParameterf (GLenum target
, GLenum pname
, GLfloat param
)
859 return (*_glTexParameterf
)(target
, pname
, param
);
862 void glTexParameterfv (GLenum target
, GLenum pname
, const GLfloat
* params
)
864 return (*_glTexParameterfv
)(target
, pname
, params
);
867 void glTexParameteri (GLenum target
, GLenum pname
, GLint param
)
869 return (*_glTexParameteri
)(target
, pname
, param
);
872 void glTexParameteriv (GLenum target
, GLenum pname
, const GLint
* params
)
874 return (*_glTexParameteriv
)(target
, pname
, params
);
877 void glTexSubImage2D (GLenum target
, GLint level
, GLint xoffset
, GLint yoffset
, GLsizei width
, GLsizei height
, GLenum format
, GLenum type
, const GLvoid
* pixels
)
879 return (*_glTexSubImage2D
)(target
, level
, xoffset
, yoffset
, width
, height
, format
, type
, pixels
);
882 void glUniform1f (GLint location
, GLfloat x
)
884 return (*_glUniform1f
)(location
, x
);
887 void glUniform1fv (GLint location
, GLsizei count
, const GLfloat
* v
)
889 return (*_glUniform1fv
)(location
, count
, v
);
892 void glUniform1i (GLint location
, GLint x
)
894 return (*_glUniform1i
)(location
, x
);
897 void glUniform1iv (GLint location
, GLsizei count
, const GLint
* v
)
899 return (*_glUniform1iv
)(location
, count
, v
);
902 void glUniform2f (GLint location
, GLfloat x
, GLfloat y
)
904 return (*_glUniform2f
)(location
, x
, y
);
907 void glUniform2fv (GLint location
, GLsizei count
, const GLfloat
* v
)
909 return (*_glUniform2fv
)(location
, count
, v
);
912 void glUniform2i (GLint location
, GLint x
, GLint y
)
914 return (*_glUniform2i
)(location
, x
, y
);
917 void glUniform2iv (GLint location
, GLsizei count
, const GLint
* v
)
919 return (*_glUniform2iv
)(location
, count
, v
);
922 void glUniform3f (GLint location
, GLfloat x
, GLfloat y
, GLfloat z
)
924 return (*_glUniform3f
)(location
, x
, y
, z
);
927 void glUniform3fv (GLint location
, GLsizei count
, const GLfloat
* v
)
929 return (*_glUniform3fv
)(location
, count
, v
);
932 void glUniform3i (GLint location
, GLint x
, GLint y
, GLint z
)
934 return (*_glUniform3i
)(location
, x
, y
, z
);
937 void glUniform3iv (GLint location
, GLsizei count
, const GLint
* v
)
939 return (*_glUniform3iv
)(location
, count
, v
);
942 void glUniform4f (GLint location
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
944 return (*_glUniform4f
)(location
, x
, y
, z
, w
);
947 void glUniform4fv (GLint location
, GLsizei count
, const GLfloat
* v
)
949 return (*_glUniform4fv
)(location
, count
, v
);
952 void glUniform4i (GLint location
, GLint x
, GLint y
, GLint z
, GLint w
)
954 return (*_glUniform4i
)(location
, x
, y
, z
, w
);
957 void glUniform4iv (GLint location
, GLsizei count
, const GLint
* v
)
959 return (*_glUniform4iv
)(location
, count
, v
);
962 void glUniformMatrix2fv (GLint location
, GLsizei count
, GLboolean transpose
, const GLfloat
* value
)
964 return (*_glUniformMatrix2fv
)(location
, count
, transpose
, value
);
967 void glUniformMatrix3fv (GLint location
, GLsizei count
, GLboolean transpose
, const GLfloat
* value
)
969 return (*_glUniformMatrix3fv
)(location
, count
, transpose
, value
);
972 void glUniformMatrix4fv (GLint location
, GLsizei count
, GLboolean transpose
, const GLfloat
* value
)
974 return (*_glUniformMatrix4fv
)(location
, count
, transpose
, value
);
977 void glUseProgram (GLuint program
)
979 return (*_glUseProgram
)(program
);
982 void glValidateProgram (GLuint program
)
984 return (*_glValidateProgram
)(program
);
987 void glVertexAttrib1f (GLuint indx
, GLfloat x
)
989 return (*_glVertexAttrib1f
)(indx
, x
);
992 void glVertexAttrib1fv (GLuint indx
, const GLfloat
* values
)
994 return (*_glVertexAttrib1fv
)(indx
, values
);
997 void glVertexAttrib2f (GLuint indx
, GLfloat x
, GLfloat y
)
999 return (*_glVertexAttrib2f
)(indx
, x
, y
);
1002 void glVertexAttrib2fv (GLuint indx
, const GLfloat
* values
)
1004 return (*_glVertexAttrib2fv
)(indx
, values
);
1007 void glVertexAttrib3f (GLuint indx
, GLfloat x
, GLfloat y
, GLfloat z
)
1009 return (*_glVertexAttrib3f
)(indx
, x
, y
, z
);
1012 void glVertexAttrib3fv (GLuint indx
, const GLfloat
* values
)
1014 return (*_glVertexAttrib3fv
)(indx
, values
);
1017 void glVertexAttrib4f (GLuint indx
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
1019 return (*_glVertexAttrib4f
)(indx
, x
, y
, z
, w
);
1022 void glVertexAttrib4fv (GLuint indx
, const GLfloat
* values
)
1024 return (*_glVertexAttrib4fv
)(indx
, values
);
1027 void glVertexAttribPointer (GLuint indx
, GLint size
, GLenum type
, GLboolean normalized
, GLsizei stride
, const GLvoid
* ptr
)
1029 return (*_glVertexAttribPointer
)(indx
, size
, type
, normalized
, stride
, ptr
);
1032 void glViewport (GLint x
, GLint y
, GLsizei width
, GLsizei height
)
1034 return (*_glViewport
)(x
, y
, width
, height
);
1037 void glEGLImageTargetTexture2DOES (GLenum target
, GLeglImageOES image
)
1039 (*_glEGLImageTargetTexture2DOES
)(target
, image
);