X-Git-Url: http://git.lukelau.me/?p=opengl.git;a=blobdiff_plain;f=program.cpp;h=d6adf0630cd2b3d22f7f775a8fd1ee3d5811bbb9;hp=b1f2edeb52d2c210985fb24dadfe843d78d8c5de;hb=8abaf8f77191e1c660def0832d8036a8b4639ba8;hpb=c44e69ec78367fb2957324026894aef970f2481a diff --git a/program.cpp b/program.cpp index b1f2ede..d6adf06 100644 --- a/program.cpp +++ b/program.cpp @@ -48,3 +48,17 @@ Program::Program(const string vertexShader, const string fragmentShader) { exit(1); } } + +void Program::validate() const { + glValidateProgram(progId); + + GLint success; + glGetProgramiv(progId, GL_VALIDATE_STATUS, &success); + if (!success) { + GLchar log[1024]; + glGetProgramInfoLog(progId, sizeof(log), NULL, log); + fprintf(stderr, "error: %s\n", log); + exit(1); + } +} +