[ios, drape] build fix

This commit is contained in:
ExMix 2014-11-18 11:09:52 +03:00 committed by Alex Zolotarev
parent ed45d5f914
commit ba05a5cdc4
3 changed files with 16 additions and 4 deletions

View file

@ -5,6 +5,7 @@
#if defined(OMIM_OS_IPHONE)
#define USE_OPENGLES20_IF_AVAILABLE 1
#include <OpenGLES/ES2/gl.h>
#include <OpenGLES/ES2/glext.h>
#elif defined(OMIM_OS_MAC)
#include <OpenGL/gl.h>
#include <OpenGL/glext.h>

View file

@ -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<GLclampf>(depth)));
#else
GLCHECK(::glClearDepth(depth));
#endif
}
void GLFunctions::glDepthMask(bool needWriteToDepthBuffer)

View file

@ -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);