Эх сурвалжийг харах

chore: add debug group for particles

Almamu 7 сар өмнө
parent
commit
65f7b8afc8

+ 14 - 0
src/WallpaperEngine/Render/Objects/CParticle.cpp

@@ -1994,6 +1994,16 @@ void CParticle::renderSprites () {
     while (glGetError () != GL_NO_ERROR)
 	;
 
+#if !NDEBUG
+
+    std::string str = "Rendering particles ";
+
+    str += this->getParticle ().name + " (" + std::to_string (this->getId ()) + ", " + this->getParticle ().particleFile
+	+ ")";
+
+    glPushDebugGroup (GL_DEBUG_SOURCE_APPLICATION, 0, -1, str.c_str ());
+#endif
+
     // Save current GL state before any modifications
     GLint prevProgram = 0;
     GLint prevVAO = 0;
@@ -2190,4 +2200,8 @@ void CParticle::renderSprites () {
     glBindTexture (GL_TEXTURE_2D, prevTexture);
     glBindBuffer (GL_ARRAY_BUFFER, prevArrayBuffer);
     glBindVertexArray (prevVAO);
+
+#if !NDEBUG
+    glPopDebugGroup ();
+#endif
 }