summaryrefslogtreecommitdiff
path: root/source/modules/asura-core/graphics/texture.cpp
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2019-04-02 21:45:33 +0800
committerchai <chaifix@163.com>2019-04-02 21:45:33 +0800
commitaf7bdaa10ee71a319dc55c3c7556fa43a95c9dc9 (patch)
tree58611985001b78c5a76b78ae146fdb07dde31c1d /source/modules/asura-core/graphics/texture.cpp
parent250e30d73f09e9da2b5a81d0fbae63744ae12a73 (diff)
*misc
Diffstat (limited to 'source/modules/asura-core/graphics/texture.cpp')
-rw-r--r--source/modules/asura-core/graphics/texture.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/source/modules/asura-core/graphics/texture.cpp b/source/modules/asura-core/graphics/texture.cpp
index 4db6ad3..38a75d7 100644
--- a/source/modules/asura-core/graphics/texture.cpp
+++ b/source/modules/asura-core/graphics/texture.cpp
@@ -1,3 +1,5 @@
+#include <asura-utils/exceptions/exception.h>
+
#include "Texture.h"
namespace AsuraEngine
@@ -8,13 +10,17 @@ namespace AsuraEngine
Texture::Texture()
: mTex(0)
{
- // GL texture
- glGenTextures(1, &mTex);
+ // Fix: ҪʱԴ
+ //glGenTextures(1, &mTex);
+ //if(mTex == 0)
+ // throw Exception("Cannot create texture.");
}
Texture::~Texture()
{
- glDeleteTextures(1, &mTex);
+ // ͷԴ
+ if(mTex != 0)
+ glDeleteTextures(1, &mTex);
}
GLuint Texture::GetGLTextureHandle() const
@@ -37,6 +43,8 @@ namespace AsuraEngine
t.externalformat = GL_RGBA;
t.type = GL_FLOAT;
break;
+ default:
+ ASSERT(false); // cant reach here
}
return t;
}