WebTexture2D.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #pragma once
  2. #include <Atomic/Graphics/Texture2D.h>
  3. #include <Atomic/Graphics/Material.h>
  4. #include "WebRenderHandler.h"
  5. namespace Atomic
  6. {
  7. class WebTexture2DPrivate;
  8. /// A render handler which uses a Texture2D and can be used for UI, 2D, and 3D rendering
  9. class ATOMIC_API WebTexture2D : public WebRenderHandler
  10. {
  11. friend class WebTexture2DPrivate;
  12. OBJECT(WebTexture2D)
  13. public:
  14. /// Construct.
  15. WebTexture2D(Context* context);
  16. /// Destruct.
  17. virtual ~WebTexture2D();
  18. /// Get the current width of the texture
  19. int GetWidth() const;
  20. /// Get the current height of the texture
  21. int GetHeight() const;
  22. /// Get the Texture2D associated with the WebTexture2D
  23. Texture2D* GetTexture2D() const { return texture_; }
  24. /// get the clear color for the WebTexture
  25. const Color& GetClearColor() const { return clearColor_; }
  26. /// Set the dimensions of the texture
  27. void SetSize(int width, int height);
  28. /// Set the clear color for the WebTexture
  29. void SetClearColor(const Color& color) { clearColor_ = color; }
  30. /// Get the (internal) CEFRenderHandler
  31. CefRenderHandler* GetCEFRenderHandler();
  32. private:
  33. Color clearColor_;
  34. SharedPtr<Texture2D> texture_;
  35. WebTexture2DPrivate* d_;
  36. };
  37. }