CShader: Mark several functions as const

These don't modify internal member state.
This commit is contained in:
Lioncash 2020-06-16 18:32:59 -04:00
parent a67df9865e
commit f44a5fc8d2
2 changed files with 8 additions and 8 deletions

View File

@ -160,22 +160,22 @@ bool CShader::LinkShaders()
return true;
}
bool CShader::IsValidProgram()
bool CShader::IsValidProgram() const
{
return mProgramExists;
}
GLuint CShader::GetProgramID()
GLuint CShader::GetProgramID() const
{
return mProgram;
}
GLuint CShader::GetUniformLocation(const char* pkUniform)
GLuint CShader::GetUniformLocation(const char* pkUniform) const
{
return glGetUniformLocation(mProgram, pkUniform);
}
GLuint CShader::GetUniformBlockIndex(const char* pkUniformBlock)
GLuint CShader::GetUniformBlockIndex(const char* pkUniformBlock) const
{
return glGetUniformBlockIndex(mProgram, pkUniformBlock);
}

View File

@ -35,10 +35,10 @@ public:
bool CompileVertexSource(const char* pkSource);
bool CompilePixelSource(const char* pkSource);
bool LinkShaders();
bool IsValidProgram();
GLuint GetProgramID();
GLuint GetUniformLocation(const char* pkUniform);
GLuint GetUniformBlockIndex(const char* pkUniformBlock);
bool IsValidProgram() const;
GLuint GetProgramID() const;
GLuint GetUniformLocation(const char* pkUniform) const;
GLuint GetUniformBlockIndex(const char* pkUniformBlock) const;
void UniformBlockBinding(GLuint BlockIndex, GLuint BlockBinding);
void SetTextureUniforms(uint32 NumTextures);
void SetNumLights(uint32 NumLights);