1 
2 #include <GLES2/gl2.h>
3 
4 #include <cogl/cogl-gles2.h>
5 
6 void
glBindTexture(GLenum target,GLuint texture)7 glBindTexture (GLenum target, GLuint texture)
8 {
9   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
10   vtable->glBindTexture (target, texture);
11 }
12 
13 void
glBlendFunc(GLenum sfactor,GLenum dfactor)14 glBlendFunc (GLenum sfactor, GLenum dfactor)
15 {
16   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
17   vtable->glBlendFunc (sfactor, dfactor);
18 }
19 
20 void
glClear(GLbitfield mask)21 glClear (GLbitfield mask)
22 {
23   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
24   vtable->glClear (mask);
25 }
26 
27 void
glClearColor(GLclampf red,GLclampf green,GLclampf blue,GLclampf alpha)28 glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
29 {
30   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
31   vtable->glClearColor (red, green, blue, alpha);
32 }
33 
34 void
glClearStencil(GLint s)35 glClearStencil (GLint s)
36 {
37   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
38   vtable->glClearStencil (s);
39 }
40 
41 void
glColorMask(GLboolean red,GLboolean green,GLboolean blue,GLboolean alpha)42 glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
43 {
44   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
45   vtable->glColorMask (red, green, blue, alpha);
46 }
47 
48 void
glCopyTexSubImage2D(GLenum target,GLint level,GLint xoffset,GLint yoffset,GLint x,GLint y,GLsizei width,GLsizei height)49 glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset,
50 		     GLint x, GLint y, GLsizei width, GLsizei height)
51 {
52   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
53   vtable->glCopyTexSubImage2D (target, level, xoffset, yoffset, x, y, width,
54 			       height);
55 }
56 
57 void
glDeleteTextures(GLsizei n,const GLuint * textures)58 glDeleteTextures (GLsizei n, const GLuint * textures)
59 {
60   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
61   vtable->glDeleteTextures (n, textures);
62 }
63 
64 void
glDepthFunc(GLenum func)65 glDepthFunc (GLenum func)
66 {
67   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
68   vtable->glDepthFunc (func);
69 }
70 
71 void
glDepthMask(GLboolean flag)72 glDepthMask (GLboolean flag)
73 {
74   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
75   vtable->glDepthMask (flag);
76 }
77 
78 void
glDisable(GLenum cap)79 glDisable (GLenum cap)
80 {
81   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
82   vtable->glDisable (cap);
83 }
84 
85 void
glDrawArrays(GLenum mode,GLint first,GLsizei count)86 glDrawArrays (GLenum mode, GLint first, GLsizei count)
87 {
88   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
89   vtable->glDrawArrays (mode, first, count);
90 }
91 
92 void
glDrawElements(GLenum mode,GLsizei count,GLenum type,const GLvoid * indices)93 glDrawElements (GLenum mode, GLsizei count, GLenum type,
94 		const GLvoid * indices)
95 {
96   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
97   vtable->glDrawElements (mode, count, type, indices);
98 }
99 
100 void
glEnable(GLenum cap)101 glEnable (GLenum cap)
102 {
103   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
104   vtable->glEnable (cap);
105 }
106 
107 void
glFinish(void)108 glFinish (void)
109 {
110   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
111   vtable->glFinish ();
112 }
113 
114 void
glFlush(void)115 glFlush (void)
116 {
117   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
118   vtable->glFlush ();
119 }
120 
121 void
glFrontFace(GLenum mode)122 glFrontFace (GLenum mode)
123 {
124   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
125   vtable->glFrontFace (mode);
126 }
127 
128 void
glCullFace(GLenum mode)129 glCullFace (GLenum mode)
130 {
131   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
132   vtable->glCullFace (mode);
133 }
134 
135 void
glGenTextures(GLsizei n,GLuint * textures)136 glGenTextures (GLsizei n, GLuint * textures)
137 {
138   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
139   vtable->glGenTextures (n, textures);
140 }
141 
142 GLenum
glGetError(void)143 glGetError (void)
144 {
145   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
146   return vtable->glGetError ();
147 }
148 
149 void
glGetIntegerv(GLenum pname,GLint * params)150 glGetIntegerv (GLenum pname, GLint * params)
151 {
152   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
153   vtable->glGetIntegerv (pname, params);
154 }
155 
156 void
glGetBooleanv(GLenum pname,GLboolean * params)157 glGetBooleanv (GLenum pname, GLboolean * params)
158 {
159   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
160   vtable->glGetBooleanv (pname, params);
161 }
162 
163 void
glGetFloatv(GLenum pname,GLfloat * params)164 glGetFloatv (GLenum pname, GLfloat * params)
165 {
166   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
167   vtable->glGetFloatv (pname, params);
168 }
169 
170 const GLubyte *
glGetString(GLenum name)171 glGetString (GLenum name)
172 {
173   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
174   return vtable->glGetString (name);
175 }
176 
177 void
glHint(GLenum target,GLenum mode)178 glHint (GLenum target, GLenum mode)
179 {
180   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
181   vtable->glHint (target, mode);
182 }
183 
184 GLboolean
glIsTexture(GLuint texture)185 glIsTexture (GLuint texture)
186 {
187   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
188   return vtable->glIsTexture (texture);
189 }
190 
191 void
glPixelStorei(GLenum pname,GLint param)192 glPixelStorei (GLenum pname, GLint param)
193 {
194   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
195   vtable->glPixelStorei (pname, param);
196 }
197 
198 void
glReadPixels(GLint x,GLint y,GLsizei width,GLsizei height,GLenum format,GLenum type,GLvoid * pixels)199 glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format,
200 	      GLenum type, GLvoid * pixels)
201 {
202   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
203   vtable->glReadPixels (x, y, width, height, format, type, pixels);
204 }
205 
206 void
glScissor(GLint x,GLint y,GLsizei width,GLsizei height)207 glScissor (GLint x, GLint y, GLsizei width, GLsizei height)
208 {
209   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
210   vtable->glScissor (x, y, width, height);
211 }
212 
213 void
glStencilFunc(GLenum func,GLint ref,GLuint mask)214 glStencilFunc (GLenum func, GLint ref, GLuint mask)
215 {
216   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
217   vtable->glStencilFunc (func, ref, mask);
218 }
219 
220 void
glStencilMask(GLuint mask)221 glStencilMask (GLuint mask)
222 {
223   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
224   vtable->glStencilMask (mask);
225 }
226 
227 void
glStencilOp(GLenum fail,GLenum zfail,GLenum zpass)228 glStencilOp (GLenum fail, GLenum zfail, GLenum zpass)
229 {
230   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
231   vtable->glStencilOp (fail, zfail, zpass);
232 }
233 
234 void
glTexImage2D(GLenum target,GLint level,GLint internalformat,GLsizei width,GLsizei height,GLint border,GLenum format,GLenum type,const GLvoid * pixels)235 glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width,
236 	      GLsizei height, GLint border, GLenum format, GLenum type,
237 	      const GLvoid * pixels)
238 {
239   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
240   vtable->glTexImage2D (target, level, internalformat, width, height, border,
241 			format, type, pixels);
242 }
243 
244 void
glTexParameterf(GLenum target,GLenum pname,GLfloat param)245 glTexParameterf (GLenum target, GLenum pname, GLfloat param)
246 {
247   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
248   vtable->glTexParameterf (target, pname, param);
249 }
250 
251 void
glTexParameterfv(GLenum target,GLenum pname,const GLfloat * params)252 glTexParameterfv (GLenum target, GLenum pname, const GLfloat * params)
253 {
254   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
255   vtable->glTexParameterfv (target, pname, params);
256 }
257 
258 void
glTexParameteri(GLenum target,GLenum pname,GLint param)259 glTexParameteri (GLenum target, GLenum pname, GLint param)
260 {
261   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
262   vtable->glTexParameteri (target, pname, param);
263 }
264 
265 void
glTexParameteriv(GLenum target,GLenum pname,const GLint * params)266 glTexParameteriv (GLenum target, GLenum pname, const GLint * params)
267 {
268   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
269   vtable->glTexParameteriv (target, pname, params);
270 }
271 
272 void
glGetTexParameterfv(GLenum target,GLenum pname,GLfloat * params)273 glGetTexParameterfv (GLenum target, GLenum pname, GLfloat * params)
274 {
275   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
276   vtable->glGetTexParameterfv (target, pname, params);
277 }
278 
279 void
glGetTexParameteriv(GLenum target,GLenum pname,GLint * params)280 glGetTexParameteriv (GLenum target, GLenum pname, GLint * params)
281 {
282   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
283   vtable->glGetTexParameteriv (target, pname, params);
284 }
285 
286 void
glTexSubImage2D(GLenum target,GLint level,GLint xoffset,GLint yoffset,GLsizei width,GLsizei height,GLenum format,GLenum type,const GLvoid * pixels)287 glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset,
288 		 GLsizei width, GLsizei height, GLenum format, GLenum type,
289 		 const GLvoid * pixels)
290 {
291   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
292   vtable->glTexSubImage2D (target, level, xoffset, yoffset, width, height,
293 			   format, type, pixels);
294 }
295 
296 void
glCopyTexImage2D(GLenum target,GLint level,GLenum internalformat,GLint x,GLint y,GLsizei width,GLsizei height,GLint border)297 glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x,
298 		  GLint y, GLsizei width, GLsizei height, GLint border)
299 {
300   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
301   vtable->glCopyTexImage2D (target, level, internalformat,
302 			    x, y, width, height, border);
303 }
304 
305 void
glViewport(GLint x,GLint y,GLsizei width,GLsizei height)306 glViewport (GLint x, GLint y, GLsizei width, GLsizei height)
307 {
308   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
309   vtable->glViewport (x, y, width, height);
310 }
311 
312 GLboolean
glIsEnabled(GLenum cap)313 glIsEnabled (GLenum cap)
314 {
315   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
316   return vtable->glIsEnabled (cap);
317 }
318 
319 void
glLineWidth(GLfloat width)320 glLineWidth (GLfloat width)
321 {
322   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
323   vtable->glLineWidth (width);
324 }
325 
326 void
glPolygonOffset(GLfloat factor,GLfloat units)327 glPolygonOffset (GLfloat factor, GLfloat units)
328 {
329   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
330   vtable->glPolygonOffset (factor, units);
331 }
332 
333 void
glDepthRangef(GLfloat near_val,GLfloat far_val)334 glDepthRangef (GLfloat near_val, GLfloat far_val)
335 {
336   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
337   vtable->glDepthRangef (near_val, far_val);
338 }
339 
340 void
glClearDepthf(GLclampf depth)341 glClearDepthf (GLclampf depth)
342 {
343   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
344   vtable->glClearDepthf (depth);
345 }
346 
347 void
glCompressedTexImage2D(GLenum target,GLint level,GLenum internalformat,GLsizei width,GLsizei height,GLint border,GLsizei imageSize,const GLvoid * data)348 glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat,
349 			GLsizei width, GLsizei height, GLint border,
350 			GLsizei imageSize, const GLvoid * data)
351 {
352   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
353   vtable->glCompressedTexImage2D (target, level, internalformat, width,
354 				  height, border, imageSize, data);
355 }
356 
357 void
glCompressedTexSubImage2D(GLenum target,GLint level,GLint xoffset,GLint yoffset,GLsizei width,GLsizei height,GLenum format,GLsizei imageSize,const GLvoid * data)358 glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset,
359 			   GLint yoffset, GLsizei width, GLsizei height,
360 			   GLenum format, GLsizei imageSize,
361 			   const GLvoid * data)
362 {
363   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
364   vtable->glCompressedTexSubImage2D (target, level,
365 				     xoffset, yoffset, width, height,
366 				     format, imageSize, data);
367 }
368 
369 void
glSampleCoverage(GLclampf value,GLboolean invert)370 glSampleCoverage (GLclampf value, GLboolean invert)
371 {
372   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
373   vtable->glSampleCoverage (value, invert);
374 }
375 
376 void
glGetBufferParameteriv(GLenum target,GLenum pname,GLint * params)377 glGetBufferParameteriv (GLenum target, GLenum pname, GLint * params)
378 {
379   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
380   vtable->glGetBufferParameteriv (target, pname, params);
381 }
382 
383 void
glGenBuffers(GLsizei n,GLuint * buffers)384 glGenBuffers (GLsizei n, GLuint * buffers)
385 {
386   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
387   vtable->glGenBuffers (n, buffers);
388 }
389 
390 void
glBindBuffer(GLenum target,GLuint buffer)391 glBindBuffer (GLenum target, GLuint buffer)
392 {
393   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
394   vtable->glBindBuffer (target, buffer);
395 }
396 
397 void
glBufferData(GLenum target,GLsizeiptr size,const GLvoid * data,GLenum usage)398 glBufferData (GLenum target, GLsizeiptr size, const GLvoid * data,
399 	      GLenum usage)
400 {
401   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
402   vtable->glBufferData (target, size, data, usage);
403 }
404 
405 void
glBufferSubData(GLenum target,GLintptr offset,GLsizeiptr size,const GLvoid * data)406 glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size,
407 		 const GLvoid * data)
408 {
409   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
410   vtable->glBufferSubData (target, offset, size, data);
411 }
412 
413 void
glDeleteBuffers(GLsizei n,const GLuint * buffers)414 glDeleteBuffers (GLsizei n, const GLuint * buffers)
415 {
416   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
417   vtable->glDeleteBuffers (n, buffers);
418 }
419 
420 GLboolean
glIsBuffer(GLuint buffer)421 glIsBuffer (GLuint buffer)
422 {
423   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
424   return vtable->glIsBuffer (buffer);
425 }
426 
427 void
glActiveTexture(GLenum texture)428 glActiveTexture (GLenum texture)
429 {
430   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
431   vtable->glActiveTexture (texture);
432 }
433 
434 void
glGenRenderbuffers(GLsizei n,GLuint * renderbuffers)435 glGenRenderbuffers (GLsizei n, GLuint * renderbuffers)
436 {
437   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
438   vtable->glGenRenderbuffers (n, renderbuffers);
439 }
440 
441 void
glDeleteRenderbuffers(GLsizei n,const GLuint * renderbuffers)442 glDeleteRenderbuffers (GLsizei n, const GLuint * renderbuffers)
443 {
444   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
445   vtable->glDeleteRenderbuffers (n, renderbuffers);
446 }
447 
448 void
glBindRenderbuffer(GLenum target,GLuint renderbuffer)449 glBindRenderbuffer (GLenum target, GLuint renderbuffer)
450 {
451   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
452   vtable->glBindRenderbuffer (target, renderbuffer);
453 }
454 
455 void
glRenderbufferStorage(GLenum target,GLenum internalformat,GLsizei width,GLsizei height)456 glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width,
457 		       GLsizei height)
458 {
459   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
460   vtable->glRenderbufferStorage (target, internalformat, width, height);
461 }
462 
463 void
glGenFramebuffers(GLsizei n,GLuint * framebuffers)464 glGenFramebuffers (GLsizei n, GLuint * framebuffers)
465 {
466   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
467   vtable->glGenFramebuffers (n, framebuffers);
468 }
469 
470 void
glBindFramebuffer(GLenum target,GLuint framebuffer)471 glBindFramebuffer (GLenum target, GLuint framebuffer)
472 {
473   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
474   vtable->glBindFramebuffer (target, framebuffer);
475 }
476 
477 void
glFramebufferTexture2D(GLenum target,GLenum attachment,GLenum textarget,GLuint texture,GLint level)478 glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget,
479 			GLuint texture, GLint level)
480 {
481   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
482   vtable->glFramebufferTexture2D (target, attachment,
483 				  textarget, texture, level);
484 }
485 
486 void
glFramebufferRenderbuffer(GLenum target,GLenum attachment,GLenum renderbuffertarget,GLuint renderbuffer)487 glFramebufferRenderbuffer (GLenum target, GLenum attachment,
488 			   GLenum renderbuffertarget, GLuint renderbuffer)
489 {
490   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
491   vtable->glFramebufferRenderbuffer (target, attachment,
492 				     renderbuffertarget, renderbuffer);
493 }
494 
495 GLboolean
glIsRenderbuffer(GLuint renderbuffer)496 glIsRenderbuffer (GLuint renderbuffer)
497 {
498   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
499   return vtable->glIsRenderbuffer (renderbuffer);
500 }
501 
502 GLenum
glCheckFramebufferStatus(GLenum target)503 glCheckFramebufferStatus (GLenum target)
504 {
505   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
506   return vtable->glCheckFramebufferStatus (target);
507 }
508 
509 void
glDeleteFramebuffers(GLsizei n,const GLuint * framebuffers)510 glDeleteFramebuffers (GLsizei n, const GLuint * framebuffers)
511 {
512   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
513   vtable->glDeleteFramebuffers (n, framebuffers);
514 }
515 
516 void
glGenerateMipmap(GLenum target)517 glGenerateMipmap (GLenum target)
518 {
519   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
520   vtable->glGenerateMipmap (target);
521 }
522 
523 void
glGetFramebufferAttachmentParameteriv(GLenum target,GLenum attachment,GLenum pname,GLint * params)524 glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment,
525 				       GLenum pname, GLint * params)
526 {
527   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
528   vtable->glGetFramebufferAttachmentParameteriv (target,
529 						 attachment, pname, params);
530 }
531 
532 void
glGetRenderbufferParameteriv(GLenum target,GLenum pname,GLint * params)533 glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint * params)
534 {
535   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
536   vtable->glGetRenderbufferParameteriv (target, pname, params);
537 }
538 
539 GLboolean
glIsFramebuffer(GLuint framebuffer)540 glIsFramebuffer (GLuint framebuffer)
541 {
542   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
543   return vtable->glIsFramebuffer (framebuffer);
544 }
545 
546 void
glBlendEquation(GLenum mode)547 glBlendEquation (GLenum mode)
548 {
549   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
550   vtable->glBlendEquation (mode);
551 }
552 
553 void
glBlendColor(GLclampf red,GLclampf green,GLclampf blue,GLclampf alpha)554 glBlendColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
555 {
556   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
557   vtable->glBlendColor (red, green, blue, alpha);
558 }
559 
560 void
glBlendFuncSeparate(GLenum srcRGB,GLenum dstRGB,GLenum srcAlpha,GLenum dstAlpha)561 glBlendFuncSeparate (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha,
562 		     GLenum dstAlpha)
563 {
564   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
565   vtable->glBlendFuncSeparate (srcRGB, dstRGB, srcAlpha, dstAlpha);
566 }
567 
568 void
glBlendEquationSeparate(GLenum modeRGB,GLenum modeAlpha)569 glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha)
570 {
571   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
572   vtable->glBlendEquationSeparate (modeRGB, modeAlpha);
573 }
574 
575 void
glReleaseShaderCompiler(void)576 glReleaseShaderCompiler (void)
577 {
578   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
579   vtable->glReleaseShaderCompiler ();
580 }
581 
582 void
glGetShaderPrecisionFormat(GLenum shadertype,GLenum precisiontype,GLint * range,GLint * precision)583 glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype,
584 			    GLint * range, GLint * precision)
585 {
586   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
587   vtable->glGetShaderPrecisionFormat (shadertype, precisiontype,
588 				      range, precision);
589 }
590 
591 void
glShaderBinary(GLsizei n,const GLuint * shaders,GLenum binaryformat,const GLvoid * binary,GLsizei length)592 glShaderBinary (GLsizei n, const GLuint * shaders, GLenum binaryformat,
593 		const GLvoid * binary, GLsizei length)
594 {
595   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
596   vtable->glShaderBinary (n, shaders, binaryformat, binary, length);
597 }
598 
599 void
glStencilFuncSeparate(GLenum face,GLenum func,GLint ref,GLuint mask)600 glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask)
601 {
602   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
603   vtable->glStencilFuncSeparate (face, func, ref, mask);
604 }
605 
606 void
glStencilMaskSeparate(GLenum face,GLuint mask)607 glStencilMaskSeparate (GLenum face, GLuint mask)
608 {
609   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
610   vtable->glStencilMaskSeparate (face, mask);
611 }
612 
613 void
glStencilOpSeparate(GLenum face,GLenum fail,GLenum zfail,GLenum zpass)614 glStencilOpSeparate (GLenum face, GLenum fail, GLenum zfail, GLenum zpass)
615 {
616   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
617   vtable->glStencilOpSeparate (face, fail, zfail, zpass);
618 }
619 
620 GLuint
glCreateProgram(void)621 glCreateProgram (void)
622 {
623   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
624   return vtable->glCreateProgram ();
625 }
626 
627 GLuint
glCreateShader(GLenum shaderType)628 glCreateShader (GLenum shaderType)
629 {
630   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
631   return vtable->glCreateShader (shaderType);
632 }
633 
634 void
glShaderSource(GLuint shader,GLsizei count,const GLchar * const * string,const GLint * length)635 glShaderSource (GLuint shader, GLsizei count,
636 		const GLchar * const *string, const GLint * length)
637 {
638   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
639   vtable->glShaderSource (shader, count, string, length);
640 }
641 
642 void
glCompileShader(GLuint shader)643 glCompileShader (GLuint shader)
644 {
645   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
646   vtable->glCompileShader (shader);
647 }
648 
649 void
glDeleteShader(GLuint shader)650 glDeleteShader (GLuint shader)
651 {
652   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
653   vtable->glDeleteShader (shader);
654 }
655 
656 void
glAttachShader(GLuint program,GLuint shader)657 glAttachShader (GLuint program, GLuint shader)
658 {
659   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
660   vtable->glAttachShader (program, shader);
661 }
662 
663 void
glLinkProgram(GLuint program)664 glLinkProgram (GLuint program)
665 {
666   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
667   vtable->glLinkProgram (program);
668 }
669 
670 void
glUseProgram(GLuint program)671 glUseProgram (GLuint program)
672 {
673   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
674   vtable->glUseProgram (program);
675 }
676 
677 GLint
glGetUniformLocation(GLuint program,const char * name)678 glGetUniformLocation (GLuint program, const char *name)
679 {
680   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
681   return vtable->glGetUniformLocation (program, name);
682 }
683 
684 void
glDeleteProgram(GLuint program)685 glDeleteProgram (GLuint program)
686 {
687   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
688   vtable->glDeleteProgram (program);
689 }
690 
691 void
glGetShaderInfoLog(GLuint shader,GLsizei maxLength,GLsizei * length,char * infoLog)692 glGetShaderInfoLog (GLuint shader, GLsizei maxLength, GLsizei * length,
693 		    char *infoLog)
694 {
695   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
696   vtable->glGetShaderInfoLog (shader, maxLength, length, infoLog);
697 }
698 
699 void
glGetShaderiv(GLuint shader,GLenum pname,GLint * params)700 glGetShaderiv (GLuint shader, GLenum pname, GLint * params)
701 {
702   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
703   vtable->glGetShaderiv (shader, pname, params);
704 }
705 
706 void
glVertexAttribPointer(GLuint index,GLint size,GLenum type,GLboolean normalized,GLsizei stride,const GLvoid * pointer)707 glVertexAttribPointer (GLuint index, GLint size, GLenum type,
708 		       GLboolean normalized, GLsizei stride,
709 		       const GLvoid * pointer)
710 {
711   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
712   vtable->glVertexAttribPointer (index, size, type, normalized, stride,
713 				 pointer);
714 }
715 
716 void
glEnableVertexAttribArray(GLuint index)717 glEnableVertexAttribArray (GLuint index)
718 {
719   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
720   vtable->glEnableVertexAttribArray (index);
721 }
722 
723 void
glDisableVertexAttribArray(GLuint index)724 glDisableVertexAttribArray (GLuint index)
725 {
726   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
727   vtable->glDisableVertexAttribArray (index);
728 }
729 
730 void
glUniform1f(GLint location,GLfloat v0)731 glUniform1f (GLint location, GLfloat v0)
732 {
733   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
734   vtable->glUniform1f (location, v0);
735 }
736 
737 void
glUniform2f(GLint location,GLfloat v0,GLfloat v1)738 glUniform2f (GLint location, GLfloat v0, GLfloat v1)
739 {
740   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
741   vtable->glUniform2f (location, v0, v1);
742 }
743 
744 void
glUniform3f(GLint location,GLfloat v0,GLfloat v1,GLfloat v2)745 glUniform3f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2)
746 {
747   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
748   vtable->glUniform3f (location, v0, v1, v2);
749 }
750 
751 void
glUniform4f(GLint location,GLfloat v0,GLfloat v1,GLfloat v2,GLfloat v3)752 glUniform4f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3)
753 {
754   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
755   vtable->glUniform4f (location, v0, v1, v2, v3);
756 }
757 
758 void
glUniform1fv(GLint location,GLsizei count,const GLfloat * value)759 glUniform1fv (GLint location, GLsizei count, const GLfloat * value)
760 {
761   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
762   vtable->glUniform1fv (location, count, value);
763 }
764 
765 void
glUniform2fv(GLint location,GLsizei count,const GLfloat * value)766 glUniform2fv (GLint location, GLsizei count, const GLfloat * value)
767 {
768   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
769   vtable->glUniform2fv (location, count, value);
770 }
771 
772 void
glUniform3fv(GLint location,GLsizei count,const GLfloat * value)773 glUniform3fv (GLint location, GLsizei count, const GLfloat * value)
774 {
775   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
776   vtable->glUniform3fv (location, count, value);
777 }
778 
779 void
glUniform4fv(GLint location,GLsizei count,const GLfloat * value)780 glUniform4fv (GLint location, GLsizei count, const GLfloat * value)
781 {
782   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
783   vtable->glUniform4fv (location, count, value);
784 }
785 
786 void
glUniform1i(GLint location,GLint v0)787 glUniform1i (GLint location, GLint v0)
788 {
789   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
790   vtable->glUniform1i (location, v0);
791 }
792 
793 void
glUniform2i(GLint location,GLint v0,GLint v1)794 glUniform2i (GLint location, GLint v0, GLint v1)
795 {
796   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
797   vtable->glUniform2i (location, v0, v1);
798 }
799 
800 void
glUniform3i(GLint location,GLint v0,GLint v1,GLint v2)801 glUniform3i (GLint location, GLint v0, GLint v1, GLint v2)
802 {
803   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
804   vtable->glUniform3i (location, v0, v1, v2);
805 }
806 
807 void
glUniform4i(GLint location,GLint v0,GLint v1,GLint v2,GLint v3)808 glUniform4i (GLint location, GLint v0, GLint v1, GLint v2, GLint v3)
809 {
810   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
811   vtable->glUniform4i (location, v0, v1, v2, v3);
812 }
813 
814 void
glUniform1iv(GLint location,GLsizei count,const GLint * value)815 glUniform1iv (GLint location, GLsizei count, const GLint * value)
816 {
817   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
818   vtable->glUniform1iv (location, count, value);
819 }
820 
821 void
glUniform2iv(GLint location,GLsizei count,const GLint * value)822 glUniform2iv (GLint location, GLsizei count, const GLint * value)
823 {
824   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
825   vtable->glUniform2iv (location, count, value);
826 }
827 
828 void
glUniform3iv(GLint location,GLsizei count,const GLint * value)829 glUniform3iv (GLint location, GLsizei count, const GLint * value)
830 {
831   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
832   vtable->glUniform3iv (location, count, value);
833 }
834 
835 void
glUniform4iv(GLint location,GLsizei count,const GLint * value)836 glUniform4iv (GLint location, GLsizei count, const GLint * value)
837 {
838   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
839   vtable->glUniform4iv (location, count, value);
840 }
841 
842 void
glUniformMatrix2fv(GLint location,GLsizei count,GLboolean transpose,const GLfloat * value)843 glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose,
844 		    const GLfloat * value)
845 {
846   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
847   vtable->glUniformMatrix2fv (location, count, transpose, value);
848 }
849 
850 void
glUniformMatrix3fv(GLint location,GLsizei count,GLboolean transpose,const GLfloat * value)851 glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose,
852 		    const GLfloat * value)
853 {
854   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
855   vtable->glUniformMatrix3fv (location, count, transpose, value);
856 }
857 
858 void
glUniformMatrix4fv(GLint location,GLsizei count,GLboolean transpose,const GLfloat * value)859 glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose,
860 		    const GLfloat * value)
861 {
862   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
863   vtable->glUniformMatrix4fv (location, count, transpose, value);
864 }
865 
866 void
glGetUniformfv(GLuint program,GLint location,GLfloat * params)867 glGetUniformfv (GLuint program, GLint location, GLfloat * params)
868 {
869   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
870   vtable->glGetUniformfv (program, location, params);
871 }
872 
873 void
glGetUniformiv(GLuint program,GLint location,GLint * params)874 glGetUniformiv (GLuint program, GLint location, GLint * params)
875 {
876   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
877   vtable->glGetUniformiv (program, location, params);
878 }
879 
880 void
glGetProgramiv(GLuint program,GLenum pname,GLint * params)881 glGetProgramiv (GLuint program, GLenum pname, GLint * params)
882 {
883   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
884   vtable->glGetProgramiv (program, pname, params);
885 }
886 
887 void
glGetProgramInfoLog(GLuint program,GLsizei bufSize,GLsizei * length,char * infoLog)888 glGetProgramInfoLog (GLuint program, GLsizei bufSize, GLsizei * length,
889 		     char *infoLog)
890 {
891   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
892   vtable->glGetProgramInfoLog (program, bufSize, length, infoLog);
893 }
894 
895 void
glVertexAttrib1f(GLuint indx,GLfloat x)896 glVertexAttrib1f (GLuint indx, GLfloat x)
897 {
898   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
899   vtable->glVertexAttrib1f (indx, x);
900 }
901 
902 void
glVertexAttrib1fv(GLuint indx,const GLfloat * values)903 glVertexAttrib1fv (GLuint indx, const GLfloat * values)
904 {
905   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
906   vtable->glVertexAttrib1fv (indx, values);
907 }
908 
909 void
glVertexAttrib2f(GLuint indx,GLfloat x,GLfloat y)910 glVertexAttrib2f (GLuint indx, GLfloat x, GLfloat y)
911 {
912   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
913   vtable->glVertexAttrib2f (indx, x, y);
914 }
915 
916 void
glVertexAttrib2fv(GLuint indx,const GLfloat * values)917 glVertexAttrib2fv (GLuint indx, const GLfloat * values)
918 {
919   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
920   vtable->glVertexAttrib2fv (indx, values);
921 }
922 
923 void
glVertexAttrib3f(GLuint indx,GLfloat x,GLfloat y,GLfloat z)924 glVertexAttrib3f (GLuint indx, GLfloat x, GLfloat y, GLfloat z)
925 {
926   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
927   vtable->glVertexAttrib3f (indx, x, y, z);
928 }
929 
930 void
glVertexAttrib3fv(GLuint indx,const GLfloat * values)931 glVertexAttrib3fv (GLuint indx, const GLfloat * values)
932 {
933   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
934   vtable->glVertexAttrib3fv (indx, values);
935 }
936 
937 void
glVertexAttrib4f(GLuint index,GLfloat x,GLfloat y,GLfloat z,GLfloat w)938 glVertexAttrib4f (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
939 {
940   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
941   vtable->glVertexAttrib4f (index, x, y, z, w);
942 }
943 
944 void
glVertexAttrib4fv(GLuint indx,const GLfloat * values)945 glVertexAttrib4fv (GLuint indx, const GLfloat * values)
946 {
947   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
948   vtable->glVertexAttrib4fv (indx, values);
949 }
950 
951 void
glGetVertexAttribfv(GLuint index,GLenum pname,GLfloat * params)952 glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat * params)
953 {
954   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
955   vtable->glGetVertexAttribfv (index, pname, params);
956 }
957 
958 void
glGetVertexAttribiv(GLuint index,GLenum pname,GLint * params)959 glGetVertexAttribiv (GLuint index, GLenum pname, GLint * params)
960 {
961   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
962   vtable->glGetVertexAttribiv (index, pname, params);
963 }
964 
965 void
glGetVertexAttribPointerv(GLuint index,GLenum pname,GLvoid ** pointer)966 glGetVertexAttribPointerv (GLuint index, GLenum pname, GLvoid ** pointer)
967 {
968   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
969   vtable->glGetVertexAttribPointerv (index, pname, pointer);
970 }
971 
972 GLint
glGetAttribLocation(GLuint program,const char * name)973 glGetAttribLocation (GLuint program, const char *name)
974 {
975   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
976   return vtable->glGetAttribLocation (program, name);
977 }
978 
979 void
glBindAttribLocation(GLuint program,GLuint index,const GLchar * name)980 glBindAttribLocation (GLuint program, GLuint index, const GLchar * name)
981 {
982   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
983   vtable->glBindAttribLocation (program, index, name);
984 }
985 
986 void
glGetActiveAttrib(GLuint program,GLuint index,GLsizei bufsize,GLsizei * length,GLint * size,GLenum * type,GLchar * name)987 glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufsize,
988 		   GLsizei * length, GLint * size, GLenum * type,
989 		   GLchar * name)
990 {
991   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
992   vtable->glGetActiveAttrib (program, index, bufsize, length, size, type,
993 			     name);
994 }
995 
996 void
glGetActiveUniform(GLuint program,GLuint index,GLsizei bufsize,GLsizei * length,GLint * size,GLenum * type,GLchar * name)997 glGetActiveUniform (GLuint program, GLuint index, GLsizei bufsize,
998 		    GLsizei * length, GLint * size, GLenum * type,
999 		    GLchar * name)
1000 {
1001   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
1002   vtable->glGetActiveUniform (program, index, bufsize, length, size, type,
1003 			      name);
1004 }
1005 
1006 void
glDetachShader(GLuint program,GLuint shader)1007 glDetachShader (GLuint program, GLuint shader)
1008 {
1009   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
1010   vtable->glDetachShader (program, shader);
1011 }
1012 
1013 void
glGetAttachedShaders(GLuint program,GLsizei maxcount,GLsizei * count,GLuint * shaders)1014 glGetAttachedShaders (GLuint program, GLsizei maxcount, GLsizei * count,
1015 		      GLuint * shaders)
1016 {
1017   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
1018   vtable->glGetAttachedShaders (program, maxcount, count, shaders);
1019 }
1020 
1021 void
glGetShaderSource(GLuint shader,GLsizei bufsize,GLsizei * length,GLchar * source)1022 glGetShaderSource (GLuint shader, GLsizei bufsize, GLsizei * length,
1023 		   GLchar * source)
1024 {
1025   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
1026   vtable->glGetShaderSource (shader, bufsize, length, source);
1027 }
1028 
1029 GLboolean
glIsShader(GLuint shader)1030 glIsShader (GLuint shader)
1031 {
1032   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
1033   return vtable->glIsShader (shader);
1034 }
1035 
1036 GLboolean
glIsProgram(GLuint program)1037 glIsProgram (GLuint program)
1038 {
1039   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
1040   return vtable->glIsProgram (program);
1041 }
1042 
1043 void
glValidateProgram(GLuint program)1044 glValidateProgram (GLuint program)
1045 {
1046   CoglGLES2Vtable *vtable = cogl_gles2_get_current_vtable ();
1047   vtable->glValidateProgram (program);
1048 }
1049