From ba05a5cdc474cb455a30f39efca4e04fb150d7de Mon Sep 17 00:00:00 2001 From: ExMix Date: Tue, 18 Nov 2014 11:09:52 +0300 Subject: [PATCH] [ios, drape] build fix --- drape/glIncludes.hpp | 1 + drape/glfunctions.cpp | 17 ++++++++++++++--- drape/glfunctions.hpp | 2 +- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/drape/glIncludes.hpp b/drape/glIncludes.hpp index 421bc8bf4f..50264aa900 100644 --- a/drape/glIncludes.hpp +++ b/drape/glIncludes.hpp @@ -5,6 +5,7 @@ #if defined(OMIM_OS_IPHONE) #define USE_OPENGLES20_IF_AVAILABLE 1 #include + #include #elif defined(OMIM_OS_MAC) #include #include diff --git a/drape/glfunctions.cpp b/drape/glfunctions.cpp index 6f58c24ea9..d412c3db41 100644 --- a/drape/glfunctions.cpp +++ b/drape/glfunctions.cpp @@ -115,14 +115,20 @@ void GLFunctions::Init() glGenVertexArraysFn = &glGenVertexArraysAPPLE; glBindVertexArrayFn = &glBindVertexArrayAPPLE; glDeleteVertexArrayFn = &glDeleteVertexArraysAPPLE; + glMapBufferFn = &::glMapBuffer; + glUnmapBufferFn = &::glUnmapBuffer; #elif defined(OMIM_OS_LINUX) glGenVertexArraysFn = &::glGenVertexArrays; glBindVertexArrayFn = &::glBindVertexArray; glDeleteVertexArrayFn = &::glDeleteVertexArrays; + glMapBufferFn = &::glMapBuffer; // I don't know correct name for linux! + glUnmapBufferFn = &::glUnmapBuffer; // I don't know correct name for linux! #elif defined(OMIM_OS_MOBILE) glGenVertexArraysFn = &glGenVertexArraysOES; glBindVertexArrayFn = &glBindVertexArrayOES; glDeleteVertexArrayFn = &glDeleteVertexArraysOES; + glMapBufferFn = &::glMapBufferOES; + glUnmapBufferFn = &::glUnmapBufferOES; #endif glBindFramebufferFn = &::glBindFramebuffer; @@ -138,8 +144,6 @@ void GLFunctions::Init() glDeleteBuffersFn = &::glDeleteBuffers; glBufferDataFn = &::glBufferData; glBufferSubDataFn = &::glBufferSubData; - glMapBufferFn = &::glMapBuffer; - glUnmapBufferFn = &::glUnmapBuffer; /// Shaders glCreateShaderFn = &::glCreateShader; @@ -180,6 +184,9 @@ void GLFunctions::Init() glUniform1fvFn = &::glUniform1fv; glUniformMatrix4fvFn = &glUniformMatrix4fv; + + glPixelStorei(GL_UNPACK_ALIGNMENT, 1); + glPixelStorei(GL_PACK_ALIGNMENT, 1); } bool GLFunctions::glHasExtension(string const & name) @@ -246,9 +253,13 @@ void GLFunctions::glDisable(glConst mode) GLCHECK(::glDisable(mode)); } -void GLFunctions::glClearDepth(double depth) +void GLFunctions::glClearDepthValue(double depth) { +#ifdef OMIM_OS_IPHONE + GLCHECK(::glClearDepthf(static_cast(depth))); +#else GLCHECK(::glClearDepth(depth)); +#endif } void GLFunctions::glDepthMask(bool needWriteToDepthBuffer) diff --git a/drape/glfunctions.hpp b/drape/glfunctions.hpp index 9c0cbff0f5..b8396ce175 100644 --- a/drape/glfunctions.hpp +++ b/drape/glfunctions.hpp @@ -19,7 +19,7 @@ public: static void glEnable(glConst mode); static void glDisable(glConst mode); - static void glClearDepth(double depth); + static void glClearDepthValue(double depth); static void glDepthMask(bool needWriteToDepthBuffer); static void glDepthFunc(glConst depthFunc); static void glBlendEquation(glConst function);