Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[android] Fix build with mismatching glShaderSource signature
Browse files Browse the repository at this point in the history
Not all GL implementations are following the glShaderSource signature
specified by Khronos for GLES20.

https://www.khronos.org/registry/OpenGL-Refpages/es2.0/xhtml/glShaderSource.xml
  • Loading branch information
tmpsantos committed Apr 5, 2019
1 parent cc3babf commit 5a173fa
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion platform/android/src/gl_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,12 @@ void (* const glReadPixels)(GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, void
void (* const glRenderbufferStorage)(GLenum, GLenum, GLsizei, GLsizei) = ::glRenderbufferStorage;
void (* const glSampleCoverage)(GLfloat, GLboolean) = ::glSampleCoverage;
void (* const glScissor)(GLint, GLint, GLsizei, GLsizei) = ::glScissor;
void (* const glShaderSource)(GLuint, GLsizei, const GLchar * const*, const GLint *) = ::glShaderSource;

// Some implementations use `const GLchar* const*` and others `const GLchar**`.
void (* const glShaderSource)(GLuint, GLsizei, const GLchar * const*, const GLint *) = [](GLuint shader, GLsizei count, const GLchar * const * string, const GLint *length) {
::glShaderSource(shader, count, const_cast<const GLchar **>(string), length);
};

void (* const glStencilFunc)(GLenum, GLint, GLuint) = ::glStencilFunc;
void (* const glStencilFuncSeparate)(GLenum, GLenum, GLint, GLuint) = ::glStencilFuncSeparate;
void (* const glStencilMask)(GLuint) = ::glStencilMask;
Expand Down

0 comments on commit 5a173fa

Please sign in to comment.