summaryrefslogtreecommitdiff
path: root/Source/Asura.Engine/Graphics/Canvas.h
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2019-03-12 00:39:26 +0800
committerchai <chaifix@163.com>2019-03-12 00:39:26 +0800
commit70b82d1981c0de3c7b77670ff8abcfeb26815142 (patch)
treef69c05bcd204cc3f9bf745be37a2ba5911e52436 /Source/Asura.Engine/Graphics/Canvas.h
parentc19a282e10f51ddd50d198b903f8fbd5a2238b62 (diff)
*misc
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
///