diff options
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 + /// äÖȾÕû¸ötextureµ½rtÉÏ£¬ÔµãÔÚ×óÉϽǣ¬ÏòÓÒ£¬ÏòÏÂÑÓÉì /// - 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; + }; /// |
