Watch
2
0
Fork
You've already forked raylib-cs
0

Fix for Examples.Logging by importing the nuget package

This commit is contained in:
AndreasSasDev 2024-05-09 14:47:10 +02:00
commit 268bcd38a8
2 changed files with 13 additions and 21 deletions

View file

@ -1,7 +1,7 @@
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using Raylib_cs;
using Serilog;
using static Raylib_cs.Raylib;
namespace Examples.Logging;
@ -29,7 +29,7 @@ public static class CustomSerilogLogging
// Attach Logger to callback
//--------------------------------------------------------------------------------------
unsafe {
SetTraceLogCallback(GetPointer());
Raylib.SetTraceLogCallback(GetPointer());
}
Logger.Information("Logger has been set to Raylib-cs TraceLogCallback");
@ -39,25 +39,25 @@ public static class CustomSerilogLogging
const int screenWidth = 800;
const int screenHeight = 450;
InitWindow(screenWidth, screenHeight, "raylib custom Logger example - basic window");
Raylib.InitWindow(screenWidth, screenHeight, "raylib custom Logger example - basic window");
// Main game loop
while (!WindowShouldClose())
while (!Raylib.WindowShouldClose())
{
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(Color.RayWhite);
Raylib.BeginDrawing();
Raylib.ClearBackground(Color.RayWhite);
DrawText("Hello World!", 190, 200, 20, Color.Black);
Raylib.DrawText("Hello World!", 190, 200, 20, Color.Black);
EndDrawing();
Raylib.EndDrawing();
//----------------------------------------------------------------------------------
}
// De-Initialization
//--------------------------------------------------------------------------------------
CloseWindow();
Raylib.CloseWindow();
//--------------------------------------------------------------------------------------
return 0;

View file

@ -8,21 +8,13 @@
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<Compile Remove="Core/LoadingThread.cs"/>
<Compile Remove="Text/Unicode.cs"/>
</ItemGroup>
<ItemGroup>
<Using Include="Raylib_cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="../Raylib-cs/Raylib-cs.csproj" />
<!-- <ItemGroup>-->
<!-- <ProjectReference Include="../Raylib-cs/Raylib-cs.csproj" />-->
<!-- <ProjectReference Include="../Raylib-cs.Native/Raylib-cs.Native.csproj" />-->
</ItemGroup>
<!-- </ItemGroup>-->
<ItemGroup>
<PackageReference Include="Raylib-cs" Version="6.0.0" />
<PackageReference Include="Serilog" Version="3.1.1" />
<PackageReference Include="Serilog.Sinks.Console" Version="5.0.1" />
</ItemGroup>