From 2bfc0d9604cfab66b54762f1cf4509a517cb666f Mon Sep 17 00:00:00 2001 From: Dmitry Kunin Date: Wed, 8 Jan 2014 13:55:30 +0300 Subject: [PATCH] [gl] getProgramiv wrapper. --- drape/glconstants.cpp | 2 ++ drape/glconstants.hpp | 3 +++ drape/glfunctions.cpp | 12 ++++++++++++ drape/glfunctions.hpp | 2 ++ 4 files changed, 19 insertions(+) diff --git a/drape/glconstants.cpp b/drape/glconstants.cpp index aacde4e8ad..934b6b8bab 100644 --- a/drape/glconstants.cpp +++ b/drape/glconstants.cpp @@ -25,4 +25,6 @@ namespace GLConst const glConst GLUnsignedIntType = GL_UNSIGNED_INT; const glConst GLFloatType = GL_FLOAT; const glConst GLDoubleType = GL_DOUBLE; + + const glConst GLActiveUniforms = GL_ACTIVE_UNIFORMS; } diff --git a/drape/glconstants.hpp b/drape/glconstants.hpp index c22fe1d560..9136f2b432 100644 --- a/drape/glconstants.hpp +++ b/drape/glconstants.hpp @@ -33,4 +33,7 @@ namespace GLConst extern const glConst GLUnsignedIntType; extern const glConst GLFloatType; extern const glConst GLDoubleType; + + // Program object parameter names + extern const glConst GLActiveUniforms; } diff --git a/drape/glfunctions.cpp b/drape/glfunctions.cpp index 04f96d3c16..79ea05b53a 100644 --- a/drape/glfunctions.cpp +++ b/drape/glfunctions.cpp @@ -69,6 +69,8 @@ namespace void (*glUniformMatrix4fvFn)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) = NULL; + void (*glGetProgramivFn)(GLuint program, GLenum paramname, GLint * paramvalue) = NULL; + const int GLCompileStatus = GL_COMPILE_STATUS; const int GLLinkStatus = GL_LINK_STATUS; } @@ -137,6 +139,8 @@ void GLFunctions::Init() glUniform4fFn = &::glUniform4f; glUniformMatrix4fvFn = &glUniformMatrix4fv; + + glGetProgramivFn = &::glGetProgramiv; } bool GLFunctions::glHasExtension(const string & name) @@ -432,6 +436,14 @@ uint32_t GLFunctions::glGetCurrentProgram() return programIndex; } +int32_t GLFunctions::glGetProgramiv(uint32_t program, glConst paramname) +{ + ASSERT(glGetProgramivFn != NULL, ()); + int32_t paramvalue = 0; + GLCHECK(glGetProgramivFn(program, paramname, ¶mvalue)); + return paramvalue; +} + void GLFunctions::glActiveTexture(uint32_t samplerBlock) { GLCHECK(::glActiveTexture(GL_TEXTURE0 + samplerBlock)); diff --git a/drape/glfunctions.hpp b/drape/glfunctions.hpp index 4c99e43858..c9eb69ceb0 100644 --- a/drape/glfunctions.hpp +++ b/drape/glfunctions.hpp @@ -75,6 +75,8 @@ public: static uint32_t glGetCurrentProgram(); + static int32_t glGetProgramiv(uint32_t program, glConst paramname); + // Textures support static void glActiveTexture(uint32_t samplerBlock); static uint32_t glGenTexture();