diff options
author | Dmitry Kunin <dkunin@mapswith.me> | 2013-12-27 18:26:15 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 02:09:48 +0300 |
commit | fe06759578fd6f5a9be8a3279996ef9ce92b8974 (patch) | |
tree | 8661f1996e91f610f05530c1feb1efdefe879076 /drape/glfunctions.cpp | |
parent | cb62862b3460a4e1b5ccc7e31f1a6eaa2e185bdd (diff) |
GLFunctions updated.
Diffstat (limited to 'drape/glfunctions.cpp')
-rw-r--r-- | drape/glfunctions.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/drape/glfunctions.cpp b/drape/glfunctions.cpp index 595bb01bc6..04f96d3c16 100644 --- a/drape/glfunctions.cpp +++ b/drape/glfunctions.cpp @@ -12,6 +12,10 @@ 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; + /// VAO void (*glGenVertexArraysFn)(GLsizei n, GLuint * ids) = NULL; void (*glBindVertexArrayFn)(GLuint id) = NULL; @@ -86,6 +90,10 @@ void GLFunctions::Init() glDeleteVertexArrayFn = &glDeleteVertexArraysOES; #endif + glClearColorFn = &::glClearColor; + glClearFn = &::glClear; + glViewportFn = &::glViewport; + /// VBO glGenBuffersFn = &::glGenBuffers; glBindBufferFn = &::glBindBuffer; @@ -148,6 +156,21 @@ bool GLFunctions::glHasExtension(const string & name) return false; } +void GLFunctions::glClearColor(float r, float g, float b, float a) +{ + GLCHECK(glClearColorFn(r, g, b, a)); +} + +void GLFunctions::glClear() +{ + GLCHECK(glClearFn(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)); +} + +void GLFunctions::glViewport(uint32_t x, uint32_t y, uint32_t w, uint32_t h) +{ + GLCHECK(glViewportFn(x, y, w, h)); +} + uint32_t GLFunctions::glGenVertexArray() { ASSERT(glGenVertexArraysFn != NULL, ()); |