From 9b1a99c6d8ba5a49311cfeee9f6bdfebfc22e0a5 Mon Sep 17 00:00:00 2001 From: Memresable <86978624+Memresable@users.noreply.github.com> Date: Sat, 15 Feb 2025 09:08:44 +0300 Subject: [PATCH 1/3] Fix opengl's `check_error` helper procedure not printing errors in debug builds --- vendor/OpenGL/helpers.odin | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/vendor/OpenGL/helpers.odin b/vendor/OpenGL/helpers.odin index 0bd8e451b93..e592263c54d 100644 --- a/vendor/OpenGL/helpers.odin +++ b/vendor/OpenGL/helpers.odin @@ -67,15 +67,14 @@ when GL_DEBUG { last_compile_error_type = type log_func(id, i32(info_log_length), nil, raw_data(last_compile_error_message), loc) - //fmt.printf_err("Error in %v:\n%s", type, string(last_compile_error_message[0:len(last_compile_error_message)-1])); + fmt.eprintf("Error in %v:\n%s", type, string(last_compile_error_message[0:len(last_compile_error_message)-1])); } else { - delete(last_link_error_message) last_link_error_message = make([]byte, info_log_length) last_compile_error_type = type log_func(id, i32(info_log_length), nil, raw_data(last_link_error_message), loc) - //fmt.printf_err("Error in %v:\n%s", type, string(last_link_error_message[0:len(last_link_error_message)-1])); + fmt.eprintf("Error in %v:\n%s", type, string(last_link_error_message[0:len(last_link_error_message)-1])); } return false @@ -97,21 +96,20 @@ when GL_DEBUG { if result == 0 { if log_func == GetShaderInfoLog { delete(last_compile_error_message) - last_compile_error_message = make([]u8, info_log_length) - last_link_error_type = type + last_compile_error_message = make([]byte, info_log_length) + last_compile_error_type = type log_func(id, i32(info_log_length), nil, raw_data(last_compile_error_message)) - fmt.eprintf("Error in %v:\n%s", type, string(last_compile_error_message[0:len(last_compile_error_message)-1])) + // fmt.eprintf("Error in %v:\n%s", type, string(last_compile_error_message[0:len(last_compile_error_message)-1])); } else { delete(last_link_error_message) - last_link_error_message = make([]u8, info_log_length) - last_link_error_type = type + last_link_error_message = make([]byte, info_log_length) + last_compile_error_type = type log_func(id, i32(info_log_length), nil, raw_data(last_link_error_message)) - fmt.eprintf("Error in %v:\n%s", type, string(last_link_error_message[0:len(last_link_error_message)-1])) - + // fmt.eprintf("Error in %v:\n%s", type, string(last_link_error_message[0:len(last_link_error_message)-1])); } - + return false } From 2cad0b0fc4985ef323c0aeb9c3189e83dcb6eba7 Mon Sep 17 00:00:00 2001 From: Memresable <86978624+Memresable@users.noreply.github.com> Date: Sat, 15 Feb 2025 09:14:52 +0300 Subject: [PATCH 2/3] Fix few typos --- vendor/OpenGL/helpers.odin | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vendor/OpenGL/helpers.odin b/vendor/OpenGL/helpers.odin index e592263c54d..33d664a2236 100644 --- a/vendor/OpenGL/helpers.odin +++ b/vendor/OpenGL/helpers.odin @@ -71,7 +71,7 @@ when GL_DEBUG { } else { delete(last_link_error_message) last_link_error_message = make([]byte, info_log_length) - last_compile_error_type = type + last_link_error_type = type log_func(id, i32(info_log_length), nil, raw_data(last_link_error_message), loc) fmt.eprintf("Error in %v:\n%s", type, string(last_link_error_message[0:len(last_link_error_message)-1])); @@ -104,7 +104,7 @@ when GL_DEBUG { } else { delete(last_link_error_message) last_link_error_message = make([]byte, info_log_length) - last_compile_error_type = type + last_link_error_type = type log_func(id, i32(info_log_length), nil, raw_data(last_link_error_message)) // fmt.eprintf("Error in %v:\n%s", type, string(last_link_error_message[0:len(last_link_error_message)-1])); From 08fc98945f0b562fb4321868a4b51892a6787538 Mon Sep 17 00:00:00 2001 From: Memresable <86978624+Memresable@users.noreply.github.com> Date: Sat, 15 Feb 2025 18:17:09 +0300 Subject: [PATCH 3/3] Remove unecessary semicolons --- vendor/OpenGL/helpers.odin | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vendor/OpenGL/helpers.odin b/vendor/OpenGL/helpers.odin index 33d664a2236..c63e2986b0a 100644 --- a/vendor/OpenGL/helpers.odin +++ b/vendor/OpenGL/helpers.odin @@ -67,14 +67,14 @@ when GL_DEBUG { last_compile_error_type = type log_func(id, i32(info_log_length), nil, raw_data(last_compile_error_message), loc) - fmt.eprintf("Error in %v:\n%s", type, string(last_compile_error_message[0:len(last_compile_error_message)-1])); + fmt.eprintf("Error in %v:\n%s", type, string(last_compile_error_message[0:len(last_compile_error_message)-1])) } else { delete(last_link_error_message) last_link_error_message = make([]byte, info_log_length) last_link_error_type = type log_func(id, i32(info_log_length), nil, raw_data(last_link_error_message), loc) - fmt.eprintf("Error in %v:\n%s", type, string(last_link_error_message[0:len(last_link_error_message)-1])); + fmt.eprintf("Error in %v:\n%s", type, string(last_link_error_message[0:len(last_link_error_message)-1])) } return false @@ -100,14 +100,14 @@ when GL_DEBUG { last_compile_error_type = type log_func(id, i32(info_log_length), nil, raw_data(last_compile_error_message)) - // fmt.eprintf("Error in %v:\n%s", type, string(last_compile_error_message[0:len(last_compile_error_message)-1])); + // fmt.eprintf("Error in %v:\n%s", type, string(last_compile_error_message[0:len(last_compile_error_message)-1])) } else { delete(last_link_error_message) last_link_error_message = make([]byte, info_log_length) last_link_error_type = type log_func(id, i32(info_log_length), nil, raw_data(last_link_error_message)) - // fmt.eprintf("Error in %v:\n%s", type, string(last_link_error_message[0:len(last_link_error_message)-1])); + // fmt.eprintf("Error in %v:\n%s", type, string(last_link_error_message[0:len(last_link_error_message)-1])) } return false