From b60e3a0ef6ab83ea1de609b22f8fd3a412a4c85f Mon Sep 17 00:00:00 2001 From: NishiOwO Date: Tue, 6 Jan 2026 22:29:22 +0900 Subject: [PATCH] update things --- LICENSE | 2 +- client/gl_shader.c | 24 ++++++++++++++++++++---- include/af_common.h | 2 +- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/LICENSE b/LICENSE index 23d9ab2..a7729ad 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2025, Fishsoup +Copyright (c) 2025-2026, Pyrite development team All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/client/gl_shader.c b/client/gl_shader.c index 26d4e31..b01ce46 100644 --- a/client/gl_shader.c +++ b/client/gl_shader.c @@ -1,5 +1,21 @@ #include +static void err(const char* path, GLuint shader) { + GLint len, ret; + char* e; + + glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &len); + + e = malloc(len); + e[len] = 0; + + glGetShaderInfoLog(shader, len, &ret, e); + + fprintf(stderr, "%s: %s\n", path, e); + + free(e); +} + int gl_shader(GLuint* r, const char* vs, const char* fs) { GLuint vsi; GLuint fsi; @@ -49,24 +65,24 @@ int gl_shader(GLuint* r, const char* vs, const char* fs) { glCompileShader(vsi); glGetShaderiv(vsi, GL_COMPILE_STATUS, &st); if(!st) { + err(vs, vsi); + glDeleteShader(vsi); glDeleteShader(fsi); free(vss); free(fss); - - printf("%s: compilation failure\n", vs); return 0; } glCompileShader(fsi); glGetShaderiv(fsi, GL_COMPILE_STATUS, &st); if(!st) { + err(fs, fsi); + glDeleteShader(vsi); glDeleteShader(fsi); free(vss); free(fss); - - printf("%s: compilation failure\n", fs); return 0; } diff --git a/include/af_common.h b/include/af_common.h index 9996739..800c17f 100644 --- a/include/af_common.h +++ b/include/af_common.h @@ -21,7 +21,7 @@ #define AF_DEFAULT_PORT 5312 #define AF_VERSION "0.0.0" -#define AF_COPYRIGHT "Copyright (C) 2025 Fishsoup" +#define AF_COPYRIGHT "Copyright (C) 2025-2026 Pyrite development team" enum AF_USER_PACKETS { AF_PACKET_HELLO = FISHSOUP_PACKET_USER,