summaryrefslogtreecommitdiff
path: root/source/modules/asura-core/graphics/image.h
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2019-03-30 21:49:29 +0800
committerchai <chaifix@163.com>2019-03-30 21:49:29 +0800
commit8164adb15b76f537f8b6c78b9992786b61d61cc8 (patch)
tree6e42919e32258a3c495dcec54b0fda3e8e1977d8 /source/modules/asura-core/graphics/image.h
parentc270d033fa04873ee7a8925dbb00cae5edc4555c (diff)
*misc
Diffstat (limited to 'source/modules/asura-core/graphics/image.h')
-rw-r--r--source/modules/asura-core/graphics/image.h29
1 files changed, 14 insertions, 15 deletions
diff --git a/source/modules/asura-core/graphics/image.h b/source/modules/asura-core/graphics/image.h
index 29fd97c..377e002 100644
--- a/source/modules/asura-core/graphics/image.h
+++ b/source/modules/asura-core/graphics/image.h
@@ -27,9 +27,9 @@ namespace AsuraEngine
/// һֻࡣҪǿǵeditorengineʹòͬķװ
///
class Image ASURA_FINAL
- : public Drawable
+ : public Texture
, public Scripting::Portable<Image>
- , public AEIO::Reloadable
+ , public AEIO::Renewable
{
public:
@@ -40,19 +40,17 @@ namespace AsuraEngine
~Image();
///
- /// bufferimageϢmPixelsΪգݡ¹image
- /// ʹglTexImage2Dύimageݡ
+ /// ͼύGPUϢ¹imageʹglTexImage2D
+ /// ύimageݡ
///
- bool Load(ImageData* data);
+ bool Refresh(AEIO::DecodedData* decodeData) override;
+ bool Refresh(AEIO::DecodedData* decodeData, const AEMath::Recti& rect);
- uint GetWidth();
- uint GetHeight();
- Math::Vector2u GetSize();
- ///
- /// ijһλõ
- ///
- Color32 GetPixel(uint x, uint y);
+ uint GetWidth();
+ uint GetHeight();
+ Math::Vector2u GetSize();
+ Color32 GetPixel(uint x, uint y);
void Render(const RenderTarget* rt, const RenderState& state) override;
@@ -60,13 +58,14 @@ namespace AsuraEngine
private:
+ ///
+ /// һͼƬһݵá
+ ///
ImageData* mImageData;
Luax::LuaxMemberRef mImageDataRef;
- Math::Vector2u mSize;
-
LUAX_DECL_METHOD(_New);
- LUAX_DECL_METHOD(_Load);
+ LUAX_DECL_METHOD(_Refresh);
LUAX_DECL_METHOD(_GetWidth);
LUAX_DECL_METHOD(_GetHeight);
LUAX_DECL_METHOD(_GetSize);