public void AttachShader(Shader shader) { GL.AttachShader(Id, shader.Id); // We should maitain a reference to it or the GC may reclaim the Shader object Shaders.Add(shader); }
public static ShaderProgram LoadVSPSShader(string vs, string ps) { Shader vss = new Shader(ShaderType.VertexShader, ContentManager.Instance.Load<String>(vs)); Shader pss = new Shader(ShaderType.FragmentShader, ContentManager.Instance.Load<String>(ps)); ShaderProgram program = new ShaderProgram(); program.AttachShader(vss); program.AttachShader(pss); return program; }