From 250e30d73f09e9da2b5a81d0fbae63744ae12a73 Mon Sep 17 00:00:00 2001 From: chai Date: Tue, 2 Apr 2019 08:47:15 +0800 Subject: *misc --- .../libs/asura-lib-core/graphics/render_target.h | 56 ++++++++++++++++++++++ 1 file changed, 56 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..afa5c6a --- /dev/null +++ b/source/libs/asura-lib-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