DebugHud.cs 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464
  1. // WARNING - AUTOGENERATED - DO NOT EDIT
  2. //
  3. // Generated using `sharpie urho`
  4. //
  5. // DebugHud.cs
  6. //
  7. // Copyright 2015 Xamarin Inc. All rights reserved.
  8. using System;
  9. using System.Runtime.InteropServices;
  10. using System.Collections.Generic;
  11. using Urho.Urho2D;
  12. using Urho.Gui;
  13. using Urho.Resources;
  14. using Urho.IO;
  15. using Urho.Navigation;
  16. using Urho.Network;
  17. namespace Urho
  18. {
  19. /// <summary>
  20. /// Displays rendering stats and profiling information.
  21. /// </summary>
  22. public unsafe partial class DebugHud : UrhoObject
  23. {
  24. unsafe partial void OnDebugHudCreated ();
  25. [Preserve]
  26. public DebugHud (IntPtr handle) : base (handle)
  27. {
  28. OnDebugHudCreated ();
  29. }
  30. [Preserve]
  31. protected DebugHud (UrhoObjectFlag emptyFlag) : base (emptyFlag)
  32. {
  33. OnDebugHudCreated ();
  34. }
  35. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  36. internal static extern int DebugHud_GetType (IntPtr handle);
  37. private StringHash UrhoGetType ()
  38. {
  39. Runtime.ValidateRefCounted (this);
  40. return new StringHash (DebugHud_GetType (handle));
  41. }
  42. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  43. internal static extern IntPtr DebugHud_GetTypeName (IntPtr handle);
  44. private string GetTypeName ()
  45. {
  46. Runtime.ValidateRefCounted (this);
  47. return Marshal.PtrToStringAnsi (DebugHud_GetTypeName (handle));
  48. }
  49. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  50. internal static extern int DebugHud_GetTypeStatic ();
  51. private static StringHash GetTypeStatic ()
  52. {
  53. Runtime.Validate (typeof(DebugHud));
  54. return new StringHash (DebugHud_GetTypeStatic ());
  55. }
  56. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  57. internal static extern IntPtr DebugHud_GetTypeNameStatic ();
  58. private static string GetTypeNameStatic ()
  59. {
  60. Runtime.Validate (typeof(DebugHud));
  61. return Marshal.PtrToStringAnsi (DebugHud_GetTypeNameStatic ());
  62. }
  63. [Preserve]
  64. public DebugHud () : this (Application.CurrentContext)
  65. {
  66. }
  67. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  68. internal static extern IntPtr DebugHud_DebugHud (IntPtr context);
  69. [Preserve]
  70. public DebugHud (Context context) : base (UrhoObjectFlag.Empty)
  71. {
  72. Runtime.Validate (typeof(DebugHud));
  73. handle = DebugHud_DebugHud ((object)context == null ? IntPtr.Zero : context.Handle);
  74. Runtime.RegisterObject (this);
  75. OnDebugHudCreated ();
  76. }
  77. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  78. internal static extern void DebugHud_Update (IntPtr handle);
  79. /// <summary>
  80. /// Update. Called by HandlePostUpdate().
  81. /// </summary>
  82. public void Update ()
  83. {
  84. Runtime.ValidateRefCounted (this);
  85. DebugHud_Update (handle);
  86. }
  87. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  88. internal static extern void DebugHud_SetDefaultStyle (IntPtr handle, IntPtr style);
  89. /// <summary>
  90. /// Set UI elements' style from an XML file.
  91. /// </summary>
  92. private void SetDefaultStyle (Urho.Resources.XmlFile style)
  93. {
  94. Runtime.ValidateRefCounted (this);
  95. DebugHud_SetDefaultStyle (handle, (object)style == null ? IntPtr.Zero : style.Handle);
  96. }
  97. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  98. internal static extern void DebugHud_SetMode (IntPtr handle, uint mode);
  99. /// <summary>
  100. /// Set elements to show.
  101. /// </summary>
  102. private void SetMode (uint mode)
  103. {
  104. Runtime.ValidateRefCounted (this);
  105. DebugHud_SetMode (handle, mode);
  106. }
  107. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  108. internal static extern void DebugHud_SetProfilerMaxDepth (IntPtr handle, uint depth);
  109. /// <summary>
  110. /// Set maximum profiler block depth, default unlimited.
  111. /// </summary>
  112. private void SetProfilerMaxDepth (uint depth)
  113. {
  114. Runtime.ValidateRefCounted (this);
  115. DebugHud_SetProfilerMaxDepth (handle, depth);
  116. }
  117. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  118. internal static extern void DebugHud_SetProfilerInterval (IntPtr handle, float interval);
  119. /// <summary>
  120. /// Set profiler accumulation interval in seconds.
  121. /// </summary>
  122. private void SetProfilerInterval (float interval)
  123. {
  124. Runtime.ValidateRefCounted (this);
  125. DebugHud_SetProfilerInterval (handle, interval);
  126. }
  127. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  128. internal static extern void DebugHud_SetUseRendererStats (IntPtr handle, bool enable);
  129. /// <summary>
  130. /// Set whether to show 3D geometry primitive/batch count only. Default false.
  131. /// </summary>
  132. private void SetUseRendererStats (bool enable)
  133. {
  134. Runtime.ValidateRefCounted (this);
  135. DebugHud_SetUseRendererStats (handle, enable);
  136. }
  137. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  138. internal static extern void DebugHud_Toggle (IntPtr handle, uint mode);
  139. /// <summary>
  140. /// Toggle elements.
  141. /// </summary>
  142. public void Toggle (uint mode)
  143. {
  144. Runtime.ValidateRefCounted (this);
  145. DebugHud_Toggle (handle, mode);
  146. }
  147. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  148. internal static extern void DebugHud_ToggleAll (IntPtr handle);
  149. /// <summary>
  150. /// Toggle all elements.
  151. /// </summary>
  152. public void ToggleAll ()
  153. {
  154. Runtime.ValidateRefCounted (this);
  155. DebugHud_ToggleAll (handle);
  156. }
  157. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  158. internal static extern IntPtr DebugHud_GetDefaultStyle (IntPtr handle);
  159. /// <summary>
  160. /// Return the UI style file.
  161. /// </summary>
  162. private Urho.Resources.XmlFile GetDefaultStyle ()
  163. {
  164. Runtime.ValidateRefCounted (this);
  165. return Runtime.LookupObject<Urho.Resources.XmlFile> (DebugHud_GetDefaultStyle (handle));
  166. }
  167. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  168. internal static extern IntPtr DebugHud_GetStatsText (IntPtr handle);
  169. /// <summary>
  170. /// Return rendering stats text.
  171. /// </summary>
  172. private Text GetStatsText ()
  173. {
  174. Runtime.ValidateRefCounted (this);
  175. return Runtime.LookupObject<Text> (DebugHud_GetStatsText (handle));
  176. }
  177. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  178. internal static extern IntPtr DebugHud_GetModeText (IntPtr handle);
  179. /// <summary>
  180. /// Return rendering mode text.
  181. /// </summary>
  182. private Text GetModeText ()
  183. {
  184. Runtime.ValidateRefCounted (this);
  185. return Runtime.LookupObject<Text> (DebugHud_GetModeText (handle));
  186. }
  187. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  188. internal static extern IntPtr DebugHud_GetProfilerText (IntPtr handle);
  189. /// <summary>
  190. /// Return profiler text.
  191. /// </summary>
  192. private Text GetProfilerText ()
  193. {
  194. Runtime.ValidateRefCounted (this);
  195. return Runtime.LookupObject<Text> (DebugHud_GetProfilerText (handle));
  196. }
  197. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  198. internal static extern IntPtr DebugHud_GetMemoryText (IntPtr handle);
  199. /// <summary>
  200. /// Return memory text.
  201. /// </summary>
  202. private Text GetMemoryText ()
  203. {
  204. Runtime.ValidateRefCounted (this);
  205. return Runtime.LookupObject<Text> (DebugHud_GetMemoryText (handle));
  206. }
  207. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  208. internal static extern uint DebugHud_GetMode (IntPtr handle);
  209. /// <summary>
  210. /// Return currently shown elements.
  211. /// </summary>
  212. private uint GetMode ()
  213. {
  214. Runtime.ValidateRefCounted (this);
  215. return DebugHud_GetMode (handle);
  216. }
  217. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  218. internal static extern uint DebugHud_GetProfilerMaxDepth (IntPtr handle);
  219. /// <summary>
  220. /// Return maximum profiler block depth.
  221. /// </summary>
  222. private uint GetProfilerMaxDepth ()
  223. {
  224. Runtime.ValidateRefCounted (this);
  225. return DebugHud_GetProfilerMaxDepth (handle);
  226. }
  227. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  228. internal static extern float DebugHud_GetProfilerInterval (IntPtr handle);
  229. /// <summary>
  230. /// Return profiler accumulation interval in seconds
  231. /// </summary>
  232. private float GetProfilerInterval ()
  233. {
  234. Runtime.ValidateRefCounted (this);
  235. return DebugHud_GetProfilerInterval (handle);
  236. }
  237. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  238. internal static extern bool DebugHud_GetUseRendererStats (IntPtr handle);
  239. /// <summary>
  240. /// Return whether showing 3D geometry primitive/batch count only.
  241. /// </summary>
  242. private bool GetUseRendererStats ()
  243. {
  244. Runtime.ValidateRefCounted (this);
  245. return DebugHud_GetUseRendererStats (handle);
  246. }
  247. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  248. internal static extern void DebugHud_SetAppStats (IntPtr handle, string label, string stats);
  249. /// <summary>
  250. /// Set application-specific stats.
  251. /// </summary>
  252. public void SetAppStats (string label, string stats)
  253. {
  254. Runtime.ValidateRefCounted (this);
  255. DebugHud_SetAppStats (handle, label, stats);
  256. }
  257. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  258. internal static extern bool DebugHud_ResetAppStats (IntPtr handle, string label);
  259. /// <summary>
  260. /// Reset application-specific stats. Return true if it was erased successfully.
  261. /// </summary>
  262. public bool ResetAppStats (string label)
  263. {
  264. Runtime.ValidateRefCounted (this);
  265. return DebugHud_ResetAppStats (handle, label);
  266. }
  267. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  268. internal static extern void DebugHud_ClearAppStats (IntPtr handle);
  269. /// <summary>
  270. /// Clear all application-specific stats.
  271. /// </summary>
  272. public void ClearAppStats ()
  273. {
  274. Runtime.ValidateRefCounted (this);
  275. DebugHud_ClearAppStats (handle);
  276. }
  277. public override StringHash Type {
  278. get {
  279. return UrhoGetType ();
  280. }
  281. }
  282. public override string TypeName {
  283. get {
  284. return GetTypeName ();
  285. }
  286. }
  287. [Preserve]
  288. public static StringHash TypeStatic {
  289. get {
  290. return GetTypeStatic ();
  291. }
  292. }
  293. public static string TypeNameStatic {
  294. get {
  295. return GetTypeNameStatic ();
  296. }
  297. }
  298. /// <summary>
  299. /// Return the UI style file.
  300. /// Or
  301. /// Set UI elements' style from an XML file.
  302. /// </summary>
  303. public Urho.Resources.XmlFile DefaultStyle {
  304. get {
  305. return GetDefaultStyle ();
  306. }
  307. set {
  308. SetDefaultStyle (value);
  309. }
  310. }
  311. /// <summary>
  312. /// Return currently shown elements.
  313. /// Or
  314. /// Set elements to show.
  315. /// </summary>
  316. public uint Mode {
  317. get {
  318. return GetMode ();
  319. }
  320. set {
  321. SetMode (value);
  322. }
  323. }
  324. /// <summary>
  325. /// Return maximum profiler block depth.
  326. /// Or
  327. /// Set maximum profiler block depth, default unlimited.
  328. /// </summary>
  329. public uint ProfilerMaxDepth {
  330. get {
  331. return GetProfilerMaxDepth ();
  332. }
  333. set {
  334. SetProfilerMaxDepth (value);
  335. }
  336. }
  337. /// <summary>
  338. /// Return profiler accumulation interval in seconds
  339. /// Or
  340. /// Set profiler accumulation interval in seconds.
  341. /// </summary>
  342. public float ProfilerInterval {
  343. get {
  344. return GetProfilerInterval ();
  345. }
  346. set {
  347. SetProfilerInterval (value);
  348. }
  349. }
  350. /// <summary>
  351. /// Return whether showing 3D geometry primitive/batch count only.
  352. /// Or
  353. /// Set whether to show 3D geometry primitive/batch count only. Default false.
  354. /// </summary>
  355. public bool UseRendererStats {
  356. get {
  357. return GetUseRendererStats ();
  358. }
  359. set {
  360. SetUseRendererStats (value);
  361. }
  362. }
  363. /// <summary>
  364. /// Return rendering stats text.
  365. /// </summary>
  366. public Text StatsText {
  367. get {
  368. return GetStatsText ();
  369. }
  370. }
  371. /// <summary>
  372. /// Return rendering mode text.
  373. /// </summary>
  374. public Text ModeText {
  375. get {
  376. return GetModeText ();
  377. }
  378. }
  379. /// <summary>
  380. /// Return profiler text.
  381. /// </summary>
  382. public Text ProfilerText {
  383. get {
  384. return GetProfilerText ();
  385. }
  386. }
  387. /// <summary>
  388. /// Return memory text.
  389. /// </summary>
  390. public Text MemoryText {
  391. get {
  392. return GetMemoryText ();
  393. }
  394. }
  395. }
  396. }