aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/shader.c
diff options
context:
space:
mode:
authorMaria Lisina <sekoohaka.sarisan@gmail.com>2026-08-10 10:38:14 +0500
committerMaria Lisina <sekoohaka.sarisan@gmail.com>2026-08-10 10:38:14 +0500
commit6dc1149d078fc3b04a19696bfb7d5d6940372175 (patch)
tree169f7f71e6a292a4ab61a0493000e1add4430f8e /src/shader.c
parent6836426ae183b9a7d0ec99c1e147e8ad6edabd92 (diff)
parent80517840f4ae64469721598e8373d81f2e4493dd (diff)
Merge tag '6.0.0' of https://repo.dec05eba.com/gpu-screen-recorder into debian
Diffstat (limited to 'src/shader.c')
-rw-r--r--src/shader.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/shader.c b/src/shader.c
index f20ebb2..47e152a 100644
--- a/src/shader.c
+++ b/src/shader.c
@@ -1,6 +1,6 @@
#include "../include/shader.h"
+#include "../include/log.h"
#include "../include/egl.h"
-#include <stdio.h>
#include <assert.h>
static bool print_compile_errors = false;
@@ -12,7 +12,7 @@ static int min_int(int a, int b) {
static unsigned int load_shader(gsr_egl *egl, unsigned int type, const char *source) {
unsigned int shader_id = egl->glCreateShader(type);
if(shader_id == 0) {
- fprintf(stderr, "gsr error: load_shader: failed to create shader, error: %d\n", egl->glGetError());
+ gsr_log(GSR_LOG_LEVEL_ERROR, "load_shader: failed to create shader, error: %d", egl->glGetError());
return 0;
}
@@ -28,7 +28,7 @@ static unsigned int load_shader(gsr_egl *egl, unsigned int type, const char *sou
if(info_length > 1 && print_compile_errors) {
char info_log[4096];
egl->glGetShaderInfoLog(shader_id, min_int(4096, info_length), NULL, info_log);
- fprintf(stderr, "gsr error: load_shader: failed to compile shader, error:\n%s\nshader source:\n%s\n", info_log, source);
+ gsr_log(GSR_LOG_LEVEL_ERROR, "load_shader: failed to compile shader, error:\n%s\nshader source:\n%s", info_log, source);
}
egl->glDeleteShader(shader_id);
@@ -59,7 +59,7 @@ static unsigned int load_program(gsr_egl *egl, const char *vertex_shader, const
program_id = egl->glCreateProgram();
if(program_id == 0) {
- fprintf(stderr, "gsr error: load_program: failed to create shader program, error: %d\n", egl->glGetError());
+ gsr_log(GSR_LOG_LEVEL_ERROR, "load_program: failed to create shader program, error: %d", egl->glGetError());
goto done;
}
@@ -79,7 +79,7 @@ static unsigned int load_program(gsr_egl *egl, const char *vertex_shader, const
if(info_length > 1) {
char info_log[4096];
egl->glGetProgramInfoLog(program_id, min_int(4096, info_length), NULL, info_log);
- fprintf(stderr, "gsr error: load program: linking shader program failed, error:\n%s\n", info_log);
+ gsr_log(GSR_LOG_LEVEL_ERROR, "load program: linking shader program failed, error:\n%s", info_log);
}
goto done;
@@ -106,7 +106,7 @@ int gsr_shader_init(gsr_shader *self, gsr_egl *egl, const char *vertex_shader, c
self->program_id = 0;
if(!vertex_shader && !fragment_shader) {
- fprintf(stderr, "gsr error: gsr_shader_init: vertex and fragment shader can't be NULL at the same time\n");
+ gsr_log(GSR_LOG_LEVEL_ERROR, "gsr_shader_init: vertex and fragment shader can't be NULL at the same time");
return -1;
}