Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/drape
diff options
context:
space:
mode:
authorAlex Zolotarev <alex@maps.me>2014-10-14 13:14:55 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 02:30:57 +0300
commit0ddcff0b07566260e1e00990f70555110fb5cfa7 (patch)
tree32d542f1b9d9f6dcdc4e800b4ac5b3d6ee62b2c8 /drape
parent9ad4f6585c45443815b7ab9a691a7c47eefe6012 (diff)
[msvc][win] Fixed compilation issues
Diffstat (limited to 'drape')
-rw-r--r--drape/drape.pro2
-rw-r--r--drape/drape_tests/compile_shaders_test.cpp14
-rw-r--r--drape/drape_tests/drape_tests.pro7
-rw-r--r--drape/glIncludes.hpp5
-rw-r--r--drape/glfunctions.cpp103
-rw-r--r--drape/symbols_texture.cpp2
6 files changed, 71 insertions, 62 deletions
diff --git a/drape/drape.pro b/drape/drape.pro
index 90b932aab0..5b4e73ba0e 100644
--- a/drape/drape.pro
+++ b/drape/drape.pro
@@ -17,6 +17,8 @@ include($$ROOT_DIR/common.pri)
DRAPE_DIR = .
include($$DRAPE_DIR/drape_common.pri)
+INCLUDEPATH *= $$ROOT_DIR/3party/expat/lib
+
SOURCES += glfunctions.cpp
OTHER_FILES += \
diff --git a/drape/drape_tests/compile_shaders_test.cpp b/drape/drape_tests/compile_shaders_test.cpp
index c7de8cd9e4..9b6dafbec9 100644
--- a/drape/drape_tests/compile_shaders_test.cpp
+++ b/drape/drape_tests/compile_shaders_test.cpp
@@ -131,18 +131,18 @@ UNIT_TEST(CompileShaders_Test)
ShaderEnumGuard guard;
QString compilerPath = QString::fromStdString(glslCompilerPath);
QString shaderType = "-v";
- auto argsPrepareFn = [&shaderType](QStringList & args, QString const & fileName)
+ auto argsPrepareFn = [&shaderType] (QStringList & args, QString const & fileName)
{
args << fileName
<< fileName + ".bin"
<< shaderType;
};
- auto successComparator = [](QString const & output) { return output.indexOf("Success") != -1; };
+ auto successComparator = [] (QString const & output) { return output.indexOf("Success") != -1; };
- ForEachShader(gpu::VertexEnum, compilerPath, [](QProcess const &){},
+ ForEachShader(gpu::VertexEnum, compilerPath, [] (QProcess const &) {},
argsPrepareFn, successComparator, ss);
shaderType = "-f";
- ForEachShader(gpu::FragmentEnum, compilerPath,[](QProcess const &){},
+ ForEachShader(gpu::FragmentEnum, compilerPath,[] (QProcess const &) {},
argsPrepareFn, successComparator, ss);
TEST_EQUAL(errorLog.isEmpty(), true, (errorLog));
@@ -163,9 +163,9 @@ void TestMaliShaders(QString const & driver,
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
env.insert("MALICM_LOCATION", QString::fromStdString(platform.ResourcesDir() + "shaders_compiler/" MALI_DIR));
- auto procPrepare = [&env](QProcess & p) { p.setProcessEnvironment(env); };
+ auto procPrepare = [&env] (QProcess & p) { p.setProcessEnvironment(env); };
QString shaderType = "-v";
- auto argForming = [&](QStringList & args, QString const & fileName)
+ auto argForming = [&] (QStringList & args, QString const & fileName)
{
args << shaderType
<< "-V"
@@ -178,7 +178,7 @@ void TestMaliShaders(QString const & driver,
<< fileName;
};
- auto succesComparator = [](QString const & output)
+ auto succesComparator = [] (QString const & output)
{
return output.indexOf("Compilation succeeded.") != -1;
};
diff --git a/drape/drape_tests/drape_tests.pro b/drape/drape_tests/drape_tests.pro
index cc8d95a04c..decb8d076e 100644
--- a/drape/drape_tests/drape_tests.pro
+++ b/drape/drape_tests/drape_tests.pro
@@ -20,11 +20,10 @@ QT *= core
DRAPE_DIR = ..
include($$DRAPE_DIR/drape_common.pri)
-INCLUDEPATH += $$ROOT_DIR/3party/gmock/include $$ROOT_DIR/3party/gmock/gtest/include
+INCLUDEPATH *= $$ROOT_DIR/3party/gmock/include $$ROOT_DIR/3party/gmock/gtest/include $$ROOT_DIR/3party/expat/lib
-macx-* {
- LIBS *= "-framework CoreLocation" "-framework Foundation"
-}
+win32* : LIBS *= -lShell32
+macx-* : LIBS *= "-framework CoreLocation" "-framework Foundation"
SOURCES += \
glfunctions.cpp \
diff --git a/drape/glIncludes.hpp b/drape/glIncludes.hpp
index 226d916bba..421bc8bf4f 100644
--- a/drape/glIncludes.hpp
+++ b/drape/glIncludes.hpp
@@ -8,6 +8,11 @@
#elif defined(OMIM_OS_MAC)
#include <OpenGL/gl.h>
#include <OpenGL/glext.h>
+#elif defined(OMIM_OS_WINDOWS)
+ #include "../std/windows.hpp"
+ #define GL_GLEXT_PROTOTYPES
+ #include <GL/gl.h>
+ #include "../3party/GL/glext.h"
#else
#define GL_GLEXT_PROTOTYPES
#include <GL/gl.h>
diff --git a/drape/glfunctions.cpp b/drape/glfunctions.cpp
index 4134430756..9d8a2729c2 100644
--- a/drape/glfunctions.cpp
+++ b/drape/glfunctions.cpp
@@ -6,6 +6,9 @@
#include "../std/cstring.hpp"
+#ifndef OMIM_OS_WINDOWS
+#define APIENTRY
+#endif
namespace
{
@@ -14,58 +17,58 @@ namespace
return (v == true) ? GL_TRUE : GL_FALSE;
}
- void (*glClearColorFn)(GLfloat r, GLfloat g, GLfloat b, GLfloat a) = NULL;
- void (*glClearFn)(GLbitfield mask) = NULL;
- void (*glViewportFn)(GLint x, GLint y, GLsizei w, GLsizei h) = NULL;
- void (*glFlushFn)() = NULL;
+ void (APIENTRY *glClearColorFn)(GLfloat r, GLfloat g, GLfloat b, GLfloat a) = NULL;
+ void (APIENTRY *glClearFn)(GLbitfield mask) = NULL;
+ void (APIENTRY *glViewportFn)(GLint x, GLint y, GLsizei w, GLsizei h) = NULL;
+ void (APIENTRY *glFlushFn)() = NULL;
- void (*glBindFramebufferFn)(GLenum target, GLuint id) = NULL;
+ void (APIENTRY *glBindFramebufferFn)(GLenum target, GLuint id) = NULL;
/// VAO
- void (*glGenVertexArraysFn)(GLsizei n, GLuint * ids) = NULL;
- void (*glBindVertexArrayFn)(GLuint id) = NULL;
- void (*glDeleteVertexArrayFn)(GLsizei n, GLuint const * ids) = NULL;
+ void (APIENTRY *glGenVertexArraysFn)(GLsizei n, GLuint * ids) = NULL;
+ void (APIENTRY *glBindVertexArrayFn)(GLuint id) = NULL;
+ void (APIENTRY *glDeleteVertexArrayFn)(GLsizei n, GLuint const * ids) = NULL;
/// VBO
- void (*glGenBuffersFn)(GLsizei n, GLuint * buffers) = NULL;
- void (*glBindBufferFn)(GLenum target, GLuint buffer) = NULL;
- void (*glDeleteBuffersFn)(GLsizei n, GLuint const * buffers) = NULL;
- void (*glBufferDataFn)(GLenum target, GLsizeiptr size, GLvoid const * data, GLenum usage) = NULL;
- void (*glBufferSubDataFn)(GLenum target, GLintptr offset, GLsizeiptr size, GLvoid const * data) = NULL;
- void * (*glMapBufferFn)(GLenum target, GLenum access) = NULL;
- GLboolean (*glUnmapBufferFn)(GLenum target) = NULL;
+ void (APIENTRY *glGenBuffersFn)(GLsizei n, GLuint * buffers) = NULL;
+ void (APIENTRY *glBindBufferFn)(GLenum target, GLuint buffer) = NULL;
+ void (APIENTRY *glDeleteBuffersFn)(GLsizei n, GLuint const * buffers) = NULL;
+ void (APIENTRY *glBufferDataFn)(GLenum target, GLsizeiptr size, GLvoid const * data, GLenum usage) = NULL;
+ void (APIENTRY *glBufferSubDataFn)(GLenum target, GLintptr offset, GLsizeiptr size, GLvoid const * data) = NULL;
+ void * (APIENTRY *glMapBufferFn)(GLenum target, GLenum access) = NULL;
+ GLboolean (APIENTRY *glUnmapBufferFn)(GLenum target) = NULL;
/// Shaders
- GLuint (*glCreateShaderFn)(GLenum type) = NULL;
- void (*glShaderSourceFn)(GLuint shaderID, GLsizei count, GLchar const ** string, GLint const * length) = NULL;
- void (*glCompileShaderFn)(GLuint shaderID) = NULL;
- void (*glDeleteShaderFn)(GLuint shaderID) = NULL;
- void (*glGetShaderivFn)(GLuint shaderID, GLenum name, GLint * p) = NULL;
- void (*glGetShaderInfoLogFn)(GLuint shaderID, GLsizei maxLength, GLsizei * length, GLchar * infoLog) = NULL;
-
- GLuint (*glCreateProgramFn)() = NULL;
- void (*glAttachShaderFn)(GLuint programID, GLuint shaderID) = NULL;
- void (*glDetachShaderFn)(GLuint programID, GLuint shaderID) = NULL;
- void (*glLinkProgramFn)(GLuint programID) = NULL;
- void (*glDeleteProgramFn)(GLuint programID) = NULL;
- void (*glGetProgramivFn)(GLuint programID, GLenum name, GLint * p) = NULL;
- void (*glGetProgramInfoLogFn)(GLuint programID, GLsizei maxLength, GLsizei * length, GLchar * infoLog) = NULL;
-
- void (*glUseProgramFn)(GLuint programID) = NULL;
- GLint (*glGetAttribLocationFn)(GLuint program, GLchar const * name) = NULL;
- void (*glBindAttribLocationFn)(GLuint program, GLuint index, GLchar const * name) = NULL;
-
- void (*glEnableVertexAttributeFn)(GLuint location) = NULL;
- void (*glVertexAttributePointerFn)(GLuint index,
+ GLuint (APIENTRY *glCreateShaderFn)(GLenum type) = NULL;
+ void (APIENTRY *glShaderSourceFn)(GLuint shaderID, GLsizei count, GLchar const ** string, GLint const * length) = NULL;
+ void (APIENTRY *glCompileShaderFn)(GLuint shaderID) = NULL;
+ void (APIENTRY *glDeleteShaderFn)(GLuint shaderID) = NULL;
+ void (APIENTRY *glGetShaderivFn)(GLuint shaderID, GLenum name, GLint * p) = NULL;
+ void (APIENTRY *glGetShaderInfoLogFn)(GLuint shaderID, GLsizei maxLength, GLsizei * length, GLchar * infoLog) = NULL;
+
+ GLuint (APIENTRY *glCreateProgramFn)() = NULL;
+ void (APIENTRY *glAttachShaderFn)(GLuint programID, GLuint shaderID) = NULL;
+ void (APIENTRY *glDetachShaderFn)(GLuint programID, GLuint shaderID) = NULL;
+ void (APIENTRY *glLinkProgramFn)(GLuint programID) = NULL;
+ void (APIENTRY *glDeleteProgramFn)(GLuint programID) = NULL;
+ void (APIENTRY *glGetProgramivFn)(GLuint programID, GLenum name, GLint * p) = NULL;
+ void (APIENTRY *glGetProgramInfoLogFn)(GLuint programID, GLsizei maxLength, GLsizei * length, GLchar * infoLog) = NULL;
+
+ void (APIENTRY *glUseProgramFn)(GLuint programID) = NULL;
+ GLint (APIENTRY *glGetAttribLocationFn)(GLuint program, GLchar const * name) = NULL;
+ void (APIENTRY *glBindAttribLocationFn)(GLuint program, GLuint index, GLchar const * name) = NULL;
+
+ void (APIENTRY *glEnableVertexAttributeFn)(GLuint location) = NULL;
+ void (APIENTRY *glVertexAttributePointerFn)(GLuint index,
GLint count,
GLenum type,
GLboolean normalize,
GLsizei stride,
GLvoid const * p) = NULL;
- GLint (*glGetUniformLocationFn)(GLuint programID, GLchar const * name) = NULL;
+ GLint (APIENTRY *glGetUniformLocationFn)(GLuint programID, GLchar const * name) = NULL;
- void (*glGetActiveUniformFn)(GLuint programID,
+ void (APIENTRY *glGetActiveUniformFn)(GLuint programID,
GLuint uniformIndex,
GLsizei bufSize,
GLsizei * length,
@@ -73,19 +76,19 @@ namespace
GLenum * type,
GLchar * name) = NULL;
- void (*glUniform1iFn)(GLint location, GLint value) = NULL;
- void (*glUniform2iFn)(GLint location, GLint v1, GLint v2) = NULL;
- void (*glUniform3iFn)(GLint location, GLint v1, GLint v2, GLint v3) = NULL;
- void (*glUniform4iFn)(GLint location, GLint v1, GLint v2, GLint v3, GLint v4) = NULL;
- void (*glUniform1ivFn)(GLint location, GLsizei count, GLint const * value) = NULL;
+ void (APIENTRY *glUniform1iFn)(GLint location, GLint value) = NULL;
+ void (APIENTRY *glUniform2iFn)(GLint location, GLint v1, GLint v2) = NULL;
+ void (APIENTRY *glUniform3iFn)(GLint location, GLint v1, GLint v2, GLint v3) = NULL;
+ void (APIENTRY *glUniform4iFn)(GLint location, GLint v1, GLint v2, GLint v3, GLint v4) = NULL;
+ void (APIENTRY *glUniform1ivFn)(GLint location, GLsizei count, GLint const * value) = NULL;
- void (*glUniform1fFn)(GLint location, GLfloat value) = NULL;
- void (*glUniform2fFn)(GLint location, GLfloat v1, GLfloat v2) = NULL;
- void (*glUniform3fFn)(GLint location, GLfloat v1, GLfloat v2, GLfloat v3) = NULL;
- void (*glUniform4fFn)(GLint location, GLfloat v1, GLfloat v2, GLfloat v3, GLfloat v4) = NULL;
- void (*glUniform1fvFn)(GLint location, GLsizei count, GLfloat const * value) = NULL;
+ void (APIENTRY *glUniform1fFn)(GLint location, GLfloat value) = NULL;
+ void (APIENTRY *glUniform2fFn)(GLint location, GLfloat v1, GLfloat v2) = NULL;
+ void (APIENTRY *glUniform3fFn)(GLint location, GLfloat v1, GLfloat v2, GLfloat v3) = NULL;
+ void (APIENTRY *glUniform4fFn)(GLint location, GLfloat v1, GLfloat v2, GLfloat v3, GLfloat v4) = NULL;
+ void (APIENTRY *glUniform1fvFn)(GLint location, GLsizei count, GLfloat const * value) = NULL;
- void (*glUniformMatrix4fvFn)(GLint location, GLsizei count, GLboolean transpose, GLfloat const * value) = NULL;
+ void (APIENTRY *glUniformMatrix4fvFn)(GLint location, GLsizei count, GLboolean transpose, GLfloat const * value) = NULL;
int const GLCompileStatus = GL_COMPILE_STATUS;
int const GLLinkStatus = GL_LINK_STATUS;
@@ -126,7 +129,7 @@ void GLFunctions::Init()
/// Shaders
glCreateShaderFn = &::glCreateShader;
- typedef void (*glShaderSource_Type)(GLuint shaderID, GLsizei count, GLchar const ** string, GLint const * length);
+ typedef void (APIENTRY *glShaderSource_Type)(GLuint shaderID, GLsizei count, GLchar const ** string, GLint const * length);
glShaderSourceFn = reinterpret_cast<glShaderSource_Type>(&::glShaderSource);
glCompileShaderFn = &::glCompileShader;
glDeleteShaderFn = &::glDeleteShader;
diff --git a/drape/symbols_texture.cpp b/drape/symbols_texture.cpp
index e118efc77c..6ca2f73627 100644
--- a/drape/symbols_texture.cpp
+++ b/drape/symbols_texture.cpp
@@ -138,7 +138,7 @@ void SymbolsTexture::Load(string const & skinPathName)
{
ReaderPtr<Reader> reader = GetPlatform().GetReader(skinPathName + ".png");
- uint64_t size = reader.Size();
+ size_t const size = reader.Size();
rawData.resize(size);
reader.Read(0, &rawData[0], size);
}