Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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;
        }