From 1497dccd63a84b7ee2b229b1ad9c5c02718f2a78 Mon Sep 17 00:00:00 2001 From: chai Date: Tue, 19 Mar 2019 23:06:27 +0800 Subject: *rename --- .../libs/asura-lib-core/graphics/render_target.h | 54 ++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 source/libs/asura-lib-core/graphics/render_target.h (limited to 'source/libs/asura-lib-core/graphics/render_target.h') diff --git a/source/libs/asura-lib-core/graphics/render_target.h b/source/libs/asura-lib-core/graphics/render_target.h new file mode 100644 index 0000000..d6de164 --- /dev/null +++ b/source/libs/asura-lib-core/graphics/render_target.h @@ -0,0 +1,54 @@ +#ifndef __ASURA_ENGINE_RENDERTARGET_H__ +#define __ASURA_ENGINE_RENDERTARGET_H__ + +#include "Math/Rect.hpp" +#include "Texture.h" +#include "Scripting/Portable.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