mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 14:16:07 -06:00
CoreGl: Fixed checking program linking status
git-svn-id: svn://ultimatepp.org/upp/trunk@6288 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
428df46695
commit
a4e1d38628
1 changed files with 5 additions and 2 deletions
|
|
@ -81,7 +81,7 @@ bool Shader::IsProgramCompiled(int program)
|
|||
bool Shader::IsProgramLinked(int program)
|
||||
{
|
||||
GLint result = GL_FALSE;
|
||||
glGetShaderiv(program, GL_LINK_STATUS, &result);
|
||||
glGetProgramiv(program, GL_LINK_STATUS, &result);
|
||||
return result == GL_TRUE;
|
||||
}
|
||||
|
||||
|
|
@ -106,6 +106,7 @@ int Shader::CompileProgram(const char* vs, const char* fs)
|
|||
{
|
||||
PrintShaderInfoLog(vertexShader, "shader_vertex.log");
|
||||
error = "Vertex shader compilation error:\n\n" + compileError;
|
||||
glDeleteShader(vertexShader);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
@ -117,6 +118,7 @@ int Shader::CompileProgram(const char* vs, const char* fs)
|
|||
{
|
||||
PrintShaderInfoLog(fragmentShader, "shader_fragment.log");
|
||||
error = "Fragment shader compilation error:\n\n" + compileError;
|
||||
glDeleteShader(fragmentShader);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
@ -131,7 +133,8 @@ int Shader::CompileProgram(const char* vs, const char* fs)
|
|||
{
|
||||
PrintProgramInfoLog(program, "shader_link.log");
|
||||
PrintProgramValidationLog(program, "shader_validation.log");
|
||||
return -1;
|
||||
glDeleteProgram(program);
|
||||
program = -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue