mirror of https://github.com/axmolengine/axmol.git
GLProgram should not abort() if shader compilation fails, returning false will allow app to show custom error message to user (or use other simple shaders if a complicated shader fails to compile on some device).
This commit is contained in:
parent
8222cdd8aa
commit
8ba4c7a083
|
@ -138,9 +138,17 @@ GLProgram::~GLProgram()
|
||||||
{
|
{
|
||||||
CCLOGINFO("%s %d deallocing GLProgram: %p", __FUNCTION__, __LINE__, this);
|
CCLOGINFO("%s %d deallocing GLProgram: %p", __FUNCTION__, __LINE__, this);
|
||||||
|
|
||||||
// there is no need to delete the shaders. They should have been already deleted.
|
if (_vertShader)
|
||||||
CCASSERT(_vertShader == 0, "Vertex Shaders should have been already deleted");
|
{
|
||||||
CCASSERT(_fragShader == 0, "Fragment Shaders should have been already deleted");
|
glDeleteShader(_vertShader);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_fragShader)
|
||||||
|
{
|
||||||
|
glDeleteShader(_fragShader);
|
||||||
|
}
|
||||||
|
|
||||||
|
_vertShader = _fragShader = 0;
|
||||||
|
|
||||||
if (_program)
|
if (_program)
|
||||||
{
|
{
|
||||||
|
@ -436,7 +444,7 @@ bool GLProgram::compileShader(GLuint * shader, GLenum type, const GLchar* source
|
||||||
}
|
}
|
||||||
free(src);
|
free(src);
|
||||||
|
|
||||||
abort();
|
return false;;
|
||||||
}
|
}
|
||||||
return (status == GL_TRUE);
|
return (status == GL_TRUE);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue