GL.DebugMessageCallback((DebugSource source, DebugType type, int id, DebugSeverity severity, int length, IntPtr messagePtr, IntPtr errorParam) => {
var oldForegroundColor = Console.ForegroundColor;
var message = new string((sbyte*)messagePtr, 0, length, Encoding.ASCII);
switch (severity)
{
case DebugSeverity.DebugSeverityNotification:
Console.ForegroundColor = ConsoleColor.DarkYellow;
break;
case DebugSeverity.DebugSeverityHigh:
Console.ForegroundColor = ConsoleColor.Red;
break;
case DebugSeverity.DebugSeverityMedium:
Console.ForegroundColor = ConsoleColor.Blue;
break;
case DebugSeverity.DebugSeverityLow:
Console.ForegroundColor = ConsoleColor.Green;
break;
}
Console.WriteLine(message);
Console.ForegroundColor = oldForegroundColor;
}, IntPtr.Zero);