From 1ecaa9276684dd0ed1882b8e6abe06887cc4bcc3 Mon Sep 17 00:00:00 2001 From: Luca Conte Date: Thu, 16 May 2024 16:31:31 +0200 Subject: [PATCH] exit on shader error --- u08-2/main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/u08-2/main.c b/u08-2/main.c index 6ba9016..aa64609 100644 --- a/u08-2/main.c +++ b/u08-2/main.c @@ -131,6 +131,7 @@ void init(void) { GLchar infoLog[1024]; glGetShaderInfoLog(vertexShader, 1024, NULL, infoLog); printf("%s",infoLog); + exit(1); } vertexTextConst = NULL; @@ -152,6 +153,7 @@ void init(void) { GLchar infoLog[1024]; glGetShaderInfoLog(fragmentShader, 1024, NULL, infoLog); printf("%s",infoLog); + exit(1); } // create and link shader program @@ -167,6 +169,7 @@ void init(void) { GLchar infoLog[1024]; glGetProgramInfoLog(program, 1024, NULL, infoLog); printf("%s",infoLog); + exit(1); } glValidateProgram(program); @@ -178,6 +181,7 @@ void init(void) { GLchar infoLog[1024]; glGetProgramInfoLog(program, 1024, NULL, infoLog); printf("%s",infoLog); + exit(1); }