[gl] Mock functions.

This commit is contained in:
Dmitry Kunin 2014-01-09 14:00:56 +03:00 committed by Alex Zolotarev
parent 6112d763a9
commit a39969c740
3 changed files with 11 additions and 4 deletions

View file

@ -185,14 +185,13 @@ bool GLFunctions::glHasExtension(string const & extName)
int32_t GLFunctions::glGetProgramiv(uint32_t program, glConst paramname)
{
// TODO: implement mock function
return 0;
return MOCK_CALL(glGetProgramiv(program, paramname));
}
void GLFunctions::glGetActiveUniform(uint32_t programID, uint32_t uniformIndex,
int32_t *uniformSize, glConst *type, string &name)
{
// TODO: implement mock function
MOCK_CALL(glGetActiveUniform(programID, uniformIndex, uniformSize, type, name));
}
void CheckGLError() {}

View file

@ -63,6 +63,12 @@ namespace emul
MOCK_METHOD1(glUseProgram, void(uint32_t programID));
MOCK_METHOD1(glHasExtension, bool(string const & extName));
MOCK_METHOD2(glGetProgramiv, int32_t(uint32_t, glConst));
MOCK_METHOD5(glGetActiveUniform, void(uint32_t, uint32_t,
int32_t*, glConst *,
string &));
private:
static GLMockFunctions * m_mock;
};

View file

@ -60,8 +60,10 @@ GpuProgram::GpuProgram(RefPointer<Shader> vertexShader, RefPointer<Shader> fragm
GLFunctions::glDetachShader(m_programID, vertexShader->GetID());
GLFunctions::glDetachShader(m_programID, fragmentShader->GetID());
//get uniforms info
#ifdef DEBUG
m_validator.reset(new UniformValidator(m_programID));
#endif
}
GpuProgram::~GpuProgram()