From 0c048ea53bb3579e6e01de1cd8221e056d87b067 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Tue, 1 Jun 2021 17:59:57 +0200 Subject: [PATCH] glhr:: more informative messages on shader compile failure with -dgl --- glhr.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/glhr.cpp b/glhr.cpp index d3017088..16505214 100644 --- a/glhr.cpp +++ b/glhr.cpp @@ -338,9 +338,13 @@ EX int compileShader(int type, const string& s) { if (logLength > 0) { std::vector log(logLength); glGetShaderInfoLog(shader, logLength, &logLength, log.data()); + string s = log.data(); if(logLength > 0) - printf("compiler log (%d): '%s'\n", logLength, log.data()); - if(debug_gl) exit(1); + println(hlog, "compiler log (", logLength, "): \n", s); + if(debug_gl) { + println(hlog, "failed to compile shader -- exit called"); + exit(1); + } } glGetShaderiv(shader, GL_COMPILE_STATUS, &status);