diff options
author | Alex Zolotarev <alex@mapswithme.com> | 2013-06-18 18:54:29 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 01:56:46 +0300 |
commit | 279ae8892509e2ef0bf18e678d07b5cb0da30a31 (patch) | |
tree | fc02755c37594530e2fac9f2d411b43864864f05 /graphics | |
parent | b14b75f7ac257e26cd2acb4ca07e95566de75509 (diff) |
Fixed OpenGL compilation for Android
Diffstat (limited to 'graphics')
-rw-r--r-- | graphics/opengl/opengl.cpp | 8 | ||||
-rw-r--r-- | graphics/opengl/opengl.hpp | 15 |
2 files changed, 14 insertions, 9 deletions
diff --git a/graphics/opengl/opengl.cpp b/graphics/opengl/opengl.cpp index 5c5c24e043..caca64c8b0 100644 --- a/graphics/opengl/opengl.cpp +++ b/graphics/opengl/opengl.cpp @@ -84,11 +84,11 @@ namespace graphics void (OPENGL_CALLING_CONVENTION * glGetShaderInfoLogFn)(GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog); void (OPENGL_CALLING_CONVENTION * glGetShaderivFn)(GLuint shader, GLenum pname, GLint *params); void (OPENGL_CALLING_CONVENTION * glCompileShaderFn)(GLuint shader); -#if (__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_7_0) || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_8) - void (OPENGL_CALLING_CONVENTION * glShaderSourceFn)(GLuint shader, GLsizei count, const GLchar* const *string, const GLint *length); -#else - void (OPENGL_CALLING_CONVENTION * glShaderSourceFn)(GLuint shader, GLsizei count, const GLchar* *string, const GLint *length); + void (OPENGL_CALLING_CONVENTION * glShaderSourceFn)(GLuint shader, GLsizei count, const GLchar* +#ifdef NEED_OPENGL_SHADERSOURCE_CONST + const #endif + *string, const GLint *length); GLuint (OPENGL_CALLING_CONVENTION * glCreateShaderFn)(GLenum type); void (OPENGL_CALLING_CONVENTION * glDeleteShaderFn)(GLuint shader); diff --git a/graphics/opengl/opengl.hpp b/graphics/opengl/opengl.hpp index 9cc6598295..0b06e04fd9 100644 --- a/graphics/opengl/opengl.hpp +++ b/graphics/opengl/opengl.hpp @@ -23,9 +23,15 @@ #define USE_OPENGLES20_IF_AVAILABLE 1 #include <OpenGLES/ES2/gl.h> #define OMIM_GL_ES + #if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_7_0 + #define NEED_OPENGL_SHADERSOURCE_CONST + #endif #else #include <OpenGL/gl.h> #include <OpenGL/glext.h> + #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_8 + #define NEED_OPENGL_SHADERSOURCE_CONST + #endif #endif #elif defined(OMIM_OS_ANDROID) @@ -54,7 +60,6 @@ #define OPENGL_CALLING_CONVENTION #endif - #include "../../base/src_point.hpp" #include "../../std/exception.hpp" @@ -176,11 +181,11 @@ namespace graphics extern void (OPENGL_CALLING_CONVENTION * glGetShaderInfoLogFn)(GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog); extern void (OPENGL_CALLING_CONVENTION * glGetShaderivFn)(GLuint shader, GLenum pname, GLint *params); extern void (OPENGL_CALLING_CONVENTION * glCompileShaderFn)(GLuint shader); -#if (__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_7_0) || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_8) - extern void (OPENGL_CALLING_CONVENTION * glShaderSourceFn)(GLuint shader, GLsizei count, const GLchar* const *string, const GLint *length); -#else - extern void (OPENGL_CALLING_CONVENTION * glShaderSourceFn)(GLuint shader, GLsizei count, const GLchar* *string, const GLint *length); + extern void (OPENGL_CALLING_CONVENTION * glShaderSourceFn)(GLuint shader, GLsizei count, const GLchar* +#ifdef NEED_OPENGL_SHADERSOURCE_CONST + const #endif + *string, const GLint *length); extern GLuint (OPENGL_CALLING_CONVENTION * glCreateShaderFn)(GLenum type); extern void (OPENGL_CALLING_CONVENTION * glDeleteShaderFn)(GLuint shader); |