From 7043bf93567689f3b1304cc998c1fb09b7e0e357 Mon Sep 17 00:00:00 2001 From: Thales Lima Date: Wed, 25 Oct 2017 19:17:00 -0200 Subject: Fixed textures bug on linux --- Project/OpenGLText.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'Project/OpenGLText.cpp') diff --git a/Project/OpenGLText.cpp b/Project/OpenGLText.cpp index ebbc763..e71578a 100644 --- a/Project/OpenGLText.cpp +++ b/Project/OpenGLText.cpp @@ -16,6 +16,7 @@ */ #include "OpenGLText.h" +#include OpenGLText::OpenGLText() { Init(); } OpenGLText::OpenGLText(wxString text) @@ -27,7 +28,7 @@ OpenGLText::OpenGLText(wxString text) OpenGLText::~OpenGLText() { if(m_textureID) { - glDeleteTextures(1, m_textureID); + glDeleteTextures(1, &m_textureID[0]); } } @@ -108,7 +109,7 @@ void OpenGLText::TextToBitmap() void OpenGLText::LoadTextTexture() { - if(m_textureID) glDeleteTextures(1, m_textureID); + if(m_textureID) glDeleteTextures(1, &m_textureID[0]); m_textureID = new GLuint[1]; glGenTextures(1, &m_textureID[0]); @@ -156,3 +157,11 @@ OpenGLText* OpenGLText::GetCopy() copy->SetText(copy->m_text); return copy; } + +bool OpenGLText::IsTextureOK() +{ + if(m_textureID) { + if(glIsTexture(m_textureID[0]) == GL_TRUE) return true; + } + return false; +} -- cgit