diff options
author | Daria Volvenkova <d.volvenkova@corp.mail.ru> | 2017-05-16 14:42:32 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-16 14:42:32 +0300 |
commit | d2f79bd2c7004af2d1459e8d5b7748763f241a54 (patch) | |
tree | 64300bccb750e59f7c3a05800eafcd5c3b3f89cb /drape/texture.cpp | |
parent | aa6703383e8d4c2ff8445e8b3c27728846cdab4b (diff) | |
parent | 086d6f9cf247cea07cff6bc33d5567dc7c64806b (diff) |
Merge pull request #6040 from rokuz/es3-supportbeta-810
Added OpenGL ES3 support
Diffstat (limited to 'drape/texture.cpp')
-rw-r--r-- | drape/texture.cpp | 35 |
1 files changed, 10 insertions, 25 deletions
diff --git a/drape/texture.cpp b/drape/texture.cpp index c198dc2722..e764f5e17b 100644 --- a/drape/texture.cpp +++ b/drape/texture.cpp @@ -1,7 +1,7 @@ #include "drape/texture.hpp" -#include "drape/glfunctions.hpp" #include "drape/glextensions_list.hpp" +#include "drape/glfunctions.hpp" #include "drape/utils/gpu_mem_tracker.hpp" #include "base/math.hpp" @@ -10,25 +10,13 @@ namespace dp { +Texture::ResourceInfo::ResourceInfo(m2::RectF const & texRect) : m_texRect(texRect) {} -Texture::ResourceInfo::ResourceInfo(m2::RectF const & texRect) - : m_texRect(texRect) {} +m2::RectF const & Texture::ResourceInfo::GetTexRect() const { return m_texRect; } -m2::RectF const & Texture::ResourceInfo::GetTexRect() const -{ - return m_texRect; -} +Texture::Texture() {} -////////////////////////////////////////////////////////////////// - -Texture::Texture() -{ -} - -Texture::~Texture() -{ - Destroy(); -} +Texture::~Texture() { Destroy(); } void Texture::Create(Params const & params) { @@ -42,7 +30,8 @@ void Texture::Create(Params const & params, ref_ptr<void> data) m_hwTexture->Create(params, data); } -void Texture::UploadData(uint32_t x, uint32_t y, uint32_t width, uint32_t height, ref_ptr<void> data) +void Texture::UploadData(uint32_t x, uint32_t y, uint32_t width, uint32_t height, + ref_ptr<void> data) { ASSERT(m_hwTexture != nullptr, ()); m_hwTexture->UploadData(x, y, width, height, data); @@ -98,13 +87,10 @@ void Texture::SetFilter(glConst filter) uint32_t Texture::GetMaxTextureSize() { - return GLFunctions::glGetInteger(gl_const::GLMaxTextureSize); + return static_cast<uint32_t>(GLFunctions::glGetInteger(gl_const::GLMaxTextureSize)); } -void Texture::Destroy() -{ - m_hwTexture.reset(); -} +void Texture::Destroy() { m_hwTexture.reset(); } bool Texture::AllocateTexture(ref_ptr<HWTextureAllocator> allocator) { @@ -116,5 +102,4 @@ bool Texture::AllocateTexture(ref_ptr<HWTextureAllocator> allocator) return false; } - -} // namespace dp +} // namespace dp |