From c302f5ae5f9e30a28e487e8a764d9cc31546bbea Mon Sep 17 00:00:00 2001 From: chai Date: Fri, 29 Mar 2019 22:51:04 +0800 Subject: *rename --- source/modules/asura-core/graphics/render_target.h | 56 ++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 source/modules/asura-core/graphics/render_target.h (limited to 'source/modules/asura-core/graphics/render_target.h') diff --git a/source/modules/asura-core/graphics/render_target.h b/source/modules/asura-core/graphics/render_target.h new file mode 100644 index 0000000..b1a695a --- /dev/null +++ b/source/modules/asura-core/graphics/render_target.h @@ -0,0 +1,56 @@ +#ifndef __ASURA_ENGINE_RENDERTARGET_H__ +#define __ASURA_ENGINE_RENDERTARGET_H__ + +#include +#include +#include + +#include "texture.h" +#include "color.h" + +namespace AsuraEngine +{ + namespace Graphics + { + + class Drawable; + + /// + /// 可被作为渲染目标的类,派生类有 + /// Canvas(RenderTexture) + /// Window(RenderWindow) + /// + class RenderTarget + { + public: + + RenderTarget() {}; + + virtual ~RenderTarget() {}; + + /// + /// 用颜色col清空整个RT + /// + virtual void Clear(const Color& col = Color::Black) = 0; + + /// + /// 用颜色col清空部分RT + /// + virtual void Clear(const Math::Recti& quad, const Color& col = Color::Black) = 0; + + /// + /// 绘制texture到本RT上 + /// + virtual void Draw(const Drawable* texture, const RenderState& state) = 0; + + /// + /// 绘制一部分texture到本RT上 + /// + virtual void Draw(const Drawable* texture, const Math::Recti& quad, const RenderState& state) = 0; + + }; + + } +} + +#endif \ No newline at end of file -- cgit v1.1-26-g67d0