ElementContextHook.cpp 693 B

12345678910111213141516171819202122232425262728293031
  1. #include "ElementContextHook.h"
  2. #include "DebuggerPlugin.h"
  3. namespace Rml {
  4. namespace Debugger {
  5. ElementContextHook::ElementContextHook(const String& tag) : ElementDebugDocument(tag)
  6. {
  7. debugger = nullptr;
  8. }
  9. ElementContextHook::~ElementContextHook() {}
  10. void ElementContextHook::Initialise(DebuggerPlugin* _debugger)
  11. {
  12. SetId("rmlui-debug-hook");
  13. SetProperty(PropertyId::ZIndex, Property(999'999, Unit::NUMBER));
  14. debugger = _debugger;
  15. }
  16. void ElementContextHook::OnRender()
  17. {
  18. // Make sure we're in the front of the render queue for this context (at least next frame).
  19. PullToFront();
  20. // Render the debugging elements.
  21. debugger->Render();
  22. }
  23. } // namespace Debugger
  24. } // namespace Rml