add silk demo

This commit is contained in:
ikpil 2023-03-21 00:33:17 +09:00
parent 7c6957b072
commit f3bc77c132
6 changed files with 75 additions and 9 deletions

View File

@ -35,6 +35,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotRecast.Detour.TileCache.
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotRecast.Recast.Demo", "src\DotRecast.Recast.Demo\DotRecast.Recast.Demo.csproj", "{023E1E6A-4895-4573-89AE-3D5D8E0B39C8}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotRecast.Recast.Demo", "src\DotRecast.Recast.Demo\DotRecast.Recast.Demo.csproj", "{023E1E6A-4895-4573-89AE-3D5D8E0B39C8}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotRecast.Silk", "src\DotRecast.Silk\DotRecast.Silk.csproj", "{330F016B-70AE-473F-A06E-1976721B87CC}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -100,6 +102,10 @@ Global
{023E1E6A-4895-4573-89AE-3D5D8E0B39C8}.Debug|Any CPU.Build.0 = Debug|Any CPU {023E1E6A-4895-4573-89AE-3D5D8E0B39C8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{023E1E6A-4895-4573-89AE-3D5D8E0B39C8}.Release|Any CPU.ActiveCfg = Release|Any CPU {023E1E6A-4895-4573-89AE-3D5D8E0B39C8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{023E1E6A-4895-4573-89AE-3D5D8E0B39C8}.Release|Any CPU.Build.0 = Release|Any CPU {023E1E6A-4895-4573-89AE-3D5D8E0B39C8}.Release|Any CPU.Build.0 = Release|Any CPU
{330F016B-70AE-473F-A06E-1976721B87CC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{330F016B-70AE-473F-A06E-1976721B87CC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{330F016B-70AE-473F-A06E-1976721B87CC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{330F016B-70AE-473F-A06E-1976721B87CC}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(NestedProjects) = preSolution GlobalSection(NestedProjects) = preSolution
{FFE40BBF-843B-41FA-8504-F4ABD166762E} = {8ED75CF7-A3D6-423D-8499-9316DD413DAD} {FFE40BBF-843B-41FA-8504-F4ABD166762E} = {8ED75CF7-A3D6-423D-8499-9316DD413DAD}
@ -116,5 +122,6 @@ Global
{DEB16B90-CCD4-497E-A2E9-4CC66FD7EF47} = {8ED75CF7-A3D6-423D-8499-9316DD413DAD} {DEB16B90-CCD4-497E-A2E9-4CC66FD7EF47} = {8ED75CF7-A3D6-423D-8499-9316DD413DAD}
{3CAA7306-088E-4373-A406-99755CC2B605} = {A7CB8D8B-70DA-4567-8316-0659FCAE1C73} {3CAA7306-088E-4373-A406-99755CC2B605} = {A7CB8D8B-70DA-4567-8316-0659FCAE1C73}
{023E1E6A-4895-4573-89AE-3D5D8E0B39C8} = {8ED75CF7-A3D6-423D-8499-9316DD413DAD} {023E1E6A-4895-4573-89AE-3D5D8E0B39C8} = {8ED75CF7-A3D6-423D-8499-9316DD413DAD}
{330F016B-70AE-473F-A06E-1976721B87CC} = {8ED75CF7-A3D6-423D-8499-9316DD413DAD}
EndGlobalSection EndGlobalSection
EndGlobal EndGlobal

View File

@ -8,10 +8,11 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Serilog" Version="2.12.0" /> <PackageReference Include="Serilog" Version="2.12.0" />
<PackageReference Include="Serilog.Enrichers.Environment" Version="2.2.0" /> <PackageReference Include="Serilog.Settings.Configuration" Version="3.4.0" />
<PackageReference Include="Serilog.Enrichers.Thread" Version="3.1.0" /> <PackageReference Include="Serilog.Enrichers.Thread" Version="3.1.0" />
<PackageReference Include="Serilog.Sinks.Async" Version="1.5.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="4.1.0" /> <PackageReference Include="Serilog.Sinks.Console" Version="4.1.0" />
<PackageReference Include="Serilog.Sinks.RollingFile" Version="3.3.0" /> <PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
<PackageReference Include="Silk.NET" Version="2.16.0" /> <PackageReference Include="Silk.NET" Version="2.16.0" />
<PackageReference Include="Silk.NET.OpenGL.Extensions.ImGui" Version="2.16.0" /> <PackageReference Include="Silk.NET.OpenGL.Extensions.ImGui" Version="2.16.0" />
</ItemGroup> </ItemGroup>

View File

@ -1,6 +1,7 @@
using System.IO; using System.IO;
using DotRecast.Core; using DotRecast.Core;
using Serilog; using Serilog;
using Serilog.Enrichers;
namespace DotRecast.Recast.Demo; namespace DotRecast.Recast.Demo;
@ -18,14 +19,18 @@ public static class Program
Directory.SetCurrentDirectory(workingDirectory); Directory.SetCurrentDirectory(workingDirectory);
} }
var format = "{Timestamp:yyyy-MM-dd HH:mm:ss.fff} [{Level:u3}] {Message:lj} [{MemberName}()] [{ThreadName}:{ThreadId}] at {FilePath}:{LineNumber} {NewLine}{Exception}";
Log.Logger = new LoggerConfiguration() Log.Logger = new LoggerConfiguration()
.Enrich.WithThreadId()
//.Enrich.WithExceptionDetails()
.Enrich.FromLogContext()
//.Enrich.WithMethodFullName()
.MinimumLevel.Verbose() .MinimumLevel.Verbose()
.WriteTo.File("logs/log.txt") .Enrich.WithThreadId()
.WriteTo.Console() .Enrich.WithThreadName()
.Enrich.WithProperty(ThreadNameEnricher.ThreadNamePropertyName, "main")
.WriteTo.Console(outputTemplate: format)
.WriteTo.File(
"logs/log.log",
rollingInterval: RollingInterval.Day,
rollOnFileSizeLimit: true,
outputTemplate: format)
.CreateLogger(); .CreateLogger();
var demo = new RecastDemo(); var demo = new RecastDemo();

View File

@ -0,0 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Serilog" Version="2.12.0" />
<PackageReference Include="Serilog.Settings.Configuration" Version="3.4.0" />
<PackageReference Include="Serilog.Enrichers.Thread" Version="3.1.0" />
<PackageReference Include="Serilog.Sinks.Async" Version="1.5.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="4.1.0" />
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
<PackageReference Include="Silk.NET" Version="2.16.0" />
<PackageReference Include="Silk.NET.OpenGL.Extensions.ImGui" Version="2.16.0" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,26 @@
using System;
using Serilog;
using Serilog.Enrichers;
public class Program
{
// Only Graphics Test
public static void Main(string[] args)
{
var format = "{Timestamp:yyyy-MM-dd HH:mm:ss.fff} [{Level:u3}] {Message:lj} [{MemberName}()] [{ThreadName}:{ThreadId}] at {FilePath}:{LineNumber} {NewLine}{Exception}";
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Verbose()
.Enrich.WithThreadId()
.Enrich.WithThreadName()
.Enrich.WithProperty(ThreadNameEnricher.ThreadNamePropertyName, "main")
.WriteTo.Console(outputTemplate: format)
.WriteTo.File(
"logs/log.log",
rollingInterval: RollingInterval.Day,
rollOnFileSizeLimit: true,
outputTemplate: format)
.CreateLogger();
Log.Logger.Information("Hello, World!");
}
}

View File

@ -0,0 +1,8 @@
using Serilog;
namespace DotRecast.Silk;
public class SilkDemo
{
private static readonly ILogger Logger = Log.ForContext<SilkDemo>();
}