forked from drakeshin/AtomicGameEngine
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request AtomicGameEngine#1531 from rokups/feature/easy_pro…
…filer easy_profiler integration
- Loading branch information
Showing
131 changed files
with
27,924 additions
and
691 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
using System; | ||
using System.Runtime.CompilerServices; | ||
using System.Runtime.InteropServices; | ||
|
||
namespace AtomicEngine | ||
{ | ||
public partial class Profiler : AObject | ||
{ | ||
public static void Block(string name, Action block, uint color = 0xffffecb3, | ||
ProfilerBlockStatus status = ProfilerBlockStatus.ON, | ||
[CallerFilePath] string file = "", | ||
[CallerLineNumber] int line = 0) | ||
{ | ||
#if ATOMIC_PROFILING | ||
var profiler = AtomicNET.Context.GetProfiler(); | ||
if (profiler != null) | ||
csi_Atomic_Profiler_BeginBlock(profiler, name, file, line, color, (byte)status); | ||
#endif | ||
block(); | ||
#if ATOMIC_PROFILING | ||
if (profiler != null) | ||
csi_Atomic_Profiler_EndBlock(profiler); | ||
#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)] | ||
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); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.