diff --git a/src/try_engine/renderer/texture/texture.cpp b/src/try_engine/renderer/texture/texture.cpp index 427b7ae..1738a56 100644 --- a/src/try_engine/renderer/texture/texture.cpp +++ b/src/try_engine/renderer/texture/texture.cpp @@ -19,6 +19,11 @@ namespace try_engine } } + void texture::clear() + { + glDeleteTextures(1, &texture_id); + } + void texture::draw(ImVec2 pos, ImVec2 size) { // ImGui::Image(reinterpret_cast(static_cast(texture)), ImVec2(pos.x + 100, pos.y + 100)); diff --git a/src/try_engine/renderer/texture/texture.hpp b/src/try_engine/renderer/texture/texture.hpp index b83fdb1..6850845 100644 --- a/src/try_engine/renderer/texture/texture.hpp +++ b/src/try_engine/renderer/texture/texture.hpp @@ -19,6 +19,7 @@ namespace try_engine void draw(ImVec2 pos, ImVec2 size); void make(); + void clear(); private: GLuint texture_id = 0;