Basic working deferred rendering

This commit is contained in:
Tleety
2014-04-27 02:44:04 +02:00
parent 9c329145c4
commit 87cac66cd8
17 changed files with 344 additions and 325 deletions
+6 -1
View File
@@ -103,6 +103,11 @@ void ShaderProgram::AddShader(std::shared_ptr<Shader> shader)
void ShaderProgram::Compile()
{
if (m_ShaderProgramHandle == 0)
{
m_ShaderProgramHandle = glCreateProgram();
}
for (auto &shader : m_Shaders)
{
if (!shader->IsCompiled())
@@ -121,7 +126,7 @@ GLuint ShaderProgram::Link()
}
LOG_INFO("Linking shader program");
m_ShaderProgramHandle = glCreateProgram();
for (auto &shader : m_Shaders)
{
glAttachShader(m_ShaderProgramHandle, shader->GetHandle());