print shader source when it fails to compile

This commit is contained in:
Josh Holtrop 2012-10-03 23:22:04 -04:00
parent 7b9fe3aa6d
commit b20d7ab037

View File

@ -41,9 +41,15 @@ bool GLProgram::createv(const char *v_source, const char *f_source, va_list va)
if (v_source == NULL || f_source == NULL) if (v_source == NULL || f_source == NULL)
return false; return false;
if (!m_v_shader.create(GL_VERTEX_SHADER, v_source)) if (!m_v_shader.create(GL_VERTEX_SHADER, v_source))
{
cerr << "Failed vertex shader source:" << endl << v_source << endl;
return false; return false;
}
if (!m_f_shader.create(GL_FRAGMENT_SHADER, f_source)) if (!m_f_shader.create(GL_FRAGMENT_SHADER, f_source))
{
cerr << "Failed fragment shader source:" << endl << f_source << endl;
return false; return false;
}
m_id = glCreateProgram(); m_id = glCreateProgram();
if (m_id <= 0) if (m_id <= 0)
{ {