#region usings using System; using OpenTK.Graphics.OpenGL4; #endregion namespace SM.OGL { public class GLCustomActions { /// /// A action that is performed, when a OpenGL-error occurs. /// public static Action AtKHRDebug = DefaultDebugAction; /// /// A action, that is performed, when a GLError occurred. /// Doesn't account for "KHR_debugging" /// public static Action AtError; /// /// A action, that is performed, when a warning want to be shown. /// public static Action AtWarning; /// /// A action, that is performed, when a information needs to be shown. /// public static Action AtInfo; /// /// Default action for 'AtKHRDebug'. /// /// /// /// /// private static void DefaultDebugAction(DebugSource source, DebugType type, DebugSeverity severity, string msg) { Console.WriteLine($"{severity}, {type}, {source} -> {msg}"); if (type == DebugType.DebugTypeError) throw new Exception(msg); } } }