using OpenTK.Mathematics; using OpenTK.Windowing.Common; using OpenTK.Windowing.Desktop; using Serilog; using Serilog.Events; using VoxelEngine.Core; Log.Logger = new LoggerConfiguration() .MinimumLevel.Debug() .Enrich.FromLogContext() .WriteTo.Console( restrictedToMinimumLevel: LogEventLevel.Information, outputTemplate: "[{Timestamp:HH:mm:ss.fff} {Level:u3}] [{SourceContext}] {Message:lj}{NewLine}{Exception}") .WriteTo.File( path: "logs/voxelengine-.log", rollingInterval: RollingInterval.Day, retainedFileCountLimit: 14, outputTemplate: "[{Timestamp:HH:mm:ss.fff} {Level:u3}] [{SourceContext}] {Message:lj}{NewLine}{Exception}") .CreateLogger(); try { Configuration cfg = new(); NativeWindowSettings nativeSettings = new() { ClientSize = new Vector2i(cfg.WindowWidth, cfg.WindowHeight), Title = "VoxelEngine", APIVersion = new Version(3, 3), Profile = ContextProfile.Core, Flags = ContextFlags.ForwardCompatible }; using Game game = new(cfg, GameWindowSettings.Default, nativeSettings); game.Run(); } catch (Exception ex) { Log.Fatal(ex, "Unhandled exception at top level"); throw; } finally { Log.CloseAndFlush(); }