diff options
author | r.kuznetsov <r.kuznetsov@corp.mail.ru> | 2018-08-27 12:37:52 +0300 |
---|---|---|
committer | Aleksey Belousov <beloal@users.noreply.github.com> | 2018-09-25 12:33:08 +0300 |
commit | a81f1fc4d1f698a0f0aaaa1e7a29f41516b05d11 (patch) | |
tree | cf7c511247ca2ae4da08e2a11d2b22232846a3da /drape/oglcontext.cpp | |
parent | 5cca83542d89b081d668bccca7bf14c5c8c165ad (diff) |
[drape][metal] Added states.
Diffstat (limited to 'drape/oglcontext.cpp')
-rw-r--r-- | drape/oglcontext.cpp | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/drape/oglcontext.cpp b/drape/oglcontext.cpp index 62794bb176..d9d8644b1c 100644 --- a/drape/oglcontext.cpp +++ b/drape/oglcontext.cpp @@ -1,5 +1,7 @@ #include "drape/oglcontext.hpp" -#include "drape/glfunctions.hpp" +#include "drape/gl_functions.hpp" + +#include "base/macros.hpp" namespace dp { @@ -65,6 +67,21 @@ void OGLContext::Init(ApiVersion apiVersion) GLFunctions::glEnable(gl_const::GLScissorTest); } +ApiVersion OGLContext::GetApiVersion() const +{ + return GLFunctions::CurrentApiVersion; +} + +std::string OGLContext::GetRendererName() const +{ + return GLFunctions::glGetString(gl_const::GLRenderer); +} + +std::string OGLContext::GetRendererVersion() const +{ + return GLFunctions::glGetString(gl_const::GLVersion); +} + void OGLContext::SetClearColor(dp::Color const & color) { GLFunctions::glClearColor(color.GetRedF(), color.GetGreenF(), color.GetBlueF(), color.GetAlphaF()); @@ -88,6 +105,12 @@ void OGLContext::Flush() GLFunctions::glFlush(); } +void OGLContext::SetViewport(uint32_t x, uint32_t y, uint32_t w, uint32_t h) +{ + GLCHECK(GLFunctions::glViewport(x, y, w, h)); + GLCHECK(GLFunctions::glScissor(x, y, w, h)); +} + void OGLContext::SetDepthTestEnabled(bool enabled) { if (enabled) |