From 084623519e95f0ab0cf4bc328b5fa736d679c5bd Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 31 Jul 2019 21:35:12 +0800 Subject: =?UTF-8?q?*=E4=BF=AE=E6=94=B9=E5=90=8D=E7=A7=B0=E7=A9=BA=E9=97=B4?= =?UTF-8?q?=E9=A3=8E=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/modules/asura-core/graphics/canvas.h | 77 ++++++++++++++--------------- 1 file changed, 38 insertions(+), 39 deletions(-) (limited to 'source/modules/asura-core/graphics/canvas.h') diff --git a/source/modules/asura-core/graphics/canvas.h b/source/modules/asura-core/graphics/canvas.h index 332e973..bbd098a 100644 --- a/source/modules/asura-core/graphics/canvas.h +++ b/source/modules/asura-core/graphics/canvas.h @@ -11,64 +11,63 @@ #include "render_target.h" #include "render_state.h" -namespace AsuraEngine -{ - namespace Graphics - { +namespace_begin(AsuraEngine) +namespace_begin(Graphics) + - /// - /// Canvas也可以称为render texture,自身也可以作为texture渲染。 - /// - class Canvas ASURA_FINAL - : public Scripting::Portable - { - public: +/// +/// Canvas也可以称为render texture,自身也可以作为texture渲染。 +/// +class Canvas ASURA_FINAL + : public Scripting::Portable +{ +public: - Canvas(); + Canvas(); - ~Canvas(); + ~Canvas(); - /// - /// 设置render texture的大小 - /// - void SetSize(uint w, uint h) ASURA_THROW(Exception); + /// + /// 设置render texture的大小 + /// + void SetSize(uint w, uint h) ASURA_THROW(Exception); - void Clear(const Color& col = Color::Black) override; + void Clear(const Color& col = Color::Black) override; /* - void Clear(const Math::Recti& quad, const Color& col = Color::Black) override; + 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); + void Render(const RenderTarget* rt, const Math::Vector2i& pos, const Math::Vector2i& scale, const Math::Vector2i& center, float rot); - void Render(const RenderTarget* rt, const Math::Rectf& quad, const Math::Vector2i& pos, const Math::Vector2i& scale, const Math::Vector2i& center, float rot); + void Render(const RenderTarget* rt, const Math::Rectf& quad, const Math::Vector2i& pos, const Math::Vector2i& scale, const Math::Vector2i& center, float rot); - void Draw(const Drawable* texture, const RenderState& state); + void Draw(const Drawable* texture, const RenderState& state); - void Draw(const Drawable* texture, const Math::Recti& quad, const RenderState& state); + void Draw(const Drawable* texture, const Math::Recti& quad, const RenderState& state); - private: +private: - GLuint m_FBO; + GLuint m_FBO; - GLuint m_TexID; + GLuint m_TexID; - uint m_Width, m_Height; + uint m_Width, m_Height; - luaxport: +luaxport: - LUAX_DECL_FACTORY(Canvas, RenderTarget); + LUAX_DECL_FACTORY(Canvas, RenderTarget); - LUAX_DECL_METHOD(_SetSize); - LUAX_DECL_METHOD(_Bind); - LUAX_DECL_METHOD(_Unbind); + LUAX_DECL_METHOD(_SetSize); + LUAX_DECL_METHOD(_Bind); + LUAX_DECL_METHOD(_Unbind); - }; +}; - /// - /// Canvas别名为RenderTexture - /// - typedef Canvas RenderTexture; +/// +/// Canvas别名为RenderTexture +/// +typedef Canvas RenderTexture; - } -} +} // Graphics +} // AsuraEngine #endif \ No newline at end of file -- cgit v1.1-26-g67d0