コード例 #1
0
 public void setUniform(string name, float value, float value2, float value3, float value4)
 {
     if (Uniforms.ContainsKey(name))
     {
         GL.Uniform4(Uniforms[name].address, value, value2, value3, value4);
     }
     else
     {
         logWarning(string.Format("Warning: \"{0}\" not found in shader \"{1}\"", name, Name));
     }
 }
コード例 #2
0
 public void setUniform(string name, Matrix4 mat)
 {
     if (Uniforms.ContainsKey(name))
     {
         GL.UniformMatrix4(Uniforms[name].address, false, ref mat);
     }
     else
     {
         logWarning(string.Format("Warning: \"{0}\" not found in shader \"{1}\"", name, Name));
     }
 }
コード例 #3
0
 public void setUniform(string name, bool value)
 {
     if (Uniforms.ContainsKey(name))
     {
         GL.Uniform1(Uniforms[name].address, (value) ? 1 : 0);
     }
     else
     {
         logWarning(string.Format("Warning: \"{0}\" not found in shader \"{1}\"", name, Name));
     }
 }
コード例 #4
0
 public void setUniform(string name, Matrix4[] mat)
 {
     if (Uniforms.ContainsKey("{name}[0]"))
     {
         for (int i = 0; i < mat.Length; i++)
         {
             int loc = GL.GetUniformLocation(Pointer, "{name}[{i}]");
             GL.UniformMatrix4(loc, false, ref mat[i]);
         }
     }
     else
     {
         logWarning(string.Format("Warning: \"{0}\" not found in shader \"{1}\"", name, Name));
     }
 }