forked from goliath/shadermeh
Stop if shader compilation fails
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
This commit is contained in:
parent
e58028ae18
commit
6bfa914582
1 changed files with 9 additions and 7 deletions
16
shadermeh.c
16
shadermeh.c
|
@ -209,6 +209,7 @@ int main(int argc, char **argv)
|
|||
|
||||
if (!shader_program_get_build_status(prog)) {
|
||||
shader_program_print_info_log(prog);
|
||||
goto fail_vao;
|
||||
}
|
||||
|
||||
glUseProgram(prog);
|
||||
|
@ -278,19 +279,20 @@ int main(int argc, char **argv)
|
|||
}
|
||||
|
||||
/******************** cleanup ********************/
|
||||
glUseProgram(0);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
||||
glDeleteBuffers(1, &vbo);
|
||||
glBindVertexArray(0);
|
||||
glDeleteVertexArrays(1, &vao);
|
||||
glDeleteProgram(prog);
|
||||
|
||||
if (to_stdout) {
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, 0);
|
||||
glDeleteFramebuffers(1, &fbo);
|
||||
glDeleteTextures(1, &fbo_tex);
|
||||
}
|
||||
|
||||
glUseProgram(0);
|
||||
glDeleteProgram(prog);
|
||||
fail_vao:
|
||||
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
||||
glDeleteBuffers(1, &vbo);
|
||||
glBindVertexArray(0);
|
||||
glDeleteVertexArrays(1, &vao);
|
||||
|
||||
window_make_current(NULL);
|
||||
free(fb32);
|
||||
free(fb24);
|
||||
|
|
Loading…
Reference in a new issue