summaryrefslogtreecommitdiff
path: root/Source/Asura.Engine/Graphics/Texture.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Asura.Engine/Graphics/Texture.h')
-rw-r--r--Source/Asura.Engine/Graphics/Texture.h33
1 files changed, 31 insertions, 2 deletions
diff --git a/Source/Asura.Engine/Graphics/Texture.h b/Source/Asura.Engine/Graphics/Texture.h
index 06461ce..e5b713c 100644
--- a/Source/Asura.Engine/Graphics/Texture.h
+++ b/Source/Asura.Engine/Graphics/Texture.h
@@ -1,8 +1,10 @@
#ifndef __ASURA_ENGINE_TEXTURE_H__
#define __ASURA_ENGINE_TEXTURE_H__
+#include "Math/Rect.h"
+#include "Scripting/Luax.hpp"
#include "Object.h"
-#include "Luax/luax.h"
+#include "GL.h"
namespace AsuraEngine
{
@@ -10,13 +12,40 @@ namespace AsuraEngine
{
///
- /// 2DÎÆÀí³éÏóÀ࣬ÔÚ2d meshºÍrender targetÖб»Ê¹ÓÃ
+ /// 2DÎÆÀí³éÏóÀ࣬ÔÚ2d meshºÍrender targetÖб»Ê¹Óá£TextureµÄäÖȾԭµãÔÚ×óÉϽǣ¬ÓÎÏ·ÀïÃæµÄÉϲã»áÒԵѿ¨¶û×ø±êϵΪ±ê×¼¡£
+ /// ÔÚEditorÀïÃæ½çÃæºÍ×é¼þÒ²ÊÇÒÔ×óÉϽÇΪԭµã£¬ÕâÑùÊÇΪÁË·½±ã¡£
///
class Texture : virtual public Object
{
+ public:
+
+ Texture();
+
+ virtual ~Texture();
+
+ GLuint GetGLTextureHandle() const;
+
+ ///
+ /// äÖȾÕû¸ötextureµ½rtÉÏ£¬Ô­µãÔÚ×óÉϽǣ¬ÏòÓÒ£¬ÏòÏÂÑÓÉì
+ ///
+ virtual void Render(int x, int y, int sx, int sy, int ox, int oy, int r) = 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;
+
+ protected:
+
+ ///
+ /// OpenGL texture handle¡£
+ ///
+ GLuint mTextureHandle;
};
+ using Renderable = Texture;
+
}
}