示例#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 InvalidOperationException("Shader link error");
            }
        }
示例#2
0
 internal void Delete(GraphicsLibrary gl) => gl.DeleteProgram(program);