From a6945cb85228820394b5f6ae9c8db224cf5d23f3 Mon Sep 17 00:00:00 2001 From: cshesse <48501609+cshesse@users.noreply.github.com> Date: Sun, 22 Dec 2019 20:39:23 -0800 Subject: [PATCH] fix possible bug in uniform sample code --- stb_voxel_render.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stb_voxel_render.h b/stb_voxel_render.h index b323b4d..b84bd8f 100644 --- a/stb_voxel_render.h +++ b/stb_voxel_render.h @@ -614,7 +614,7 @@ void setup_uniforms(GLuint shader, float camera_pos[4], GLuint tex1, GLuint tex2 stbvox_uniform_info sui; if (stbvox_get_uniform_info(&sui, i)) { GLint loc = glGetUniformLocation(shader, sui.name); - if (loc != 0) { + if (loc != -1) { switch (i) { case STBVOX_UNIFORM_camera_pos: // only needed for fog glUniform4fv(loc, sui.array_length, camera_pos);