add texture clear

This commit is contained in:
chatlanin 2023-03-27 14:53:30 +03:00
parent 85bfab7d51
commit 24b8f3af51
2 changed files with 6 additions and 0 deletions

View File

@ -19,6 +19,11 @@ namespace try_engine
} }
} }
void texture::clear()
{
glDeleteTextures(1, &texture_id);
}
void texture::draw(ImVec2 pos, ImVec2 size) void texture::draw(ImVec2 pos, ImVec2 size)
{ {
// ImGui::Image(reinterpret_cast<void*>(static_cast<intptr_t>(texture)), ImVec2(pos.x + 100, pos.y + 100)); // ImGui::Image(reinterpret_cast<void*>(static_cast<intptr_t>(texture)), ImVec2(pos.x + 100, pos.y + 100));

View File

@ -19,6 +19,7 @@ namespace try_engine
void draw(ImVec2 pos, ImVec2 size); void draw(ImVec2 pos, ImVec2 size);
void make(); void make();
void clear();
private: private:
GLuint texture_id = 0; GLuint texture_id = 0;