public void SetValue(Matrix param) { if (Type != typeof(Matrix)) { throw new Exception(string.Format("SetValue({0}) was given a Matrix.", Type)); } GLShortcut.UniformMatrix4(location, param); }
/// <summary> /// Compiles a shader, which can be either vertex, fragment or geometry. /// </summary> /// <param name="source">Specifies the source code of the shader object.</param> /// <param name="type">Specifies the type of shader to create (either vertex, fragment or geometry).</param> public Shader(ShaderType type, string source) { this.ShaderType = type; this.ShaderID = Gl.CreateShader((int)type); GLShortcut.ShaderSource(ShaderID, source); Gl.CompileShader(ShaderID); GetParams(source); }