From ab30228b1a57053323363674fa7f137c0329a180 Mon Sep 17 00:00:00 2001 From: Thales Lima Oliveira Date: Tue, 7 Jul 2020 23:12:04 -0300 Subject: Voltage heat map implemented Voltage heat map implemented using modern OpenGL =) New external library required: -GLEW -GLFW -GLM (incorporeted at the source) Old memory leaks fixed =) --- Project/OpenGLText.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Project/OpenGLText.cpp') diff --git a/Project/OpenGLText.cpp b/Project/OpenGLText.cpp index 3b8c276..54cad88 100644 --- a/Project/OpenGLText.cpp +++ b/Project/OpenGLText.cpp @@ -19,6 +19,8 @@ #include #include "OpenGLText.h" #include +#include +#include OpenGLText::OpenGLText() { Init(); } OpenGLText::OpenGLText(wxString text) @@ -30,6 +32,8 @@ OpenGLText::OpenGLText(wxString text) OpenGLText::~OpenGLText() { if(m_textureID) { glDeleteTextures(1, &m_textureID[0]); } + delete m_textureID; + delete[] m_textCoord; } void OpenGLText::Init() @@ -169,7 +173,7 @@ void OpenGLText::LoadTextTexture() } glTexImage2D(GL_TEXTURE_2D, 0, bytesPerPixel, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, imageData); - delete imageData; + delete[] imageData; glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); -- cgit