Skip to content

Commit 68e455f

Browse files
chore: change log error colors
1 parent 0d86fee commit 68e455f

1 file changed

Lines changed: 20 additions & 1 deletion

File tree

FreeFrame/Helper.cs

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,31 @@ static private void DebugCallback(DebugSource source, DebugType type, int id, De
2727
{
2828
string messageString = Marshal.PtrToStringAnsi(message, length); // Retrieve the string from the pointer
2929

30+
switch (severity)
31+
{
32+
case DebugSeverity.DontCare:
33+
case DebugSeverity.DebugSeverityNotification:
34+
Console.ForegroundColor = ConsoleColor.White;
35+
break;
36+
case DebugSeverity.DebugSeverityHigh:
37+
Console.ForegroundColor = ConsoleColor.Red;
38+
break;
39+
case DebugSeverity.DebugSeverityMedium:
40+
Console.ForegroundColor = ConsoleColor.DarkYellow;
41+
break;
42+
case DebugSeverity.DebugSeverityLow:
43+
Console.ForegroundColor = ConsoleColor.Yellow;
44+
break;
45+
default:
46+
break;
47+
}
3048
Console.WriteLine($"{severity} {type} | {messageString}");
49+
Console.ResetColor();
3150

3251
if (type == DebugType.DebugTypeError)
3352
throw new Exception("OpenGL error");
3453
}
35-
static public void DebugMode()
54+
static public void EnableDebugMode()
3655
{
3756
GL.DebugMessageCallback(_debugProcCallback, IntPtr.Zero);
3857
GL.Enable(EnableCap.DebugOutput);

0 commit comments

Comments
 (0)