From 7347a72ba674b099a073c17a74877b6e93a8e1e3 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Fri, 8 Apr 2022 21:40:41 +0200 Subject: Added HyprError for showing config errors --- src/render/Texture.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/render/Texture.cpp') diff --git a/src/render/Texture.cpp b/src/render/Texture.cpp index 6d47c4a8..01b80145 100644 --- a/src/render/Texture.cpp +++ b/src/render/Texture.cpp @@ -19,4 +19,17 @@ CTexture::CTexture(wlr_texture* tex) { } m_vSize = Vector2D(tex->width, tex->height); +} + +void CTexture::destroyTexture() { + if (m_iTexID) { + glDeleteTextures(1, &m_iTexID); + m_iTexID = 0; + } +} + +void CTexture::allocate() { + if (!m_iTexID) { + glGenTextures(1, &m_iTexID); + } } \ No newline at end of file -- cgit v1.2.3