summaryrefslogtreecommitdiff
path: root/src/render/Texture.cpp
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2022-04-08 21:40:41 +0200
committervaxerski <43317083+vaxerski@users.noreply.github.com>2022-04-08 21:40:41 +0200
commit7347a72ba674b099a073c17a74877b6e93a8e1e3 (patch)
treeeb43369765d28d5605ab4b790a1bb5455028e3d9 /src/render/Texture.cpp
parent037bad4986f3f5077bac91cdcdf20bd94d4fa38e (diff)
Added HyprError for showing config errors
Diffstat (limited to 'src/render/Texture.cpp')
-rw-r--r--src/render/Texture.cpp13
1 files changed, 13 insertions, 0 deletions
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