diff options
| author | LLLL Colonq <llll@colonq> | 2025-02-18 17:32:20 -0500 |
|---|---|---|
| committer | LLLL Colonq <llll@colonq> | 2025-02-18 17:32:20 -0500 |
| commit | e73044fbd51f9c8f15eb6bd60248887ccd8b16f0 (patch) | |
| tree | 992b9326b9b66f3d81cde32b06e781fe792ca7d6 | |
| parent | 8d95be60ea34462cb178389e5ce9c92ad41ecd8b (diff) | |
Don't error please
| -rw-r--r-- | src/context.rs | 9 | ||||
| -rw-r--r-- | src/shader.rs | 4 |
2 files changed, 11 insertions, 2 deletions
diff --git a/src/context.rs b/src/context.rs index 2171053..9f0d4ad 100644 --- a/src/context.rs +++ b/src/context.rs @@ -216,4 +216,13 @@ impl Context { self.gl.disable(glow::CULL_FACE); } } + + pub fn check_error(&self) { + unsafe { + let err = self.gl.get_error(); + if err != 0 { + log::warn!("gl error: {}", err); + } + } + } } diff --git a/src/shader.rs b/src/shader.rs index d260881..178833a 100644 --- a/src/shader.rs +++ b/src/shader.rs @@ -49,10 +49,10 @@ impl Shader { ctx.gl.link_program(program); if !ctx.gl.get_program_link_status(program) { - panic!( + return Err(format!( "failed to link shader program:\n{}", ctx.gl.get_program_info_log(program), - ); + )); } ctx.gl.detach_shader(program, vert); |
