mirror of
https://git.allpurposem.at/mat/WiggleWobble.git
synced 2025-12-23 13:01:28 +01:00
chore: clean up GPU objects on unload
This commit is contained in:
parent
d132a016b0
commit
4885426233
@ -53,6 +53,7 @@ class CRenderWobblyWindowPassElement final: public IPassElement {
|
||||
m_pWindow {pWindow} {}
|
||||
|
||||
static void initGPUObjects();
|
||||
static void deinitGPUObjects();
|
||||
|
||||
void draw(const CRegion& damage) override;
|
||||
|
||||
|
||||
@ -190,7 +190,7 @@ APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle) {
|
||||
}
|
||||
|
||||
APICALL EXPORT void PLUGIN_EXIT() {
|
||||
// TODO: CRenderWobblyWindowPassElement::deinitGPUObjects();
|
||||
CRenderWobblyWindowPassElement::deinitGPUObjects();
|
||||
g_pRenderWindowHook = nullptr;
|
||||
g_openWindow = nullptr;
|
||||
}
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
#include "globals.h"
|
||||
#include "wobblywindow.h"
|
||||
|
||||
#include <GLES3/gl32.h>
|
||||
#include <hyprland/src/render/Framebuffer.hpp>
|
||||
#include <hyprland/src/render/OpenGL.hpp>
|
||||
|
||||
@ -101,6 +102,13 @@ void CRenderWobblyWindowPassElement::initGPUObjects() {
|
||||
GLCALL(glBindBuffer(GL_ARRAY_BUFFER, 0));
|
||||
}
|
||||
|
||||
void CRenderWobblyWindowPassElement::deinitGPUObjects() {
|
||||
GLCALL(glDeleteVertexArrays(1, &s_VAO));
|
||||
GLCALL(glDeleteBuffers(1, &s_VBO));
|
||||
GLCALL(glDeleteBuffers(1, &s_VBO_UVs));
|
||||
GLCALL(glDeleteBuffers(1, &s_EBO));
|
||||
}
|
||||
|
||||
void CRenderWobblyWindowPassElement::draw(const CRegion& damage) {
|
||||
auto* const pWindowFB = g_pHyprOpenGL->m_renderData.currentFB;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user