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

Update default LogConsole callback

This commit is contained in:
Rgebee 2021-12-29 17:02:50 +00:00
commit e2fc83717f
2 changed files with 5 additions and 5 deletions

View file

@ -37,16 +37,17 @@ namespace Raylib_cs
/// <summary>
/// Logging workaround for formatting strings from native code
/// </summary>
public static class Logging
public static unsafe class Logging
{
static Logging()
{
Raylib.SetTraceLogCallback(LogConsole);
Raylib.SetTraceLogCallback(&LogConsole);
}
public static void LogConsole(TraceLogLevel msgType, IntPtr text, IntPtr args)
[UnmanagedCallersOnly(CallConvs = new[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
public static unsafe void LogConsole(int msgType, sbyte* text, sbyte* args)
{
var message = GetLogMessage(text, args);
var message = GetLogMessage(new IntPtr(text), new IntPtr(args));
Console.WriteLine(message);
}

View file

@ -24,7 +24,6 @@ namespace Raylib_cs
/// </summary>
public static Color Fade(Color color, float alpha) => ColorAlpha(color, alpha);
//------------------------------------------------------------------------------------
// Window and Graphics Device Functions (Module: core)
//------------------------------------------------------------------------------------