tizen 2.4 release
[framework/graphics/coregl.git] / src / wraps / coregl_gl.c
1 #include <stdio.h>
2 #include <dlfcn.h>
3
4 # include <GLES/glplatform.h>
5 # include "../headers/gl.h"
6
7 ///////////////////////////////////////
8 // Disable dlog for debugging urgent issues //
9 //#define LOG_TAG "CoreGL_GLES2"
10 //#include <dlog.h>
11 #define LOGE(...) fprintf(stderr, __VA_ARGS__)
12 #define LOGW(...) fprintf(stderr, __VA_ARGS__)
13 #define LOGD(...) fprintf(stderr, __VA_ARGS__)
14 ///////////////////////////////////////
15
16 #define COREGL_API           __attribute__((visibility("default")))
17
18 #define _COREGL_SYMBOL(RET_TYPE, FUNC_NAME, PARAM_LIST)     COREGL_API extern RET_TYPE FUNC_NAME PARAM_LIST;
19 #define _COREGL_EXT_SYMBOL(RET_TYPE, FUNC_NAME, PARAM_LIST)
20 # include "../headers/sym_gl.h"
21 #undef _COREGL_EXT_SYMBOL
22 #undef _COREGL_SYMBOL
23
24 #define _COREGL_SYMBOL(RET_TYPE, FUNC_NAME, PARAM_LIST)     RET_TYPE (*ovr_##FUNC_NAME) PARAM_LIST = NULL;
25 #define _COREGL_EXT_SYMBOL(RET_TYPE, FUNC_NAME, PARAM_LIST)
26 # include "../headers/sym_gl.h"
27 #undef _COREGL_EXT_SYMBOL
28 #undef _COREGL_SYMBOL
29
30 #define INIT_EXPORT()
31
32 void *lib_handle = NULL;
33
34 __attribute__((constructor))
35 int
36 coregl_glwrap_init()
37 {
38         lib_handle = dlopen("libCOREGL.so", RTLD_NOW);
39         if (!lib_handle)
40         {
41                 LOGE(" \E[40;31;1m%s\E[0m\n\n", dlerror());
42                 LOGE(" \E[40;31;1mInvalid library link! (Check linkage of libEGL -> libCOREGL)\E[0m\n");
43                 return 0;
44         }
45
46 #define _COREGL_SYMBOL(RET_TYPE, FUNC_NAME, PARAM_LIST) \
47    ovr_##FUNC_NAME = (__typeof__(ovr_##FUNC_NAME))dlsym(lib_handle, "coregl_api_"#FUNC_NAME); \
48         if (ovr_##FUNC_NAME == NULL) \
49         { \
50                 LOGE("\E[40;31;1mCan't find a symbol '%s'!\E[0m\n\n", #FUNC_NAME); \
51                 LOGE("\E[40;31;1mInvalid library link! (Check linkage of libGLESv2 -> libCOREGL)\E[0m\n"); \
52         }
53
54 #define _COREGL_EXT_SYMBOL(RET_TYPE, FUNC_NAME, PARAM_LIST)
55 #include "../headers/sym_gl.h"
56 #undef _COREGL_EXT_SYMBOL
57 #undef _COREGL_SYMBOL
58
59         return 1;
60 }
61
62 void
63 glActiveTexture(GLenum texture)
64 {
65         ovr_glActiveTexture(texture);
66 }
67
68 void
69 glAttachShader(GLuint program, GLuint shader)
70 {
71         ovr_glAttachShader(program, shader);
72 }
73
74 void
75 glBindAttribLocation(GLuint program, GLuint index, const char* name)
76 {
77         ovr_glBindAttribLocation(program, index, name);
78 }
79
80 void
81 glBindBuffer(GLenum target, GLuint buffer)
82 {
83         ovr_glBindBuffer(target, buffer);
84 }
85
86 void
87 glBindFramebuffer(GLenum target, GLuint framebuffer)
88 {
89         ovr_glBindFramebuffer(target, framebuffer);
90 }
91
92 void
93 glBindRenderbuffer(GLenum target, GLuint renderbuffer)
94 {
95         ovr_glBindRenderbuffer(target, renderbuffer);
96 }
97
98 void
99 glBindTexture(GLenum target, GLuint texture)
100 {
101         ovr_glBindTexture(target, texture);
102 }
103
104 void
105 glBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
106 {
107         ovr_glBlendColor(red, green, blue, alpha);
108 }
109
110 void
111 glBlendEquation(GLenum mode)
112 {
113         ovr_glBlendEquation(mode);
114 }
115
116 void
117 glBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha)
118 {
119         ovr_glBlendEquationSeparate(modeRGB, modeAlpha);
120 }
121
122 void
123 glBlendFunc(GLenum sfactor, GLenum dfactor)
124 {
125         ovr_glBlendFunc(sfactor, dfactor);
126 }
127
128 void
129 glBlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
130 {
131         ovr_glBlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha);
132 }
133
134 void
135 glBufferData(GLenum target, GLsizeiptr size, const void* data, GLenum usage)
136 {
137         ovr_glBufferData(target, size, data, usage);
138 }
139
140 void
141 glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const void* data)
142 {
143         ovr_glBufferSubData(target, offset, size, data);
144 }
145
146 GLenum
147 glCheckFramebufferStatus(GLenum target)
148 {
149         return ovr_glCheckFramebufferStatus(target);
150 }
151
152 void
153 glClear(GLbitfield mask)
154 {
155         ovr_glClear(mask);
156 }
157
158 void
159 glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
160 {
161         ovr_glClearColor(red, green, blue, alpha);
162 }
163
164 void
165 glClearDepthf(GLclampf depth)
166 {
167         ovr_glClearDepthf(depth);
168 }
169
170 void
171 glClearStencil(GLint s)
172 {
173         ovr_glClearStencil(s);
174 }
175
176 void
177 glColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
178 {
179         ovr_glColorMask(red, green, blue, alpha);
180 }
181
182 void
183 glCompileShader(GLuint shader)
184 {
185         ovr_glCompileShader(shader);
186 }
187
188 void
189 glCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data)
190 {
191         ovr_glCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data);
192 }
193
194 void
195 glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data)
196 {
197         ovr_glCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data);
198 }
199
200 void
201 glCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
202 {
203         ovr_glCopyTexImage2D(target, level, internalformat, x, y, width, height, border);
204 }
205
206 void
207 glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
208 {
209         ovr_glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height);
210 }
211
212 GLuint
213 glCreateProgram(void)
214 {
215         return ovr_glCreateProgram();
216 }
217
218 GLuint
219 glCreateShader(GLenum type)
220 {
221         return ovr_glCreateShader(type);
222 }
223
224 void
225 glCullFace(GLenum mode)
226 {
227         ovr_glCullFace(mode);
228 }
229
230 void
231 glDeleteBuffers(GLsizei n, const GLuint* buffers)
232 {
233         ovr_glDeleteBuffers(n, buffers);
234 }
235
236 void
237 glDeleteFramebuffers(GLsizei n, const GLuint* framebuffers)
238 {
239         ovr_glDeleteFramebuffers(n, framebuffers);
240 }
241
242 void
243 glDeleteProgram(GLuint program)
244 {
245         ovr_glDeleteProgram(program);
246 }
247
248 void
249 glDeleteRenderbuffers(GLsizei n, const GLuint* renderbuffers)
250 {
251         ovr_glDeleteRenderbuffers(n, renderbuffers);
252 }
253
254 void
255 glDeleteShader(GLuint shader)
256 {
257         ovr_glDeleteShader(shader);
258 }
259
260 void
261 glDeleteTextures(GLsizei n, const GLuint* textures)
262 {
263         ovr_glDeleteTextures(n, textures);
264 }
265
266 void
267 glDepthFunc(GLenum func)
268 {
269         ovr_glDepthFunc(func);
270 }
271
272 void
273 glDepthMask(GLboolean flag)
274 {
275         ovr_glDepthMask(flag);
276 }
277
278 void
279 glDepthRangef(GLclampf zNear, GLclampf zFar)
280 {
281         ovr_glDepthRangef(zNear, zFar);
282 }
283
284 void
285 glDetachShader(GLuint program, GLuint shader)
286 {
287         ovr_glDetachShader(program, shader);
288 }
289
290 void
291 glDisable(GLenum cap)
292 {
293         ovr_glDisable(cap);
294 }
295
296 void
297 glDisableVertexAttribArray(GLuint index)
298 {
299         ovr_glDisableVertexAttribArray(index);
300 }
301
302 void
303 glDrawArrays(GLenum mode, GLint first, GLsizei count)
304 {
305         ovr_glDrawArrays(mode, first, count);
306 }
307
308 void
309 glDrawElements(GLenum mode, GLsizei count, GLenum type, const void* indices)
310 {
311         ovr_glDrawElements(mode, count, type, indices);
312 }
313
314 void
315 glEnable(GLenum cap)
316 {
317         ovr_glEnable(cap);
318 }
319
320 void
321 glEnableVertexAttribArray(GLuint index)
322 {
323         ovr_glEnableVertexAttribArray(index);
324 }
325
326 void
327 glFinish(void)
328 {
329         ovr_glFinish();
330 }
331
332 void
333 glFlush(void)
334 {
335         ovr_glFlush();
336 }
337
338 void
339 glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
340 {
341         ovr_glFramebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer);
342 }
343
344 void
345 glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
346 {
347         ovr_glFramebufferTexture2D(target, attachment, textarget, texture, level);
348 }
349
350 void
351 glFrontFace(GLenum mode)
352 {
353         ovr_glFrontFace(mode);
354 }
355
356 void
357 glGetVertexAttribfv(GLuint index, GLenum pname, GLfloat* params)
358 {
359         ovr_glGetVertexAttribfv(index, pname, params);
360 }
361
362 void
363 glGetVertexAttribiv(GLuint index, GLenum pname, GLint* params)
364 {
365         ovr_glGetVertexAttribiv(index, pname, params);
366 }
367
368 void
369 glGetVertexAttribPointerv(GLuint index, GLenum pname, void** pointer)
370 {
371         ovr_glGetVertexAttribPointerv(index, pname, pointer);
372 }
373
374 void
375 glHint(GLenum target, GLenum mode)
376 {
377         ovr_glHint(target, mode);
378 }
379
380 void
381 glGenBuffers(GLsizei n, GLuint* buffers)
382 {
383         ovr_glGenBuffers(n, buffers);
384 }
385
386 void
387 glGenerateMipmap(GLenum target)
388 {
389         ovr_glGenerateMipmap(target);
390 }
391
392 void
393 glGenFramebuffers(GLsizei n, GLuint* framebuffers)
394 {
395         ovr_glGenFramebuffers(n, framebuffers);
396 }
397
398 void
399 glGenRenderbuffers(GLsizei n, GLuint* renderbuffers)
400 {
401         ovr_glGenRenderbuffers(n, renderbuffers);
402 }
403
404 void
405 glGenTextures(GLsizei n, GLuint* textures)
406 {
407         ovr_glGenTextures(n, textures);
408 }
409
410 void
411 glGetActiveAttrib(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name)
412 {
413         ovr_glGetActiveAttrib(program, index, bufsize, length, size, type, name);
414 }
415
416 void
417 glGetActiveUniform(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name)
418 {
419         ovr_glGetActiveUniform(program, index, bufsize, length, size, type, name);
420 }
421
422 void
423 glGetAttachedShaders(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders)
424 {
425         ovr_glGetAttachedShaders(program, maxcount, count, shaders);
426 }
427
428 int
429 glGetAttribLocation(GLuint program, const char* name)
430 {
431         return ovr_glGetAttribLocation(program, name);
432 }
433
434 void
435 glGetBooleanv(GLenum pname, GLboolean* params)
436 {
437         ovr_glGetBooleanv(pname, params);
438 }
439
440 void
441 glGetBufferParameteriv(GLenum target, GLenum pname, GLint* params)
442 {
443         ovr_glGetBufferParameteriv(target, pname, params);
444 }
445
446 GLenum
447 glGetError(void)
448 {
449         return ovr_glGetError();
450 }
451
452 void
453 glGetFloatv(GLenum pname, GLfloat* params)
454 {
455         ovr_glGetFloatv(pname, params);
456 }
457
458 void
459 glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint* params)
460 {
461         ovr_glGetFramebufferAttachmentParameteriv(target, attachment, pname, params);
462 }
463
464 void
465 glGetIntegerv(GLenum pname, GLint* params)
466 {
467         ovr_glGetIntegerv(pname, params);
468 }
469
470 void
471 glGetProgramiv(GLuint program, GLenum pname, GLint* params)
472 {
473         ovr_glGetProgramiv(program, pname, params);
474 }
475
476 void
477 glGetProgramInfoLog(GLuint program, GLsizei bufsize, GLsizei* length, char* infolog)
478 {
479         ovr_glGetProgramInfoLog(program, bufsize, length, infolog);
480 }
481
482 void
483 glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* params)
484 {
485         ovr_glGetRenderbufferParameteriv(target, pname, params);
486 }
487
488 void
489 glGetShaderiv(GLuint shader, GLenum pname, GLint* params)
490 {
491         ovr_glGetShaderiv(shader, pname, params);
492 }
493
494 void
495 glGetShaderInfoLog(GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog)
496 {
497         ovr_glGetShaderInfoLog(shader, bufsize, length, infolog);
498 }
499
500 void
501 glGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision)
502 {
503         ovr_glGetShaderPrecisionFormat(shadertype, precisiontype, range, precision);
504 }
505
506 void
507 glGetShaderSource(GLuint shader, GLsizei bufsize, GLsizei* length, char* source)
508 {
509         ovr_glGetShaderSource(shader, bufsize, length, source);
510 }
511
512 const GLubyte *
513 glGetString(GLenum name)
514 {
515         return ovr_glGetString(name);
516 }
517
518 void
519 glGetTexParameterfv(GLenum target, GLenum pname, GLfloat* params)
520 {
521         ovr_glGetTexParameterfv(target, pname, params);
522 }
523
524 void
525 glGetTexParameteriv(GLenum target, GLenum pname, GLint* params)
526 {
527         ovr_glGetTexParameteriv(target, pname, params);
528 }
529
530 void
531 glGetUniformfv(GLuint program, GLint location, GLfloat* params)
532 {
533         ovr_glGetUniformfv(program, location, params);
534 }
535
536 void
537 glGetUniformiv(GLuint program, GLint location, GLint* params)
538 {
539         ovr_glGetUniformiv(program, location, params);
540 }
541
542 int
543 glGetUniformLocation(GLuint program, const char* name)
544 {
545         return ovr_glGetUniformLocation(program, name);
546 }
547
548 GLboolean
549 glIsBuffer(GLuint buffer)
550 {
551         return ovr_glIsBuffer(buffer);
552 }
553
554 GLboolean
555 glIsEnabled(GLenum cap)
556 {
557         return ovr_glIsEnabled(cap);
558 }
559
560 GLboolean
561 glIsFramebuffer(GLuint framebuffer)
562 {
563         return ovr_glIsFramebuffer(framebuffer);
564 }
565
566 GLboolean
567 glIsProgram(GLuint program)
568 {
569         return ovr_glIsProgram(program);
570 }
571
572 GLboolean
573 glIsRenderbuffer(GLuint renderbuffer)
574 {
575         return ovr_glIsRenderbuffer(renderbuffer);
576 }
577
578 GLboolean
579 glIsShader(GLuint shader)
580 {
581         return ovr_glIsShader(shader);
582 }
583
584 GLboolean
585 glIsTexture(GLuint texture)
586 {
587         return ovr_glIsTexture(texture);
588 }
589
590 void
591 glLineWidth(GLfloat width)
592 {
593         ovr_glLineWidth(width);
594 }
595
596 void
597 glLinkProgram(GLuint program)
598 {
599         ovr_glLinkProgram(program);
600 }
601
602 void
603 glPixelStorei(GLenum pname, GLint param)
604 {
605         ovr_glPixelStorei(pname, param);
606 }
607
608 void
609 glPolygonOffset(GLfloat factor, GLfloat units)
610 {
611         ovr_glPolygonOffset(factor, units);
612 }
613
614 void
615 glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void* pixels)
616 {
617         ovr_glReadPixels(x, y, width, height, format, type, pixels);
618 }
619
620 void
621 glReleaseShaderCompiler(void)
622 {
623         ovr_glReleaseShaderCompiler();
624 }
625
626 void
627 glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
628 {
629         ovr_glRenderbufferStorage(target, internalformat, width, height);
630 }
631
632 void
633 glSampleCoverage(GLclampf value, GLboolean invert)
634 {
635         ovr_glSampleCoverage(value, invert);
636 }
637
638 void
639 glScissor(GLint x, GLint y, GLsizei width, GLsizei height)
640 {
641         ovr_glScissor(x, y, width, height);
642 }
643
644 void
645 glShaderBinary(GLsizei n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLsizei length)
646 {
647         ovr_glShaderBinary(n, shaders, binaryformat, binary, length);
648 }
649
650 void
651 glShaderSource(GLuint shader, GLsizei count, const char** string, const GLint* length)
652 {
653         ovr_glShaderSource(shader, count, string, length);
654 }
655
656 void
657 glStencilFunc(GLenum func, GLint ref, GLuint mask)
658 {
659         ovr_glStencilFunc(func, ref, mask);
660 }
661
662 void
663 glStencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask)
664 {
665         ovr_glStencilFuncSeparate(face, func, ref, mask);
666 }
667
668 void
669 glStencilMask(GLuint mask)
670 {
671         ovr_glStencilMask(mask);
672 }
673
674 void
675 glStencilMaskSeparate(GLenum face, GLuint mask)
676 {
677         ovr_glStencilMaskSeparate(face, mask);
678 }
679
680 void
681 glStencilOp(GLenum fail, GLenum zfail, GLenum zpass)
682 {
683         ovr_glStencilOp(fail, zfail, zpass);
684 }
685
686 void
687 glStencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass)
688 {
689         ovr_glStencilOpSeparate(face, fail, zfail, zpass);
690 }
691
692 void
693 glTexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void* pixels)
694 {
695         ovr_glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels);
696 }
697
698 void
699 glTexParameterf(GLenum target, GLenum pname, GLfloat param)
700 {
701         ovr_glTexParameterf(target, pname, param);
702 }
703
704 void
705 glTexParameterfv(GLenum target, GLenum pname, const GLfloat* params)
706 {
707         ovr_glTexParameterfv(target, pname, params);
708 }
709
710 void
711 glTexParameteri(GLenum target, GLenum pname, GLint param)
712 {
713         ovr_glTexParameteri(target, pname, param);
714 }
715
716 void
717 glTexParameteriv(GLenum target, GLenum pname, const GLint* params)
718 {
719         ovr_glTexParameteriv(target, pname, params);
720 }
721
722 void
723 glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels)
724 {
725         ovr_glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels);
726 }
727
728 void
729 glUniform1f(GLint location, GLfloat x)
730 {
731         ovr_glUniform1f(location, x);
732 }
733
734 void
735 glUniform1fv(GLint location, GLsizei count, const GLfloat* v)
736 {
737         ovr_glUniform1fv(location, count, v);
738 }
739
740 void
741 glUniform1i(GLint location, GLint x)
742 {
743         ovr_glUniform1i(location, x);
744 }
745
746 void
747 glUniform1iv(GLint location, GLsizei count, const GLint* v)
748 {
749         ovr_glUniform1iv(location, count, v);
750 }
751
752 void
753 glUniform2f(GLint location, GLfloat x, GLfloat y)
754 {
755         ovr_glUniform2f(location, x, y);
756 }
757
758 void
759 glUniform2fv(GLint location, GLsizei count, const GLfloat* v)
760 {
761         ovr_glUniform2fv(location, count, v);
762 }
763
764 void
765 glUniform2i(GLint location, GLint x, GLint y)
766 {
767         ovr_glUniform2i(location, x, y);
768 }
769
770 void
771 glUniform2iv(GLint location, GLsizei count, const GLint* v)
772 {
773         ovr_glUniform2iv(location, count, v);
774 }
775
776 void
777 glUniform3f(GLint location, GLfloat x, GLfloat y, GLfloat z)
778 {
779         ovr_glUniform3f(location, x, y, z);
780 }
781
782 void
783 glUniform3fv(GLint location, GLsizei count, const GLfloat* v)
784 {
785         ovr_glUniform3fv(location, count, v);
786 }
787
788 void
789 glUniform3i(GLint location, GLint x, GLint y, GLint z)
790 {
791         ovr_glUniform3i(location, x, y, z);
792 }
793
794 void
795 glUniform3iv(GLint location, GLsizei count, const GLint* v)
796 {
797         ovr_glUniform3iv(location, count, v);
798 }
799
800 void
801 glUniform4f(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
802 {
803         ovr_glUniform4f(location, x, y, z, w);
804 }
805
806 void
807 glUniform4fv(GLint location, GLsizei count, const GLfloat* v)
808 {
809         ovr_glUniform4fv(location, count, v);
810 }
811
812 void
813 glUniform4i(GLint location, GLint x, GLint y, GLint z, GLint w)
814 {
815         ovr_glUniform4i(location, x, y, z, w);
816 }
817
818 void
819 glUniform4iv(GLint location, GLsizei count, const GLint* v)
820 {
821         ovr_glUniform4iv(location, count, v);
822 }
823
824 void
825 glUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
826 {
827         ovr_glUniformMatrix2fv(location, count, transpose, value);
828 }
829
830 void
831 glUniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
832 {
833         ovr_glUniformMatrix3fv(location, count, transpose, value);
834 }
835
836 void
837 glUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
838 {
839         ovr_glUniformMatrix4fv(location, count, transpose, value);
840 }
841
842 void
843 glUseProgram(GLuint program)
844 {
845         ovr_glUseProgram(program);
846 }
847
848 void
849 glValidateProgram(GLuint program)
850 {
851         ovr_glValidateProgram(program);
852 }
853
854 void
855 glVertexAttrib1f(GLuint index, GLfloat x)
856 {
857         ovr_glVertexAttrib1f(index, x);
858 }
859
860 void
861 glVertexAttrib1fv(GLuint index, const GLfloat* values)
862 {
863         ovr_glVertexAttrib1fv(index, values);
864 }
865
866 void
867 glVertexAttrib2f(GLuint index, GLfloat x, GLfloat y)
868 {
869         ovr_glVertexAttrib2f(index, x, y);
870 }
871
872 void
873 glVertexAttrib2fv(GLuint index, const GLfloat* values)
874 {
875         ovr_glVertexAttrib2fv(index, values);
876 }
877
878 void
879 glVertexAttrib3f(GLuint index, GLfloat x, GLfloat y, GLfloat z)
880 {
881         ovr_glVertexAttrib3f(index, x, y, z);
882 }
883
884 void
885 glVertexAttrib3fv(GLuint index, const GLfloat* values)
886 {
887         ovr_glVertexAttrib3fv(index, values);
888 }
889
890 void
891 glVertexAttrib4f(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
892 {
893         ovr_glVertexAttrib4f(index, x, y, z, w);
894 }
895
896 void
897 glVertexAttrib4fv(GLuint index, const GLfloat* values)
898 {
899         ovr_glVertexAttrib4fv(index, values);
900 }
901
902 void
903 glVertexAttribPointer(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* pointer)
904 {
905         ovr_glVertexAttribPointer(index, size, type, normalized, stride, pointer);
906 }
907
908 void
909 glViewport(GLint x, GLint y, GLsizei width, GLsizei height)
910 {
911         ovr_glViewport(x, y, width, height);
912 }
913
914 /* OpenGL ES 3.0 */
915 void
916 glReadBuffer(GLenum mode)
917 {
918         ovr_glReadBuffer(mode);
919 }
920
921 void
922 glDrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid* indices)
923 {
924         ovr_glDrawRangeElements(mode, start, end, count, type, indices);
925 }
926
927 void
928 glTexImage3D(GLenum target, GLint level, GLint GLinternalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
929 {
930         ovr_glTexImage3D(target, level, GLinternalFormat, width, height, depth, border, format, type, pixels);
931 }
932
933 void
934 glTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels)
935 {
936         ovr_glTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);
937 }
938
939 void
940 glCopyTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height)
941 {
942         ovr_glCopyTexSubImage3D(target, level, xoffset, yoffset, zoffset, x, y, width, height);
943 }
944
945 void
946 glCompressedTexImage3D(GLenum target, GLint level, GLenum GLinternalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data)
947 {
948         ovr_glCompressedTexImage3D(target, level, GLinternalformat, width, height, depth, border, imageSize, data);
949 }
950
951 void
952 glCompressedTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data)
953 {
954         ovr_glCompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data);
955 }
956
957 void
958 glGenQueries(GLsizei n, GLuint* ids)
959 {
960         ovr_glGenQueries(n, ids);
961 }
962
963 void
964 glDeleteQueries(GLsizei n, const GLuint* ids)
965 {
966         ovr_glDeleteQueries(n, ids);
967 }
968
969 GLboolean
970 glIsQuery(GLuint id)
971 {
972         return ovr_glIsQuery(id);
973 }
974
975 void
976 glBeginQuery(GLenum target, GLuint id)
977 {
978         ovr_glBeginQuery(target, id);
979 }
980
981 void
982 glEndQuery(GLenum target)
983 {
984         ovr_glEndQuery(target);
985 }
986
987 void
988 glGetQueryiv(GLenum target, GLenum pname, GLint* params)
989 {
990         ovr_glGetQueryiv(target, pname, params);
991 }
992
993 void
994 glGetQueryObjectuiv(GLuint id, GLenum pname, GLuint* params)
995 {
996         ovr_glGetQueryObjectuiv(id, pname, params);
997 }
998
999 GLboolean
1000 glUnmapBuffer(GLenum target)
1001 {
1002         return ovr_glUnmapBuffer(target);
1003 }
1004
1005 void
1006 glGetBufferPointerv(GLenum target, GLenum pname, GLvoid** params)
1007 {
1008         ovr_glGetBufferPointerv(target, pname, params);
1009 }
1010
1011 void
1012 glDrawBuffers(GLsizei n, const GLenum* bufs)
1013 {
1014         ovr_glDrawBuffers(n, bufs);
1015 }
1016
1017 void
1018 glUniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
1019 {
1020         ovr_glUniformMatrix2x3fv(location, count, transpose, value);
1021 }
1022
1023 void
1024 glUniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
1025 {
1026         ovr_glUniformMatrix3x2fv(location, count, transpose, value);
1027 }
1028
1029 void
1030 glUniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
1031 {
1032         ovr_glUniformMatrix2x4fv(location, count, transpose, value);
1033 }
1034
1035 void
1036 glUniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
1037 {
1038         ovr_glUniformMatrix4x2fv(location, count, transpose, value);
1039 }
1040
1041 void
1042 glUniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
1043 {
1044         ovr_glUniformMatrix3x4fv(location, count, transpose, value);
1045 }
1046
1047 void
1048 glUniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
1049 {
1050         ovr_glUniformMatrix4x3fv(location, count, transpose, value);
1051 }
1052
1053 void
1054 glBlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter)
1055 {
1056         ovr_glBlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
1057 }
1058
1059 void
1060 glRenderbufferStorageMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
1061 {
1062         ovr_glRenderbufferStorageMultisample(target, samples, internalformat, width, height);
1063 }
1064
1065 void
1066 glFramebufferTextureLayer(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer)
1067 {
1068         ovr_glFramebufferTextureLayer(target, attachment, texture, level, layer);
1069 }
1070
1071 GLvoid*
1072 glMapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access)
1073 {
1074         return ovr_glMapBufferRange(target, offset, length, access);
1075 }
1076
1077 void
1078 glFlushMappedBufferRange(GLenum target, GLintptr offset, GLsizeiptr length)
1079 {
1080         ovr_glFlushMappedBufferRange(target, offset, length);
1081 }
1082
1083 void
1084 glBindVertexArray(GLuint array)
1085 {
1086         ovr_glBindVertexArray(array);
1087 }
1088
1089 void
1090 glDeleteVertexArrays(GLsizei n, const GLuint* arrays)
1091 {
1092         ovr_glDeleteVertexArrays(n, arrays);
1093 }
1094
1095 void
1096 glGenVertexArrays(GLsizei n, GLuint* arrays)
1097 {
1098         ovr_glGenVertexArrays(n, arrays);
1099 }
1100
1101 GLboolean
1102 glIsVertexArray(GLuint array)
1103 {
1104         return ovr_glIsVertexArray(array);
1105 }
1106
1107 void
1108 glGetIntegeri_v(GLenum target, GLuint index, GLint* data)
1109 {
1110         ovr_glGetIntegeri_v(target, index, data);
1111 }
1112
1113 void
1114 glBeginTransformFeedback(GLenum primitiveMode)
1115 {
1116         ovr_glBeginTransformFeedback(primitiveMode);
1117 }
1118
1119 void
1120 glEndTransformFeedback()
1121 {
1122         ovr_glEndTransformFeedback();
1123 }
1124
1125 void
1126 glBindBufferRange(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size)
1127 {
1128         ovr_glBindBufferRange(target, index, buffer, offset, size);
1129 }
1130
1131 void
1132 glBindBufferBase(GLenum target, GLuint index, GLuint buffer)
1133 {
1134         ovr_glBindBufferBase(target, index, buffer);
1135 }
1136
1137 void
1138 glTransformFeedbackVaryings(GLuint program, GLsizei count, const GLchar* const* varyings, GLenum bufferMode)
1139 {
1140         ovr_glTransformFeedbackVaryings(program, count, varyings, bufferMode);
1141 }
1142
1143 void
1144 glGetTransformFeedbackVarying(GLuint program, GLuint index, GLsizei bufSize, GLsizei* length, GLsizei* size, GLenum* type, GLchar* name)
1145 {
1146         ovr_glGetTransformFeedbackVarying(program, index, bufSize, length, size, type, name);
1147 }
1148
1149 void
1150 glVertexAttribIPointer(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid* pointer)
1151 {
1152         ovr_glVertexAttribIPointer(index, size, type, stride, pointer);
1153 }
1154
1155 void
1156 glGetVertexAttribIiv(GLuint index, GLenum pname, GLint* params)
1157 {
1158         ovr_glGetVertexAttribIiv(index, pname, params);
1159 }
1160
1161 void
1162 glGetVertexAttribIuiv(GLuint index, GLenum pname, GLuint* params)
1163 {
1164         ovr_glGetVertexAttribIuiv(index, pname, params);
1165 }
1166
1167 void
1168 glVertexAttribI4i(GLuint index, GLint x, GLint y, GLint z, GLint w)
1169 {
1170         ovr_glVertexAttribI4i(index, x, y, z, w);
1171 }
1172
1173 void
1174 glVertexAttribI4ui(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w)
1175 {
1176         ovr_glVertexAttribI4ui(index, x, y, z, w);
1177 }
1178
1179 void
1180 glVertexAttribI4iv(GLuint index, const GLint* v)
1181 {
1182         ovr_glVertexAttribI4iv(index, v);
1183 }
1184
1185 void
1186 glVertexAttribI4uiv(GLuint index, const GLuint* v)
1187 {
1188         ovr_glVertexAttribI4uiv(index, v);
1189 }
1190
1191 void
1192 glGetUniformuiv(GLuint program, GLint location, GLuint* params)
1193 {
1194         ovr_glGetUniformuiv(program, location, params);
1195 }
1196
1197 GLint
1198 glGetFragDataLocation(GLuint program, const GLchar *name)
1199 {
1200         return ovr_glGetFragDataLocation(program, name);
1201 }
1202
1203 void
1204 glUniform1ui(GLint location, GLuint v0)
1205 {
1206         ovr_glUniform1ui(location, v0);
1207 }
1208
1209 void
1210 glUniform2ui(GLint location, GLuint v0, GLuint v1)
1211 {
1212         ovr_glUniform2ui(location, v0, v1);
1213 }
1214
1215 void
1216 glUniform3ui(GLint location, GLuint v0, GLuint v1, GLuint v2)
1217 {
1218         ovr_glUniform3ui(location, v0, v1, v2);
1219 }
1220
1221 void
1222 glUniform4ui(GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3)
1223 {
1224         ovr_glUniform4ui(location, v0, v1, v2, v3);
1225 }
1226
1227 void
1228 glUniform1uiv(GLint location, GLsizei count, const GLuint* value)
1229 {
1230         ovr_glUniform1uiv(location, count, value);
1231 }
1232
1233 void
1234 glUniform2uiv(GLint location, GLsizei count, const GLuint* value)
1235 {
1236         ovr_glUniform2uiv(location, count, value);
1237 }
1238
1239 void
1240 glUniform3uiv(GLint location, GLsizei count, const GLuint* value)
1241 {
1242         ovr_glUniform3uiv(location, count, value);
1243 }
1244
1245 void
1246 glUniform4uiv(GLint location, GLsizei count, const GLuint* value)
1247 {
1248         ovr_glUniform4uiv(location, count, value);
1249 }
1250
1251 void
1252 glClearBufferiv(GLenum buffer, GLint drawbuffer, const GLint* value)
1253 {
1254         ovr_glClearBufferiv(buffer, drawbuffer, value);
1255 }
1256
1257 void
1258 glClearBufferuiv(GLenum buffer, GLint drawbuffer, const GLuint* value)
1259 {
1260         ovr_glClearBufferuiv(buffer, drawbuffer, value);
1261 }
1262
1263 void
1264 glClearBufferfv(GLenum buffer, GLint drawbuffer, const GLfloat* value)
1265 {
1266         ovr_glClearBufferfv(buffer, drawbuffer, value);
1267 }
1268
1269 void
1270 glClearBufferfi(GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil)
1271 {
1272         ovr_glClearBufferfi(buffer, drawbuffer, depth, stencil);
1273 }
1274
1275 const GLubyte*
1276 glGetStringi(GLenum name, GLuint index)
1277 {
1278         return ovr_glGetStringi(name, index);
1279 }
1280
1281 void
1282 glCopyBufferSubData(GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size)
1283 {
1284         ovr_glCopyBufferSubData(readTarget, writeTarget, readOffset, writeOffset, size);
1285 }
1286
1287 void
1288 glGetUniformIndices(GLuint program, GLsizei uniformCount, const GLchar* const* uniformNames, GLuint* uniformIndices)
1289 {
1290         ovr_glGetUniformIndices(program, uniformCount, uniformNames, uniformIndices);
1291 }
1292
1293 void
1294 glGetActiveUniformsiv(GLuint program, GLsizei uniformCount, const GLuint* uniformIndices, GLenum pname, GLint* params)
1295 {
1296         ovr_glGetActiveUniformsiv(program, uniformCount, uniformIndices, pname, params);
1297 }
1298
1299 GLuint
1300 glGetUniformBlockIndex(GLuint program, const GLchar* uniformBlockName)
1301 {
1302         return ovr_glGetUniformBlockIndex(program, uniformBlockName);
1303 }
1304
1305 void
1306 glGetActiveUniformBlockiv(GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint* params)
1307 {
1308         ovr_glGetActiveUniformBlockiv(program, uniformBlockIndex, pname, params);
1309 }
1310
1311 void
1312 glGetActiveUniformBlockName(GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei* length, GLchar* uniformBlockName)
1313 {
1314         ovr_glGetActiveUniformBlockName(program, uniformBlockIndex, bufSize, length, uniformBlockName);
1315 }
1316
1317 void
1318 glUniformBlockBinding(GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding)
1319 {
1320         ovr_glUniformBlockBinding(program, uniformBlockIndex, uniformBlockBinding);
1321 }
1322
1323 void
1324 glDrawArraysInstanced(GLenum mode, GLint first, GLsizei count, GLsizei instanceCount)
1325 {
1326         ovr_glDrawArraysInstanced(mode, first, count, instanceCount);
1327 }
1328
1329 void
1330 glDrawElementsInstanced(GLenum mode, GLsizei count, GLenum type, const GLvoid* indices, GLsizei instanceCount)
1331 {
1332         ovr_glDrawElementsInstanced(mode, count, type, indices, instanceCount);
1333 }
1334
1335 GLsync
1336 glFenceSync(GLenum condition, GLbitfield flags)
1337 {
1338         return ovr_glFenceSync(condition, flags);
1339 }
1340
1341 GLboolean
1342 glIsSync(GLsync sync)
1343 {
1344         return ovr_glIsSync(sync);
1345 }
1346
1347 void
1348 glDeleteSync(GLsync sync)
1349 {
1350         ovr_glDeleteSync(sync);
1351 }
1352
1353 GLenum
1354 glClientWaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout)
1355 {
1356         return ovr_glClientWaitSync(sync, flags, timeout);
1357 }
1358
1359 void
1360 glWaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout)
1361 {
1362         ovr_glWaitSync(sync, flags, timeout);
1363 }
1364
1365 void
1366 glGetInteger64v(GLenum pname, GLint64* params)
1367 {
1368         ovr_glGetInteger64v(pname, params);
1369 }
1370
1371 void
1372 glGetSynciv(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei* length, GLint* values)
1373 {
1374         ovr_glGetSynciv(sync, pname, bufSize, length, values);
1375 }
1376
1377 void
1378 glGetInteger64i_v(GLenum target, GLuint index, GLint64* data)
1379 {
1380         ovr_glGetInteger64i_v(target, index, data);
1381 }
1382
1383 void
1384 glGetBufferParameteri64v(GLenum target, GLenum pname, GLint64* params)
1385 {
1386         ovr_glGetBufferParameteri64v(target, pname, params);
1387 }
1388
1389 void
1390 glGenSamplers(GLsizei n, GLuint* samplers)
1391 {
1392         ovr_glGenSamplers(n, samplers);
1393 }
1394
1395 void
1396 glDeleteSamplers(GLsizei n, const GLuint* samplers)
1397 {
1398         ovr_glDeleteSamplers(n, samplers);
1399 }
1400
1401 GLboolean
1402 glIsSampler(GLuint sampler)
1403 {
1404         return ovr_glIsSampler(sampler);
1405 }
1406
1407 void
1408 glBindSampler(GLuint unit, GLuint sampler)
1409 {
1410         ovr_glBindSampler(unit, sampler);
1411 }
1412
1413 void
1414 glSamplerParameteri(GLuint sampler, GLenum pname, GLint param)
1415 {
1416         ovr_glSamplerParameteri(sampler, pname, param);
1417 }
1418
1419 void
1420 glSamplerParameteriv(GLuint sampler, GLenum pname, const GLint* param)
1421 {
1422         ovr_glSamplerParameteriv(sampler, pname, param);
1423 }
1424
1425 void
1426 glSamplerParameterf(GLuint sampler, GLenum pname, GLfloat param)
1427 {
1428         ovr_glSamplerParameterf(sampler, pname, param);
1429 }
1430
1431 void
1432 glSamplerParameterfv(GLuint sampler, GLenum pname, const GLfloat* param)
1433 {
1434         ovr_glSamplerParameterfv(sampler, pname, param);
1435 }
1436
1437 void
1438 glGetSamplerParameteriv(GLuint sampler, GLenum pname, GLint* params)
1439 {
1440         ovr_glGetSamplerParameteriv(sampler, pname, params);
1441 }
1442
1443 void
1444 glGetSamplerParameterfv(GLuint sampler, GLenum pname, GLfloat* params)
1445 {
1446         ovr_glGetSamplerParameterfv(sampler, pname, params);
1447 }
1448
1449 void
1450 glVertexAttribDivisor(GLuint index, GLuint divisor)
1451 {
1452         ovr_glVertexAttribDivisor(index, divisor);
1453 }
1454
1455 void
1456 glBindTransformFeedback(GLenum target, GLuint id)
1457 {
1458         ovr_glBindTransformFeedback(target, id);
1459 }
1460
1461 void
1462 glDeleteTransformFeedbacks(GLsizei n, const GLuint* ids)
1463 {
1464         ovr_glDeleteTransformFeedbacks(n, ids);
1465 }
1466
1467 void
1468 glGenTransformFeedbacks(GLsizei n, GLuint* ids)
1469 {
1470         ovr_glGenTransformFeedbacks(n, ids);
1471 }
1472
1473 GLboolean
1474 glIsTransformFeedback(GLuint id)
1475 {
1476         return ovr_glIsTransformFeedback(id);
1477 }
1478
1479 void
1480 glPauseTransformFeedback()
1481 {
1482         ovr_glPauseTransformFeedback();
1483 }
1484
1485 void
1486 glResumeTransformFeedback()
1487 {
1488         ovr_glResumeTransformFeedback();
1489 }
1490
1491 void
1492 glGetProgramBinary(GLuint program, GLsizei bufSize, GLsizei* length, GLenum* binaryFormat, GLvoid* binary)
1493 {
1494         ovr_glGetProgramBinary(program, bufSize, length, binaryFormat, binary);
1495 }
1496
1497 void
1498 glProgramBinary(GLuint program, GLenum binaryFormat, const GLvoid* binary, GLsizei length)
1499 {
1500         ovr_glProgramBinary(program, binaryFormat, binary, length);
1501 }
1502
1503 void
1504 glProgramParameteri(GLuint program, GLenum pname, GLint value)
1505 {
1506         ovr_glProgramParameteri(program, pname, value);
1507 }
1508
1509 void
1510 glInvalidateFramebuffer(GLenum target, GLsizei numAttachments, const GLenum* attachments)
1511 {
1512         ovr_glInvalidateFramebuffer(target, numAttachments, attachments);
1513 }
1514
1515 void
1516 glInvalidateSubFramebuffer(GLenum target, GLsizei numAttachments, const GLenum* attachments, GLint x, GLint y, GLsizei width, GLsizei height)
1517 {
1518         ovr_glInvalidateSubFramebuffer(target, numAttachments, attachments, x, y, width, height);
1519 }
1520
1521 void
1522 glTexStorage2D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height)
1523 {
1524         ovr_glTexStorage2D(target, levels, internalformat, width, height);
1525 }
1526
1527 void
1528 glTexStorage3D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth)
1529 {
1530         ovr_glTexStorage3D(target, levels, internalformat, width, height, depth);
1531 }
1532
1533 void
1534 glGetInternalformativ(GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint* params)
1535 {
1536         ovr_glGetInternalformativ(target, internalformat, pname, bufSize, params);
1537 }
1538