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.h30
1 files changed, 17 insertions, 13 deletions
diff --git a/Source/Asura.Engine/Graphics/Canvas.h b/Source/Asura.Engine/Graphics/Canvas.h
index c8faacf..c258793 100644
--- a/Source/Asura.Engine/Graphics/Canvas.h
+++ b/Source/Asura.Engine/Graphics/Canvas.h
@@ -3,8 +3,8 @@
#include <Scripting/Luax.hpp>
+#include "Math/Rect.hpp"
#include "GL.h"
-#include "SimClass.h"
#include "Texture.h"
#include "RenderTarget.h"
@@ -16,35 +16,34 @@ namespace AsuraEngine
///
/// CanvasҲԳΪrender textureҲΪtextureȾ
///
- class Canvas final : public Texture, public RenderTarget, public SimClass
+ class Canvas final : public Drawable, public RenderTarget, public Scripting::Portable
{
public:
Canvas();
- ///
- /// render textureĴС
- ///
- void Init(uint w, uint h);
+ ~Canvas();
///
- /// 󶨴canvasΪ
+ /// render textureĴС
///
- void Bind();
+ void SetSize(uint w, uint h);
///
- /// Ϊǻ󶨻screen
+ /// ȾtexturertϣԭϽǣң
///
- void Unbind();
+ void Render(const RenderTarget* rt, const Math::Vector2i& pos, const Math::Vector2i& scale, const Math::Vector2i& center, float rot);
- void Render(int x, int y, int sx, int sy, int ox, int oy, int r) override;
-
- void Render(const Math::Rect& quad, int x, int y, int sx, int sy, int ox, int oy, int r) 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);
//----------------------------------------------------------------------------------------------------------
LUAX_DECL_FACTORY(SimCanvas);
+ LUAX_DECL_METHOD(l_SetSize);
LUAX_DECL_METHOD(l_Bind);
LUAX_DECL_METHOD(l_Unbind);
@@ -57,6 +56,11 @@ namespace AsuraEngine
///
GLuint mFBO;
+ ///
+ /// canvasĴС
+ ///
+ uint mWidth, mHeight;
+
};
///