It is for ES 2.0, maybe also works for desktop GL.Replace LOG_PRINT with your own log printing API.
glGetShaderiv(vertexShader, GL_COMPILE_STATUS, &stat);
if (stat == GL_FALSE)
{
LOG_PRINT("SDL_LOG", "Error: Vertex shader compiling\n");
GLsizei iLength, slen = 0;
glGetShaderiv(vertexShader, GL_INFO_LOG_LENGTH, &iLength);
GLchar* compiler_log = new GLchar[iLength];
glGetShaderInfoLog(vertexShader, iLength, &slen, compiler_log);
LOG_PRINT("SDL_LOG", "%s\n", compiler_log);
delete[] compiler_log;
}
No comments:
Post a Comment