summaryrefslogtreecommitdiff
path: root/Source/Asura.Engine/Graphics/Canvas.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Asura.Engine/Graphics/Canvas.h')
-rw-r--r--Source/Asura.Engine/Graphics/Canvas.h45
1 files changed, 26 insertions, 19 deletions
diff --git a/Source/Asura.Engine/Graphics/Canvas.h b/Source/Asura.Engine/Graphics/Canvas.h
index c258793..c4e0f65 100644
--- a/Source/Asura.Engine/Graphics/Canvas.h
+++ b/Source/Asura.Engine/Graphics/Canvas.h
@@ -8,15 +8,18 @@
#include "Texture.h"
#include "RenderTarget.h"
-namespace AsuraEngine
+namespace AsuraEngine
{
- namespace Graphics
+ namespace Graphics
{
-
+
///
/// CanvasҲԳΪrender textureҲΪtextureȾ
///
- class Canvas final : public Drawable, public RenderTarget, public Scripting::Portable
+ class Canvas ASURA_FINAL
+ : public Drawable
+ , public RenderTarget
+ , public Scripting::Portable
{
public:
@@ -29,25 +32,17 @@ namespace AsuraEngine
///
void SetSize(uint w, uint h);
- ///
- /// ȾtexturertϣԭϽǣң
- ///
- void Render(const RenderTarget* rt, const Math::Vector2i& pos, const Math::Vector2i& scale, const Math::Vector2i& center, float rot);
+ void Clear(const Color& col = Color::Black) override;
- ///
- /// ȾtextureһֵrtϣԭϽǣң졣
- ///
- void Render(const RenderTarget* rt, const Math::Rectf& quad, const Math::Vector2i& pos, const Math::Vector2i& scale, const Math::Vector2i& center, float rot);
+ void Clear(const Math::Recti& quad, const Color& col = Color::Black) override;
- //----------------------------------------------------------------------------------------------------------
+ void Render(const RenderTarget* rt, const Math::Vector2i& pos, const Math::Vector2i& scale, const Math::Vector2i& center, float rot);
- LUAX_DECL_FACTORY(SimCanvas);
+ void Render(const RenderTarget* rt, const Math::Rectf& quad, const Math::Vector2i& pos, const Math::Vector2i& scale, const Math::Vector2i& center, float rot);
- LUAX_DECL_METHOD(l_SetSize);
- LUAX_DECL_METHOD(l_Bind);
- LUAX_DECL_METHOD(l_Unbind);
+ void Draw(const Drawable* texture, const RenderState& state);
- //----------------------------------------------------------------------------------------------------------
+ void Draw(const Drawable* texture, const Math::Recti& quad, const RenderState& state);
private:
@@ -61,8 +56,20 @@ namespace AsuraEngine
///
uint mWidth, mHeight;
+ public:
+
+ //----------------------------------------------------------------------------------------------------------
+
+ LUAX_DECL_FACTORY(SimCanvas);
+
+ LUAX_DECL_METHOD(l_SetSize);
+ LUAX_DECL_METHOD(l_Bind);
+ LUAX_DECL_METHOD(l_Unbind);
+
+ //----------------------------------------------------------------------------------------------------------
+
};
-
+
///
/// CanvasΪRenderTexture
///