diff --git a/teapots/textured-teapot/src/main/cpp/Texture.cpp b/teapots/textured-teapot/src/main/cpp/Texture.cpp index 63d179041..7bf469ff7 100644 --- a/teapots/textured-teapot/src/main/cpp/Texture.cpp +++ b/teapots/textured-teapot/src/main/cpp/Texture.cpp @@ -83,33 +83,6 @@ Texture* Texture::Create(std::vector& texFiles, return new TextureCubemap(texFiles, assetManager); } -void Texture::Delete(Texture* obj) { - if (obj == nullptr) { - ASSERT(false, "NULL pointer to Texture::Delete() function"); - return; - } - - GLuint type = obj->GetTexType(); - if (type == GL_TEXTURE_2D) { - Texture2d* d2Instance = dynamic_cast(obj); - if (d2Instance) { - delete d2Instance; - } else { - ASSERT(false, "Unknown obj type to %s", __FUNCTION__); - } - } else if (type == GL_TEXTURE_CUBE_MAP) { - TextureCubemap* cubemapInstance = dynamic_cast(obj); - if (cubemapInstance) { - delete cubemapInstance; - } else { - ASSERT(false, "Unknown obj type to %s", __FUNCTION__); - } - } else { - LOGE("Supported Texture Types: %s", supportedTextureTypes.c_str()); - ASSERT(false, "Unknow texture type %x to delete", type); - } -} - /** * TextureCubemap implementations */ diff --git a/teapots/textured-teapot/src/main/cpp/Texture.h b/teapots/textured-teapot/src/main/cpp/Texture.h index 298a9d715..8add46fb8 100644 --- a/teapots/textured-teapot/src/main/cpp/Texture.h +++ b/teapots/textured-teapot/src/main/cpp/Texture.h @@ -36,11 +36,10 @@ * - texture unit 0, sampler unit 0 */ class Texture { - protected: + public: Texture(); virtual ~Texture(); - public: /** * Create a texture object * @param texFiles holds image file names under APK/assets. @@ -51,7 +50,6 @@ class Texture { */ static Texture* Create(std::vector& texFiles, AAssetManager* assetManager); - static void Delete(Texture* obj); virtual bool GetActiveSamplerInfo(std::vector& names, std::vector& units) = 0; diff --git a/teapots/textured-teapot/src/main/cpp/TexturedTeapotRender.cpp b/teapots/textured-teapot/src/main/cpp/TexturedTeapotRender.cpp index 8f8ef1420..c065db845 100644 --- a/teapots/textured-teapot/src/main/cpp/TexturedTeapotRender.cpp +++ b/teapots/textured-teapot/src/main/cpp/TexturedTeapotRender.cpp @@ -97,7 +97,7 @@ void TexturedTeapotRender::Unload() { texVbo_ = GL_INVALID_VALUE; } if (texObj_) { - Texture::Delete(texObj_); + delete texObj_; texObj_ = nullptr; } }