summaryrefslogtreecommitdiff
path: root/src/render
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
parent037bad4986f3f5077bac91cdcdf20bd94d4fa38e (diff)
Added HyprError for showing config errors
Diffstat (limited to 'src/render')
-rw-r--r--src/render/Renderer.cpp8
-rw-r--r--src/render/Texture.cpp13
-rw-r--r--src/render/Texture.hpp3
3 files changed, 24 insertions, 0 deletions
diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp
index fa62b5fd..197b29b1 100644
--- a/src/render/Renderer.cpp
+++ b/src/render/Renderer.cpp
@@ -79,6 +79,10 @@ void CHyprRenderer::renderWorkspaceWithFullscreenWindow(SMonitor* pMonitor, SWor
}
renderDragIcon(pMonitor, time);
+
+ // if correct monitor draw hyprerror
+ if (pMonitor == &g_pCompositor->m_lMonitors.front())
+ g_pHyprError->draw();
}
void CHyprRenderer::renderWindow(CWindow* pWindow, SMonitor* pMonitor, timespec* time, bool decorate) {
@@ -178,6 +182,10 @@ void CHyprRenderer::renderAllClientsForMonitor(const int& ID, timespec* time) {
}
renderDragIcon(PMONITOR, time);
+
+ // if correct monitor draw hyprerror
+ if (PMONITOR == &g_pCompositor->m_lMonitors.front())
+ g_pHyprError->draw();
}
void CHyprRenderer::outputMgrApplyTest(wlr_output_configuration_v1* config, bool test) {
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
diff --git a/src/render/Texture.hpp b/src/render/Texture.hpp
index dbdf715a..f1211aec 100644
--- a/src/render/Texture.hpp
+++ b/src/render/Texture.hpp
@@ -14,6 +14,9 @@ public:
CTexture();
CTexture(wlr_texture*);
+ void destroyTexture();
+ void allocate();
+
TEXTURETYPE m_iType = TEXTURE_RGBA;
GLenum m_iTarget = GL_TEXTURE_2D;
GLuint m_iTexID = 0;