Esempio n. 1
0
        internal unsafe void LinkProgram(GraphicsLibrary gl)
        {
            gl.LinkProgram(program);
            int ls;

            gl.GetProgramiv(program, ProgramParameter.LinkStatus, &ls);
            if (ls == 0)
            {
                int len;
                gl.GetProgramiv(program, ProgramParameter.InfoLogLength, &len);
                if (len > 1)
                {
                    var buffer = new byte[len];
                    fixed(byte *p = buffer)
                    {
                        gl.GetProgramInfoLog(program, len, &len, p);
                        Console.WriteLine("Shader link message: " + Marshal.PtrToStringAnsi(new IntPtr(p)));
                    }
                }
                gl.DeleteProgram(program);
                throw new Exception("Shader link error");
            }
        }
Esempio n. 2
0
 internal void Delete(GraphicsLibrary gl)
 {
     gl.DeleteProgram(program);
 }