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/viewport.cpp | |
parent | aa6703383e8d4c2ff8445e8b3c27728846cdab4b (diff) | |
parent | 086d6f9cf247cea07cff6bc33d5567dc7c64806b (diff) |
Merge pull request #6040 from rokuz/es3-supportbeta-810
Added OpenGL ES3 support
Diffstat (limited to 'drape/viewport.cpp')
-rw-r--r-- | drape/viewport.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/drape/viewport.cpp b/drape/viewport.cpp new file mode 100644 index 0000000000..f36b1b6cc1 --- /dev/null +++ b/drape/viewport.cpp @@ -0,0 +1,25 @@ +#include "drape/viewport.hpp" +#include "drape/glfunctions.hpp" + +namespace dp +{ +Viewport::Viewport(uint32_t x0, uint32_t y0, uint32_t w, uint32_t h) : m_zero(x0, y0), m_size(w, h) +{ +} + +void Viewport::SetViewport(uint32_t x0, uint32_t y0, uint32_t w, uint32_t h) +{ + m_zero = m2::PointU(x0, y0); + m_size = m2::PointU(w, h); +} + +uint32_t Viewport::GetX0() const { return m_zero.x; } +uint32_t Viewport::GetY0() const { return m_zero.y; } +uint32_t Viewport::GetWidth() const { return m_size.x; } +uint32_t Viewport::GetHeight() const { return m_size.y; } +void Viewport::Apply() const +{ + GLCHECK(GLFunctions::glViewport(GetX0(), GetY0(), GetWidth(), GetHeight())); + GLCHECK(GLFunctions::glScissor(GetX0(), GetY0(), GetWidth(), GetHeight())); +} +} // namespace dp |