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:
authorRoman Sorokin <sorok-roma@yandex.ru>2014-06-26 13:38:10 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 02:18:51 +0300
commit403e81e42082abce9dd3429d6e78d0f5afafa39f (patch)
treee2ebc63bc5cf4a8fad57b25048fa6784e369e56f /drape
parentdf4668b2254449cbfed8ff42a6aaca54c1826e66 (diff)
added new OpenGL functions and constants
Diffstat (limited to 'drape')
-rw-r--r--drape/drape_tests/glfunctions.cpp40
-rw-r--r--drape/drape_tests/glmock_functions.hpp11
-rw-r--r--drape/glconstants.cpp1
-rw-r--r--drape/glconstants.hpp1
-rw-r--r--drape/glfunctions.hpp1
-rw-r--r--drape/texture.cpp4
-rw-r--r--drape/texture.hpp3
7 files changed, 60 insertions, 1 deletions
diff --git a/drape/drape_tests/glfunctions.cpp b/drape/drape_tests/glfunctions.cpp
index 50d0d3c80b..03cd48f76a 100644
--- a/drape/drape_tests/glfunctions.cpp
+++ b/drape/drape_tests/glfunctions.cpp
@@ -199,4 +199,44 @@ void GLFunctions::glGetActiveUniform(uint32_t programID, uint32_t uniformIndex,
MOCK_CALL(glGetActiveUniform(programID, uniformIndex, uniformSize, type, name));
}
+void GLFunctions::glActiveTexture(glConst texBlock)
+{
+ MOCK_CALL(glActiveTexture(texBlock));
+}
+
+uint32_t GLFunctions::glGenTexture()
+{
+ return MOCK_CALL(glGenTexture());
+}
+
+void GLFunctions::glDeleteTexture(uint32_t id)
+{
+ MOCK_CALL(glDeleteTexture(id));
+}
+
+void GLFunctions::glBindTexture(uint32_t textureID)
+{
+ MOCK_CALL(glBindTexture(textureID));
+}
+
+void GLFunctions::glTexImage2D(int width, int height, glConst layout, glConst pixelType, void const * data)
+{
+ MOCK_CALL(glTexImage2D(width, height, layout, pixelType, data));
+}
+
+void GLFunctions::glTexSubImage2D(int x, int y, int width, int height, glConst layout, glConst pixelType, void const * data)
+{
+ MOCK_CALL(glTexSubImage2D(x, y, width, height, layout, pixelType, data));
+}
+
+void GLFunctions::glTexParameter(glConst param, glConst value)
+{
+ MOCK_CALL(glTexParameter(param, value));
+}
+
+int32_t GLFunctions::glGetInteger(glConst pname)
+{
+ return MOCK_CALL(glGetInteger(pname));
+}
+
void CheckGLError() {}
diff --git a/drape/drape_tests/glmock_functions.hpp b/drape/drape_tests/glmock_functions.hpp
index 3764555dc4..d3517ea82c 100644
--- a/drape/drape_tests/glmock_functions.hpp
+++ b/drape/drape_tests/glmock_functions.hpp
@@ -70,6 +70,17 @@ public:
int32_t*, glConst *,
string &));
+ //Texture functions
+ MOCK_METHOD1(glActiveTexture, void(glConst));
+ MOCK_METHOD0(glGenTexture, uint32_t());
+ MOCK_METHOD1(glDeleteTexture, void(uint32_t));
+ MOCK_METHOD1(glBindTexture, void(uint32_t));
+ MOCK_METHOD5(glTexImage2D, void(int, int, glConst, glConst, void const *));
+ MOCK_METHOD7(glTexSubImage2D, void(int, int, int, int, glConst, glConst, void const *));
+ MOCK_METHOD2(glTexParameter, void(glConst, glConst));
+
+ MOCK_METHOD1(glGetInteger, int32_t(glConst));
+
private:
static GLMockFunctions * m_mock;
};
diff --git a/drape/glconstants.cpp b/drape/glconstants.cpp
index 2b97f7c9e6..3d079db4ed 100644
--- a/drape/glconstants.cpp
+++ b/drape/glconstants.cpp
@@ -30,6 +30,7 @@ namespace gl_const
const glConst GLMaxFragmentTextures = GL_MAX_TEXTURE_IMAGE_UNITS;
const glConst GLMaxVertexTextures = GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS;
+const glConst GLMaxTextureSize = GL_MAX_TEXTURE_SIZE;
const glConst GLArrayBuffer = GL_ARRAY_BUFFER;
const glConst GLElementArrayBuffer = GL_ELEMENT_ARRAY_BUFFER;
diff --git a/drape/glconstants.hpp b/drape/glconstants.hpp
index d63a07a5bb..a1de2f3d59 100644
--- a/drape/glconstants.hpp
+++ b/drape/glconstants.hpp
@@ -10,6 +10,7 @@ namespace gl_const
/// Hardware specific params
extern const glConst GLMaxFragmentTextures;
extern const glConst GLMaxVertexTextures;
+extern const glConst GLMaxTextureSize;
/// Buffer targets
extern const glConst GLArrayBuffer;
diff --git a/drape/glfunctions.hpp b/drape/glfunctions.hpp
index 5c17f104cd..be75e6a05e 100644
--- a/drape/glfunctions.hpp
+++ b/drape/glfunctions.hpp
@@ -1,3 +1,4 @@
+
#pragma once
#include "glconstants.hpp"
diff --git a/drape/texture.cpp b/drape/texture.cpp
index 8a8295e12b..b8e5485df3 100644
--- a/drape/texture.cpp
+++ b/drape/texture.cpp
@@ -115,6 +115,10 @@ void Texture::UnpackFormat(Texture::TextureFormat format, glConst & layout, glCo
layout = requiredFormat ? gl_const::GLRGBA4 : gl_const::GLRGBA;
pixelType = gl_const::GL4BitOnChannel;
break;
+ case ALPHA:
+ layout = requiredFormat ? gl_const::GLAlpha8 : gl_const::GLAlpha;
+ pixelType = gl_const::GL8BitOnChannel;
+ break;
default:
ASSERT(false, ());
break;
diff --git a/drape/texture.hpp b/drape/texture.hpp
index 2c74bffa23..e7eeb5b3c5 100644
--- a/drape/texture.hpp
+++ b/drape/texture.hpp
@@ -13,7 +13,8 @@ public:
enum TextureFormat
{
RGBA8,
- RGBA4
+ RGBA4,
+ ALPHA
};
class Key