diff options
author | chai <chaifix@163.com> | 2019-03-01 08:50:34 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2019-03-01 08:50:34 +0800 |
commit | 64d9d7b3eb7cece81da8b2cb56eb0f50d87a5964 (patch) | |
tree | 12bde99e5415f77f60f8873a66d09bfd3b84ec48 /Source/Asura.Engine/Graphics/Canvas.h | |
parent | e28a7d48d032fe7fd4c8789e95fbc659873a0adc (diff) |
*misc
Diffstat (limited to 'Source/Asura.Engine/Graphics/Canvas.h')
-rw-r--r-- | Source/Asura.Engine/Graphics/Canvas.h | 30 |
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; + }; /// |