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"); } }
internal void Delete(GraphicsLibrary gl) => gl.DeleteProgram(program);