From 75af34da96b80a3d228a25e8c75ba1137df9e058 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Thu, 14 Apr 2022 16:43:29 +0200 Subject: added basic damage tracking --- src/render/OpenGL.hpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/render/OpenGL.hpp') diff --git a/src/render/OpenGL.hpp b/src/render/OpenGL.hpp index c2dded11..97a27997 100644 --- a/src/render/OpenGL.hpp +++ b/src/render/OpenGL.hpp @@ -27,6 +27,8 @@ inline const float fullVerts[] = { struct SCurrentRenderData { SMonitor* pMonitor = nullptr; float projection[9]; + + pixman_region32_t* pDamage = nullptr; }; struct SMonitorRenderData { @@ -41,13 +43,13 @@ public: CHyprOpenGLImpl(); - void begin(SMonitor*); + void begin(SMonitor*, pixman_region32_t*); void end(); void renderRect(wlr_box*, const CColor&); - void renderTexture(wlr_texture*, float matrix[9], float a, int round = 0); - void renderTexture(const CTexture&, float matrix[9], float a, int round = 0); - void renderTextureWithBlur(const CTexture&, float matrix[9], float a, int round = 0); + void renderTexture(wlr_texture*, wlr_box*, float a, int round = 0); + void renderTexture(const CTexture&, wlr_box*, float a, int round = 0); + void renderTextureWithBlur(const CTexture&, wlr_box*, float a, int round = 0); void renderBorder(wlr_box*, const CColor&, int thick = 1, int round = 0); void makeWindowSnapshot(CWindow*); @@ -56,6 +58,7 @@ public: void clear(const CColor&); void clearWithTex(); void scissor(const wlr_box*); + void scissor(const pixman_box32*); SCurrentRenderData m_RenderData; @@ -85,6 +88,9 @@ private: GLuint createProgram(const std::string&, const std::string&); GLuint compileShader(const GLuint&, std::string); void createBGTextureForMonitor(SMonitor*); + + void renderTextureInternal(const CTexture&, wlr_box* pBox, float a, int round = 0); + }; inline std::unique_ptr g_pHyprOpenGL; \ No newline at end of file -- cgit v1.2.3