Skip to content

Commit

Permalink
[dotnet] add binding for Profiler.BeginBlock
Browse files Browse the repository at this point in the history
  • Loading branch information
elix22 committed Apr 1, 2021
1 parent c97ca34 commit b4246eb
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 0 deletions.
31 changes: 31 additions & 0 deletions DotNet/Bindings/Portable/KinematicCharacterController.cs
@@ -0,0 +1,31 @@
using System;
using System.Runtime.InteropServices;
using System.Collections.Generic;
using Urho.Urho2D;
using Urho.Gui;
using Urho.Resources;
using Urho.IO;
using Urho.Navigation;
using Urho.Network;

namespace Urho
{
/// <summary>
/// Construct.
/// </summary>
public unsafe partial class KinematicCharacterController : Component
{
[DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
internal static extern void KinematicCharacterController_GetTransform (IntPtr handle , out Urho.Vector3 position, out Urho.Quaternion rotation);

/// <summary>
/// Set character position and rotation in world space as an atomic operation.
/// </summary>
public void GetTransform(out Urho.Vector3 position, out Urho.Quaternion rotation)
{
Runtime.ValidateRefCounted (this);
KinematicCharacterController_GetTransform (handle, out position, out rotation);
}
}

}
32 changes: 32 additions & 0 deletions DotNet/Bindings/Portable/Profiler.cs
@@ -0,0 +1,32 @@
using System;
using System.Runtime.InteropServices;
using System.Collections.Generic;
using Urho.Urho2D;
using Urho.Gui;
using Urho.Resources;
using Urho.IO;
using Urho.Navigation;
using Urho.Network;

namespace Urho
{
/// <summary>
/// Hierarchical performance profiler subsystem.
/// </summary>
public unsafe partial class Profiler : UrhoObject
{

[DllImport(Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
internal static extern void Profiler_BeginBlock(IntPtr handle, string name);

/// <summary>
/// Begin timing a profiling block..
/// </summary>
public void BeginBlock(string name)
{
Runtime.ValidateRefCounted(this);
Profiler_BeginBlock(handle, name);
}
}

}
8 changes: 8 additions & 0 deletions Source/Urho3D/DotNet/glue.cpp
Expand Up @@ -1051,6 +1051,14 @@ DllExport Interop::Quaternion Matrix3x4_Rotation( Matrix3x4 & matrix3x4)
return *((Interop::Quaternion *) &(rotation));
}



DllExport void
Profiler_BeginBlock (Urho3D::Profiler *_target,const char* name)
{
_target->BeginBlock(name);
}

/*
#if UWP
Expand Down

0 comments on commit b4246eb

Please sign in to comment.