4 # include <GLES/glplatform.h>
5 # include "../headers/gl.h"
7 #define COREGL_API __attribute__((visibility("default")))
9 #define _COREGL_SYMBOL(IS_EXTENSION, RET_TYPE, FUNC_NAME, PARAM_LIST) COREGL_API extern RET_TYPE FUNC_NAME PARAM_LIST;
10 # include "../headers/sym_gl.h"
13 #define _COREGL_SYMBOL(IS_EXTENSION, RET_TYPE, FUNC_NAME, PARAM_LIST) RET_TYPE (*ovr_##FUNC_NAME) PARAM_LIST = NULL;
14 # include "../headers/sym_gl.h"
19 __attribute__((constructor))
23 void *lib_handle = NULL;
25 lib_handle = dlopen("libCOREGL.so", RTLD_NOW);
28 fprintf(stderr, "\E[0;31;1mERROR : %s\E[0m\n\n", dlerror());
29 fprintf(stderr, "\E[0;31;1mERROR : Invalid library link! (Check linkage of libEGL -> libCOREGL)\E[0m\n");
33 #define _COREGL_SYMBOL(IS_EXTENSION, RET_TYPE, FUNC_NAME, PARAM_LIST) \
34 ovr_##FUNC_NAME = (__typeof__(ovr_##FUNC_NAME))dlsym(lib_handle, #FUNC_NAME);
35 #include "../headers/sym_gl.h"
42 glActiveTexture(GLenum texture)
44 ovr_glActiveTexture(texture);
48 glAttachShader(GLuint program, GLuint shader)
50 ovr_glAttachShader(program, shader);
54 glBindAttribLocation(GLuint program, GLuint index, const char* name)
56 ovr_glBindAttribLocation(program, index, name);
60 glBindBuffer(GLenum target, GLuint buffer)
62 ovr_glBindBuffer(target, buffer);
66 glBindFramebuffer(GLenum target, GLuint framebuffer)
68 ovr_glBindFramebuffer(target, framebuffer);
72 glBindRenderbuffer(GLenum target, GLuint renderbuffer)
74 ovr_glBindRenderbuffer(target, renderbuffer);
78 glBindTexture(GLenum target, GLuint texture)
80 ovr_glBindTexture(target, texture);
84 glBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
86 ovr_glBlendColor(red, green, blue, alpha);
90 glBlendEquation(GLenum mode)
92 ovr_glBlendEquation(mode);
96 glBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha)
98 ovr_glBlendEquationSeparate(modeRGB, modeAlpha);
102 glBlendFunc(GLenum sfactor, GLenum dfactor)
104 ovr_glBlendFunc(sfactor, dfactor);
108 glBlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
110 ovr_glBlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha);
114 glBufferData(GLenum target, GLsizeiptr size, const void* data, GLenum usage)
116 ovr_glBufferData(target, size, data, usage);
120 glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const void* data)
122 ovr_glBufferSubData(target, offset, size, data);
126 glCheckFramebufferStatus(GLenum target)
128 return ovr_glCheckFramebufferStatus(target);
132 glClear(GLbitfield mask)
138 glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
140 ovr_glClearColor(red, green, blue, alpha);
144 glClearDepthf(GLclampf depth)
146 ovr_glClearDepthf(depth);
150 glClearStencil(GLint s)
152 ovr_glClearStencil(s);
156 glColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
158 ovr_glColorMask(red, green, blue, alpha);
162 glCompileShader(GLuint shader)
164 ovr_glCompileShader(shader);
168 glCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data)
170 ovr_glCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data);
174 glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data)
176 ovr_glCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data);
180 glCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
182 ovr_glCopyTexImage2D(target, level, internalformat, x, y, width, height, border);
186 glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
188 ovr_glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height);
192 glCreateProgram(void)
194 return ovr_glCreateProgram();
198 glCreateShader(GLenum type)
200 return ovr_glCreateShader(type);
204 glCullFace(GLenum mode)
206 ovr_glCullFace(mode);
210 glDeleteBuffers(GLsizei n, const GLuint* buffers)
212 ovr_glDeleteBuffers(n, buffers);
216 glDeleteFramebuffers(GLsizei n, const GLuint* framebuffers)
218 ovr_glDeleteFramebuffers(n, framebuffers);
222 glDeleteProgram(GLuint program)
224 ovr_glDeleteProgram(program);
228 glDeleteRenderbuffers(GLsizei n, const GLuint* renderbuffers)
230 ovr_glDeleteRenderbuffers(n, renderbuffers);
234 glDeleteShader(GLuint shader)
236 ovr_glDeleteShader(shader);
240 glDeleteTextures(GLsizei n, const GLuint* textures)
242 ovr_glDeleteTextures(n, textures);
246 glDepthFunc(GLenum func)
248 ovr_glDepthFunc(func);
252 glDepthMask(GLboolean flag)
254 ovr_glDepthMask(flag);
258 glDepthRangef(GLclampf zNear, GLclampf zFar)
260 ovr_glDepthRangef(zNear, zFar);
264 glDetachShader(GLuint program, GLuint shader)
266 ovr_glDetachShader(program, shader);
270 glDisable(GLenum cap)
276 glDisableVertexAttribArray(GLuint index)
278 ovr_glDisableVertexAttribArray(index);
282 glDrawArrays(GLenum mode, GLint first, GLsizei count)
284 ovr_glDrawArrays(mode, first, count);
288 glDrawElements(GLenum mode, GLsizei count, GLenum type, const void* indices)
290 ovr_glDrawElements(mode, count, type, indices);
300 glEnableVertexAttribArray(GLuint index)
302 ovr_glEnableVertexAttribArray(index);
318 glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
320 ovr_glFramebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer);
324 glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
326 ovr_glFramebufferTexture2D(target, attachment, textarget, texture, level);
330 glFrontFace(GLenum mode)
332 ovr_glFrontFace(mode);
336 glGetVertexAttribfv(GLuint index, GLenum pname, GLfloat* params)
338 ovr_glGetVertexAttribfv(index, pname, params);
342 glGetVertexAttribiv(GLuint index, GLenum pname, GLint* params)
344 ovr_glGetVertexAttribiv(index, pname, params);
348 glGetVertexAttribPointerv(GLuint index, GLenum pname, void** pointer)
350 ovr_glGetVertexAttribPointerv(index, pname, pointer);
354 glHint(GLenum target, GLenum mode)
356 ovr_glHint(target, mode);
360 glGenBuffers(GLsizei n, GLuint* buffers)
362 ovr_glGenBuffers(n, buffers);
366 glGenerateMipmap(GLenum target)
368 ovr_glGenerateMipmap(target);
372 glGenFramebuffers(GLsizei n, GLuint* framebuffers)
374 ovr_glGenFramebuffers(n, framebuffers);
378 glGenRenderbuffers(GLsizei n, GLuint* renderbuffers)
380 ovr_glGenRenderbuffers(n, renderbuffers);
384 glGenTextures(GLsizei n, GLuint* textures)
386 ovr_glGenTextures(n, textures);
390 glGetActiveAttrib(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name)
392 ovr_glGetActiveAttrib(program, index, bufsize, length, size, type, name);
396 glGetActiveUniform(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name)
398 ovr_glGetActiveUniform(program, index, bufsize, length, size, type, name);
402 glGetAttachedShaders(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders)
404 ovr_glGetAttachedShaders(program, maxcount, count, shaders);
408 glGetAttribLocation(GLuint program, const char* name)
410 return ovr_glGetAttribLocation(program, name);
414 glGetBooleanv(GLenum pname, GLboolean* params)
416 ovr_glGetBooleanv(pname, params);
420 glGetBufferParameteriv(GLenum target, GLenum pname, GLint* params)
422 ovr_glGetBufferParameteriv(target, pname, params);
428 return ovr_glGetError();
432 glGetFloatv(GLenum pname, GLfloat* params)
434 ovr_glGetFloatv(pname, params);
438 glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint* params)
440 ovr_glGetFramebufferAttachmentParameteriv(target, attachment, pname, params);
444 glGetIntegerv(GLenum pname, GLint* params)
446 ovr_glGetIntegerv(pname, params);
450 glGetProgramiv(GLuint program, GLenum pname, GLint* params)
452 ovr_glGetProgramiv(program, pname, params);
456 glGetProgramInfoLog(GLuint program, GLsizei bufsize, GLsizei* length, char* infolog)
458 ovr_glGetProgramInfoLog(program, bufsize, length, infolog);
462 glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* params)
464 ovr_glGetRenderbufferParameteriv(target, pname, params);
468 glGetShaderiv(GLuint shader, GLenum pname, GLint* params)
470 ovr_glGetShaderiv(shader, pname, params);
474 glGetShaderInfoLog(GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog)
476 ovr_glGetShaderInfoLog(shader, bufsize, length, infolog);
480 glGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision)
482 ovr_glGetShaderPrecisionFormat(shadertype, precisiontype, range, precision);
486 glGetShaderSource(GLuint shader, GLsizei bufsize, GLsizei* length, char* source)
488 ovr_glGetShaderSource(shader, bufsize, length, source);
492 glGetString(GLenum name)
494 return ovr_glGetString(name);
498 glGetTexParameterfv(GLenum target, GLenum pname, GLfloat* params)
500 ovr_glGetTexParameterfv(target, pname, params);
504 glGetTexParameteriv(GLenum target, GLenum pname, GLint* params)
506 ovr_glGetTexParameteriv(target, pname, params);
510 glGetUniformfv(GLuint program, GLint location, GLfloat* params)
512 ovr_glGetUniformfv(program, location, params);
516 glGetUniformiv(GLuint program, GLint location, GLint* params)
518 ovr_glGetUniformiv(program, location, params);
522 glGetUniformLocation(GLuint program, const char* name)
524 return ovr_glGetUniformLocation(program, name);
528 glIsBuffer(GLuint buffer)
530 return ovr_glIsBuffer(buffer);
534 glIsEnabled(GLenum cap)
536 return ovr_glIsEnabled(cap);
540 glIsFramebuffer(GLuint framebuffer)
542 return ovr_glIsFramebuffer(framebuffer);
546 glIsProgram(GLuint program)
548 return ovr_glIsProgram(program);
552 glIsRenderbuffer(GLuint renderbuffer)
554 return ovr_glIsRenderbuffer(renderbuffer);
558 glIsShader(GLuint shader)
560 return ovr_glIsShader(shader);
564 glIsTexture(GLuint texture)
566 return ovr_glIsTexture(texture);
570 glLineWidth(GLfloat width)
572 ovr_glLineWidth(width);
576 glLinkProgram(GLuint program)
578 ovr_glLinkProgram(program);
582 glPixelStorei(GLenum pname, GLint param)
584 ovr_glPixelStorei(pname, param);
588 glPolygonOffset(GLfloat factor, GLfloat units)
590 ovr_glPolygonOffset(factor, units);
594 glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void* pixels)
596 ovr_glReadPixels(x, y, width, height, format, type, pixels);
600 glReleaseShaderCompiler(void)
602 ovr_glReleaseShaderCompiler();
606 glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
608 ovr_glRenderbufferStorage(target, internalformat, width, height);
612 glSampleCoverage(GLclampf value, GLboolean invert)
614 ovr_glSampleCoverage(value, invert);
618 glScissor(GLint x, GLint y, GLsizei width, GLsizei height)
620 ovr_glScissor(x, y, width, height);
624 glShaderBinary(GLsizei n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLsizei length)
626 ovr_glShaderBinary(n, shaders, binaryformat, binary, length);
630 glShaderSource(GLuint shader, GLsizei count, const char** string, const GLint* length)
632 ovr_glShaderSource(shader, count, string, length);
636 glStencilFunc(GLenum func, GLint ref, GLuint mask)
638 ovr_glStencilFunc(func, ref, mask);
642 glStencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask)
644 ovr_glStencilFuncSeparate(face, func, ref, mask);
648 glStencilMask(GLuint mask)
650 ovr_glStencilMask(mask);
654 glStencilMaskSeparate(GLenum face, GLuint mask)
656 ovr_glStencilMaskSeparate(face, mask);
660 glStencilOp(GLenum fail, GLenum zfail, GLenum zpass)
662 ovr_glStencilOp(fail, zfail, zpass);
666 glStencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass)
668 ovr_glStencilOpSeparate(face, fail, zfail, zpass);
672 glTexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void* pixels)
674 ovr_glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels);
678 glTexParameterf(GLenum target, GLenum pname, GLfloat param)
680 ovr_glTexParameterf(target, pname, param);
684 glTexParameterfv(GLenum target, GLenum pname, const GLfloat* params)
686 ovr_glTexParameterfv(target, pname, params);
690 glTexParameteri(GLenum target, GLenum pname, GLint param)
692 ovr_glTexParameteri(target, pname, param);
696 glTexParameteriv(GLenum target, GLenum pname, const GLint* params)
698 ovr_glTexParameteriv(target, pname, params);
702 glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels)
704 ovr_glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels);
708 glUniform1f(GLint location, GLfloat x)
710 ovr_glUniform1f(location, x);
714 glUniform1fv(GLint location, GLsizei count, const GLfloat* v)
716 ovr_glUniform1fv(location, count, v);
720 glUniform1i(GLint location, GLint x)
722 ovr_glUniform1i(location, x);
726 glUniform1iv(GLint location, GLsizei count, const GLint* v)
728 ovr_glUniform1iv(location, count, v);
732 glUniform2f(GLint location, GLfloat x, GLfloat y)
734 ovr_glUniform2f(location, x, y);
738 glUniform2fv(GLint location, GLsizei count, const GLfloat* v)
740 ovr_glUniform2fv(location, count, v);
744 glUniform2i(GLint location, GLint x, GLint y)
746 ovr_glUniform2i(location, x, y);
750 glUniform2iv(GLint location, GLsizei count, const GLint* v)
752 ovr_glUniform2iv(location, count, v);
756 glUniform3f(GLint location, GLfloat x, GLfloat y, GLfloat z)
758 ovr_glUniform3f(location, x, y, z);
762 glUniform3fv(GLint location, GLsizei count, const GLfloat* v)
764 ovr_glUniform3fv(location, count, v);
768 glUniform3i(GLint location, GLint x, GLint y, GLint z)
770 ovr_glUniform3i(location, x, y, z);
774 glUniform3iv(GLint location, GLsizei count, const GLint* v)
776 ovr_glUniform3iv(location, count, v);
780 glUniform4f(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
782 ovr_glUniform4f(location, x, y, z, w);
786 glUniform4fv(GLint location, GLsizei count, const GLfloat* v)
788 ovr_glUniform4fv(location, count, v);
792 glUniform4i(GLint location, GLint x, GLint y, GLint z, GLint w)
794 ovr_glUniform4i(location, x, y, z, w);
798 glUniform4iv(GLint location, GLsizei count, const GLint* v)
800 ovr_glUniform4iv(location, count, v);
804 glUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
806 ovr_glUniformMatrix2fv(location, count, transpose, value);
810 glUniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
812 ovr_glUniformMatrix3fv(location, count, transpose, value);
816 glUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
818 ovr_glUniformMatrix4fv(location, count, transpose, value);
822 glUseProgram(GLuint program)
824 ovr_glUseProgram(program);
828 glValidateProgram(GLuint program)
830 ovr_glValidateProgram(program);
834 glVertexAttrib1f(GLuint indx, GLfloat x)
836 ovr_glVertexAttrib1f(indx, x);
840 glVertexAttrib1fv(GLuint indx, const GLfloat* values)
842 ovr_glVertexAttrib1fv(indx, values);
846 glVertexAttrib2f(GLuint indx, GLfloat x, GLfloat y)
848 ovr_glVertexAttrib2f(indx, x, y);
852 glVertexAttrib2fv(GLuint indx, const GLfloat* values)
854 ovr_glVertexAttrib2fv(indx, values);
858 glVertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z)
860 ovr_glVertexAttrib3f(indx, x, y, z);
864 glVertexAttrib3fv(GLuint indx, const GLfloat* values)
866 ovr_glVertexAttrib3fv(indx, values);
870 glVertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
872 ovr_glVertexAttrib4f(indx, x, y, z, w);
876 glVertexAttrib4fv(GLuint indx, const GLfloat* values)
878 ovr_glVertexAttrib4fv(indx, values);
882 glVertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr)
884 ovr_glVertexAttribPointer(indx, size, type, normalized, stride, ptr);
888 glViewport(GLint x, GLint y, GLsizei width, GLsizei height)
890 ovr_glViewport(x, y, width, height);
894 // GLES Extensions...
896 glEGLImageTargetTexture2DOES(GLenum target, GLeglImageOES image)
898 ovr_glEGLImageTargetTexture2DOES(target, image);
902 glEGLImageTargetRenderbufferStorageOES(GLenum target, GLeglImageOES image)
904 ovr_glEGLImageTargetRenderbufferStorageOES(target, image);
908 glGetProgramBinary(GLuint program, GLsizei bufsize, GLsizei* length, GLenum* binaryFormat, void* binary)
910 ovr_glGetProgramBinary(program, bufsize, length, binaryFormat, binary);
914 glProgramBinary(GLuint program, GLenum binaryFormat, const void* binary, GLint length)
916 ovr_glProgramBinary(program, binaryFormat, binary, length);
921 glProgramParameteri(GLuint program, GLuint pname, GLint value)
923 ovr_glProgramParameteri(program, pname, value);
927 glRenderbufferStorageMultisampleEXT(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
929 ovr_glRenderbufferStorageMultisampleEXT(target, samples, internalformat, width, height);
933 glFramebufferTexture2DMultisampleEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples)
935 ovr_glFramebufferTexture2DMultisampleEXT(target, attachment, textarget, texture, level, samples);
939 glDiscardFramebufferEXT(GLenum target, GLsizei numAttachments, const GLenum *attachments)
941 ovr_glDiscardFramebufferEXT(target, numAttachments, attachments);