unsigned int BuildShaderProgram(unsigned int vertexShader, unsigned int fragmentShader);
bool DeleteShaderProgram(unsigned int programId);
- void UseShaderProgram(ShaderProgram* pShaderProgram); // TODO: _ShaderProgramImpl?
+ void UseShaderProgram(_ShaderProgramImpl* pShaderProgram);
void GetShaderProgramInfo(_ShaderProgramImpl* pShaderProgram);
unsigned int __textureId;
- ShaderProgram* __pCurrentShader;
+ _ShaderProgramImpl* __pCurrentShader;
ShaderProgram* __pColorShader;
ShaderProgram* __pUniformColorShader;
{
_ShaderProgramImpl* pProgramImpl = _ShaderProgramImpl::GetInstance(*__pRenderQueue[i].__pProgram);
- __pGlContext->UseShaderProgram(__pRenderQueue[i].__pProgram);
+ __pGlContext->UseShaderProgram(pProgramImpl);
// Set attribute
glVertexAttribPointer(__pRenderQueue[i].__aPosition, 3, GL_FLOAT, GL_FALSE, VERTEX_BUFFER_STRIDE * sizeof(float), __pRenderQueue[i].__pVertices);
}
void
-_GlContext::UseShaderProgram(ShaderProgram* pShaderProgram)
+_GlContext::UseShaderProgram(_ShaderProgramImpl* pShaderProgram)
{
if (__pCurrentShader == pShaderProgram)
{
if (__pCurrentShader)
{
- DisableVertexAttribArray(_ShaderProgramImpl::GetInstance(*__pCurrentShader));
+ DisableVertexAttribArray(__pCurrentShader);
__pCurrentShader = null;
}
{
__pCurrentShader = pShaderProgram;
- _ShaderProgramImpl* pShaderProgramImpl = _ShaderProgramImpl::GetInstance(*__pCurrentShader);
+ EnableVertexAttribArray(pShaderProgram);
- EnableVertexAttribArray(pShaderProgramImpl);
-
- glUseProgram(pShaderProgramImpl->__program);
+ glUseProgram(pShaderProgram->__program);
}
else
{