From 24b8f3af51316f58be66a5a96280ec5a0383918a Mon Sep 17 00:00:00 2001 From: chatlanin Date: Mon, 27 Mar 2023 14:53:30 +0300 Subject: [PATCH] add texture clear --- src/try_engine/renderer/texture/texture.cpp | 5 +++++ src/try_engine/renderer/texture/texture.hpp | 1 + 2 files changed, 6 insertions(+) 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;