WebTexture2D.h 1018 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. /// Set the dimensions of the texture
  25. void SetSize(int width, int height);
  26. /// Get the (internal) CEFRenderHandler
  27. CefRenderHandler* GetCEFRenderHandler();
  28. private:
  29. SharedPtr<Texture2D> texture_;
  30. WebTexture2DPrivate* d_;
  31. };
  32. }