|
@@ -18,11 +18,32 @@ namespace AtomicEngine
|
|
|
#endif
|
|
#endif
|
|
|
block();
|
|
block();
|
|
|
#if ATOMIC_PROFILING
|
|
#if ATOMIC_PROFILING
|
|
|
- profiler?.EndBlock();
|
|
|
|
|
|
|
+ if (profiler != null)
|
|
|
|
|
+ csi_Atomic_Profiler_EndBlock(profiler);
|
|
|
#endif
|
|
#endif
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ public static void BeginBlock(string name, uint color = 0xffffecb3,
|
|
|
|
|
+ ProfilerBlockStatus status = ProfilerBlockStatus.ON,
|
|
|
|
|
+ [CallerFilePath] string file = "",
|
|
|
|
|
+ [CallerLineNumber] int line = 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ var profiler = AtomicNET.Context.GetProfiler();
|
|
|
|
|
+ if (profiler != null)
|
|
|
|
|
+ csi_Atomic_Profiler_BeginBlock(profiler, name, file, line, color, (byte)status);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public static void EndBlock()
|
|
|
|
|
+ {
|
|
|
|
|
+ var profiler = AtomicNET.Context.GetProfiler();
|
|
|
|
|
+ if (profiler != null)
|
|
|
|
|
+ csi_Atomic_Profiler_EndBlock(profiler);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
[DllImport(Constants.LIBNAME, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
|
|
[DllImport(Constants.LIBNAME, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
|
|
|
private static extern void csi_Atomic_Profiler_BeginBlock(IntPtr self, string name, string file, int line, uint argb, byte status);
|
|
private static extern void csi_Atomic_Profiler_BeginBlock(IntPtr self, string name, string file, int line, uint argb, byte status);
|
|
|
|
|
+
|
|
|
|
|
+ [DllImport(Constants.LIBNAME, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
|
|
|
|
|
+ private static extern void csi_Atomic_Profiler_EndBlock(IntPtr self);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|