瀏覽代碼

fix possible bug in uniform sample code

cshesse 5 年之前
父節點
當前提交
a6945cb852
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      stb_voxel_render.h

+ 1 - 1
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);