ProfilerOverlayInternal.cs 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Runtime.CompilerServices;
  7. using System.Text;
  8. namespace BansheeEngine
  9. {
  10. /// <summary>
  11. /// Wrapper around the native ProfilerOverlay class.
  12. /// <see cref="ProfilerOverlay"/>
  13. /// </summary>
  14. internal class ProfilerOverlayInternal : ScriptObject
  15. {
  16. internal ProfilerOverlayInternal(Camera camera)
  17. {
  18. IntPtr ptr = IntPtr.Zero;
  19. if (camera != null)
  20. ptr = camera.Native.GetCachedPtr();
  21. Internal_CreateInstance(this, ptr);
  22. }
  23. public void SetType(ProfilerOverlayType type)
  24. {
  25. Internal_SetType(mCachedPtr, type);
  26. }
  27. internal void Update()
  28. {
  29. Internal_Update(mCachedPtr);
  30. }
  31. internal void Destroy()
  32. {
  33. Internal_DestroyInstance(mCachedPtr);
  34. }
  35. [MethodImpl(MethodImplOptions.InternalCall)]
  36. private static extern void Internal_CreateInstance(ProfilerOverlayInternal instance, IntPtr camera);
  37. [MethodImpl(MethodImplOptions.InternalCall)]
  38. private static extern void Internal_SetType(IntPtr instance, ProfilerOverlayType type);
  39. [MethodImpl(MethodImplOptions.InternalCall)]
  40. private static extern void Internal_Update(IntPtr instance);
  41. [MethodImpl(MethodImplOptions.InternalCall)]
  42. private static extern void Internal_DestroyInstance(IntPtr instance);
  43. }
  44. }