diff --git a/Raylib-cs/Logging.cs b/Raylib-cs/Logging.cs index aeebc0c..db0f3fe 100644 --- a/Raylib-cs/Logging.cs +++ b/Raylib-cs/Logging.cs @@ -37,16 +37,17 @@ namespace Raylib_cs /// /// Logging workaround for formatting strings from native code /// - 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); } diff --git a/Raylib-cs/Raylib.cs b/Raylib-cs/Raylib.cs index a96870b..2481d73 100644 --- a/Raylib-cs/Raylib.cs +++ b/Raylib-cs/Raylib.cs @@ -24,7 +24,6 @@ namespace Raylib_cs /// public static Color Fade(Color color, float alpha) => ColorAlpha(color, alpha); - //------------------------------------------------------------------------------------ // Window and Graphics Device Functions (Module: core) //------------------------------------------------------------------------------------