Skip to content

Commit

Permalink
Add error callback
Browse files Browse the repository at this point in the history
  • Loading branch information
deccer committed Nov 21, 2022
1 parent 0660292 commit 2c1ec16
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/EngineKit/Application.cs
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ protected virtual bool Initialize()
_logger.Error("{Category}: Unable to initialize", "Glfw");
return false;
}

Glfw.SetErrorCallback(ErrorCallback);

var windowSettings = _windowSettings.Value;
var windowResizable = windowSettings.WindowMode is WindowMode.Windowed or WindowMode.WindowedBorderless;
Expand Down Expand Up @@ -492,4 +494,9 @@ private void DebugCallback(
}
}
}

private void ErrorCallback(Glfw.ErrorCode errorCode, string errorDescription)
{
_logger.Error("{Category}: {ErrorCode} - {ErrorDescription}", "Glfw", errorCode, errorDescription);
}
}

0 comments on commit 2c1ec16

Please sign in to comment.