DebugHud.pkg 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. $#include "DebugHud.h"
  2. static const unsigned DEBUGHUD_SHOW_NONE;
  3. static const unsigned DEBUGHUD_SHOW_STATS;
  4. static const unsigned DEBUGHUD_SHOW_MODE;
  5. static const unsigned DEBUGHUD_SHOW_PROFILER;
  6. static const unsigned DEBUGHUD_SHOW_ALL;
  7. /// Displays rendering stats and profiling information.
  8. class DebugHud : public Object
  9. {
  10. public:
  11. /// Update. Called by HandleUpdate().
  12. void Update();
  13. /// Set UI elements' style from an XML file.
  14. void SetDefaultStyle(XMLFile* style);
  15. /// Set elements to show.
  16. void SetMode(unsigned mode);
  17. /// Set maximum profiler block depth, default unlimited.
  18. void SetProfilerMaxDepth(unsigned depth);
  19. /// Set profiler accumulation interval in seconds.
  20. void SetProfilerInterval(float interval);
  21. /// Set whether to show 3D geometry primitive/batch count only. Default false.
  22. void SetUseRendererStats(bool enable);
  23. /// Toggle elements.
  24. void Toggle(unsigned mode);
  25. /// Toggle all elements.
  26. void ToggleAll();
  27. /// Return the UI style file.
  28. XMLFile* GetDefaultStyle() const;
  29. /// Return rendering stats text.
  30. Text* GetStatsText() const;
  31. /// Return rendering mode text.
  32. Text* GetModeText() const;
  33. /// Return profiler text.
  34. Text* GetProfilerText() const;
  35. /// Return currently shown elements.
  36. unsigned GetMode() const;
  37. /// Return maximum profiler block depth.
  38. unsigned GetProfilerMaxDepth() const;
  39. /// Return profiler accumulation interval in seconds
  40. float GetProfilerInterval() const;
  41. /// Return whether showing 3D geometry primitive/batch count only.
  42. bool GetUseRendererStats() const;
  43. /// Set application-specific stats.
  44. void SetAppStats(const String& label, const Variant& stats);
  45. /// Set application-specific stats.
  46. void SetAppStats(const String& label, const String& stats);
  47. /// Reset application-specific stats. Return true if it was erased successfully.
  48. bool ResetAppStats(const String& label);
  49. /// Clear all application-specific stats.
  50. void ClearAppStats();
  51. // Properties:
  52. tolua_property__get_set XMLFile* defaultStyle;
  53. tolua_property__get_set unsigned mode;
  54. tolua_property__get_set unsigned profilerMaxDepth;
  55. tolua_property__get_set float profilerInterval;
  56. tolua_property__get_set bool useRendererStats;
  57. tolua_readonly tolua_property__get_set Text* statsText;
  58. tolua_readonly tolua_property__get_set Text* modeText;
  59. tolua_readonly tolua_property__get_set Text* profilerText;
  60. };