From 64d9d7b3eb7cece81da8b2cb56eb0f50d87a5964 Mon Sep 17 00:00:00 2001 From: chai Date: Fri, 1 Mar 2019 08:50:34 +0800 Subject: *misc --- Source/Asura.Engine/Graphics/Texture.h | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'Source/Asura.Engine/Graphics/Texture.h') diff --git a/Source/Asura.Engine/Graphics/Texture.h b/Source/Asura.Engine/Graphics/Texture.h index e5b713c..c1411fc 100644 --- a/Source/Asura.Engine/Graphics/Texture.h +++ b/Source/Asura.Engine/Graphics/Texture.h @@ -1,9 +1,10 @@ #ifndef __ASURA_ENGINE_TEXTURE_H__ #define __ASURA_ENGINE_TEXTURE_H__ -#include "Math/Rect.h" +#include "Math/Rect.hpp" +#include "Math/Vector2.hpp" #include "Scripting/Luax.hpp" -#include "Object.h" +#include "RenderState.h" #include "GL.h" namespace AsuraEngine @@ -11,6 +12,8 @@ namespace AsuraEngine namespace Graphics { + class RenderTarget; + /// /// 2D纹理抽象类,在2d mesh和render target中被使用。Texture的渲染原点在左上角,游戏里面的上层会以笛卡尔坐标系为标准。 /// 在Editor里面界面和组件也是以左上角为原点,这样是为了方便。 @@ -28,12 +31,22 @@ namespace AsuraEngine /// /// 渲染整个texture到rt上,原点在左上角,向右,向下延伸 /// - virtual void Render(int x, int y, int sx, int sy, int ox, int oy, int r) = 0; + virtual void Render(const RenderTarget* rt, const RenderState& state) = 0; /// /// 渲染texture的一部分到rt上,原点在左上角,向右,向下延伸。 /// - virtual void Render(const Math::Rect& quad, int x, int y, int sx, int sy, int ox, int oy, int r) = 0; + virtual void Render(const RenderTarget* rt, const Math::Rectf& quad, const RenderState& state) = 0; + + /// + /// 设置过滤方式 + /// + void SetSmooth(bool smooth); + + /// + /// 设置重复方式 + /// + void SetRepeated(); protected: @@ -44,7 +57,7 @@ namespace AsuraEngine }; - using Renderable = Texture; + using Drawable = Texture; } } -- cgit v1.1-26-g67d0