UIRenderer.h 811 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #pragma once
  2. #include <TurboBadger/tb_types.h>
  3. #include <TurboBadger/renderers/tb_renderer_batcher.h>
  4. #include "../Core/Context.h"
  5. #include "UIBatch.h"
  6. namespace tb
  7. {
  8. class TBBitmap;
  9. class TBRect;
  10. }
  11. namespace Atomic
  12. {
  13. class UI;
  14. class UIRenderer : public tb::TBRendererBatcher
  15. {
  16. friend class UI;
  17. public:
  18. UIRenderer(Context* context);
  19. virtual ~UIRenderer();
  20. void BeginPaint(int render_target_w, int render_target_h);
  21. void EndPaint();
  22. tb::TBBitmap *CreateBitmap(int width, int height, tb::uint32 *data);
  23. void RenderBatch(Batch *batch);
  24. void SetClipRect(const tb::TBRect &rect);
  25. Context* GetContext() { return context_; }
  26. private:
  27. WeakPtr<Context> context_;
  28. PODVector<UIBatch>* batches_;
  29. PODVector<float>* vertexData_;
  30. IntRect currentScissor_;
  31. };
  32. }