summaryrefslogtreecommitdiff
path: root/Source/Asura.Engine/Graphics/Image.cpp
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2019-03-12 00:39:26 +0800
committerchai <chaifix@163.com>2019-03-12 00:39:26 +0800
commit70b82d1981c0de3c7b77670ff8abcfeb26815142 (patch)
treef69c05bcd204cc3f9bf745be37a2ba5911e52436 /Source/Asura.Engine/Graphics/Image.cpp
parentc19a282e10f51ddd50d198b903f8fbd5a2238b62 (diff)
*misc
Diffstat (limited to 'Source/Asura.Engine/Graphics/Image.cpp')
-rw-r--r--Source/Asura.Engine/Graphics/Image.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/Source/Asura.Engine/Graphics/Image.cpp b/Source/Asura.Engine/Graphics/Image.cpp
index 8287d76..e704945 100644
--- a/Source/Asura.Engine/Graphics/Image.cpp
+++ b/Source/Asura.Engine/Graphics/Image.cpp
@@ -1,3 +1,4 @@
+#include "Config.h"
#include "Image.h"
#include "GL.h"
@@ -7,7 +8,6 @@ namespace AsuraEngine
{
Image::Image()
- : Texture()
{
}
@@ -16,18 +16,17 @@ namespace AsuraEngine
}
//\Ϣ
- bool Image::Load(const ImageData* data)
+ bool Image::Load(ImageData* data)
{
- if (!data)
- return false;
- if (mImageData)
- delete mImageData;
- mImageData = data;
+ ASSERT(data);
+
glBindTexture(GL_TEXTURE_2D, mTextureHandle);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, data->width, data->height, 0, GL_RGBA, GL_UNSIGNED_BYTE, data->pixels);
glBindTexture(GL_TEXTURE_2D, 0);
return true;
+
+ RRA(data, mImageData);
}
}
-}
+} \ No newline at end of file