opengl-triangle

Basic application that draws triangle on a window using opengl
Index Commits Files Refs
commit 551231958a39b8a2ac64b2a8b5cbf6e67b8c9d17
parent 52f14dd3b8dd21cec519f943e50b43b20a8f4ad7
Author: Martin Kloeckner <mjkloeckner@gmail.com>
Date:   Sat, 24 Aug 2024 00:19:38 -0300

add default return value to non-void function

Diffstat:
Mmain.c | 11++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/main.c b/main.c
@@ -23,8 +23,6 @@ float min(float a, float b) {
 }
 
 void framebuffer_size_callback(GLFWwindow* window, int width, int height) {
-    char s[100];
-
     float min_side = min((float)width, (float)height);
 
     float x = ((float)width - min_side) / 2;
@@ -101,14 +99,17 @@ bool new_program_from_shaders(GLuint *shader_program,
 
     glAttachShader(*shader_program, *vertex_shader);
     glAttachShader(*shader_program, *fragment_shader);
-    LOG_INFO("Linking `vertex_shader` and `fragment_shader`");
+    LOG_INFO("Linking shaders");
     glLinkProgram(*shader_program);
     glGetProgramiv(*shader_program, GL_LINK_STATUS, &return_value);
     if(return_value == GL_FALSE) {
         glGetProgramInfoLog(*shader_program, 512, NULL, link_log);
-        LOG_ERROR("Linking `vertex_shader` and `fragment_shader` failed");
+        LOG_ERROR("Linking shaders failed");
         LOG_ERROR(link_log + 7); // remove the `error: ` prefix of message
+        return false;
     }
+
+    return true;
 }
 
 bool new_program_from_shaders_source(GLuint *shader_program,
@@ -139,7 +140,7 @@ bool new_program_from_shaders_source(GLuint *shader_program,
 GLuint current_program;
 
 bool reload_shaders(const char *vert_shader_file_path, const char *frag_shader_file_path) {
-    LOG_INFO("Reloading shaders");
+    LOG_INFO("Recompiling shaders");
 
     GLuint new_program;
     if(!new_program_from_shaders_source(&new_program,