diff options
author | Thales Lima Oliveira <thaleslima.ufu@gmail.com> | 2020-07-07 23:12:04 -0300 |
---|---|---|
committer | Thales Lima Oliveira <thaleslima.ufu@gmail.com> | 2020-07-07 23:12:04 -0300 |
commit | ab30228b1a57053323363674fa7f137c0329a180 (patch) | |
tree | 50849a3680d61a2428665cc1035f1f4215870acb /Project/OpenGLText.cpp | |
parent | 6c0e98a2727d07e1fbb38b78c27d68e98ad09465 (diff) | |
download | PSP.git-ab30228b1a57053323363674fa7f137c0329a180.tar.gz PSP.git-ab30228b1a57053323363674fa7f137c0329a180.tar.xz PSP.git-ab30228b1a57053323363674fa7f137c0329a180.zip |
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 =)
Diffstat (limited to 'Project/OpenGLText.cpp')
-rw-r--r-- | Project/OpenGLText.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
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 <wx/graphics.h> #include "OpenGLText.h" #include <algorithm> +#include <wingdi.h> +#include <cmath> 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); |