From b5b43bac50ad58949e70bcd1a34b1e6c4765fd51 Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 10 Apr 2019 09:03:57 +0800 Subject: *misc --- source/modules/asura-core/graphics/image.h | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) (limited to 'source/modules/asura-core/graphics/image.h') diff --git a/source/modules/asura-core/graphics/image.h b/source/modules/asura-core/graphics/image.h index abb8a1a..a1fba9a 100644 --- a/source/modules/asura-core/graphics/image.h +++ b/source/modules/asura-core/graphics/image.h @@ -10,11 +10,11 @@ #include "../image/image_data.h" -#include "texture.h" #include "color.h" #include "color32.h" #include "render_state.h" #include "gpu_buffer.h" +#include "texture.h" namespace AsuraEngine { @@ -24,7 +24,9 @@ namespace AsuraEngine /// /// Image是图片从内存中载入后,读取进游戏后保存的结果。一个Image在内存、显存中只会保存一 /// 份,不会产生副本。需要特征化的区别image,如锚点位置,缩放和旋转角度,使用sprite。 - /// 是一个只读类。主要是考虑到editor和engine使用不同的封装。 + /// 是一个只读类。主要是考虑到editor和engine使用不同的封装。Image只提供渲染时需要的 + /// sampler2D,顶点数据严格来说和Image无关,不应该由Image类提供。在Framework中,真正的 + /// 渲染实体是sprite,sprite提供了顶点数据和仿射变换参数。 /// class Image ASURA_FINAL : public AEScripting::Portable @@ -44,11 +46,11 @@ namespace AsuraEngine uint GetWidth(); uint GetHeight(); -/* - void Render(const RenderTarget* rt, const RenderState& state) {}; - void Render(const RenderTarget* rt, const AEMath::Rectf& quad, const RenderState& state) {}; -*/ - void UpdateBuffer(); + + /// + /// 创建一个gpu buffer,填充顶点的position数据和UV数据. + /// + GPUBuffer* GenGPUBuffer(); private: @@ -57,7 +59,7 @@ namespace AsuraEngine LUAX_DECL_FACTORY(Image, Texture); LUAX_DECL_METHOD(_New); - LUAX_DECL_METHOD(_Update); + LUAX_DECL_METHOD(_Load); LUAX_DECL_METHOD(_GetWidth); LUAX_DECL_METHOD(_GetHeight); LUAX_DECL_METHOD(_GetSize); @@ -68,11 +70,6 @@ namespace AsuraEngine uint32 mWidth, mHeight; - /// - /// 缓冲,保存了position和UV数据 - /// - GPUBuffer* mVBO; - }; } -- cgit v1.1-26-g67d0