From 54bb80251432ff49c967115f8401e7dafc5c57d6 Mon Sep 17 00:00:00 2001 From: Thales Lima Oliveira Date: Tue, 19 Dec 2017 22:00:05 -0200 Subject: Several implementations on math expression block --- Project/OpenGLText.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'Project/OpenGLText.cpp') diff --git a/Project/OpenGLText.cpp b/Project/OpenGLText.cpp index e71578a..5e1c40b 100644 --- a/Project/OpenGLText.cpp +++ b/Project/OpenGLText.cpp @@ -15,8 +15,8 @@ * along with this program. If not, see . */ -#include "OpenGLText.h" #include +#include "OpenGLText.h" OpenGLText::OpenGLText() { Init(); } OpenGLText::OpenGLText(wxString text) @@ -27,9 +27,7 @@ OpenGLText::OpenGLText(wxString text) OpenGLText::~OpenGLText() { - if(m_textureID) { - glDeleteTextures(1, &m_textureID[0]); - } + if(m_textureID) { glDeleteTextures(1, &m_textureID[0]); } } void OpenGLText::Init() @@ -39,12 +37,13 @@ void OpenGLText::Init() m_textCoord[1] = wxPoint2DDouble(1, 0); } -void OpenGLText::Draw(wxPoint2DDouble position) const +void OpenGLText::Draw(wxPoint2DDouble position, double angle) const { if(m_textureID) { glPushMatrix(); - + glTranslated(position.m_x - m_bitmapSize.GetWidth() / 2, position.m_y - m_bitmapSize.GetHeight() / 2, 0); + glRotated(angle, 0, 0, 1); glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, m_textureID[0]); @@ -87,7 +86,7 @@ int OpenGLText::RoundToPowerOfTwo(int value, int min) void OpenGLText::TextToBitmap() { - wxFont font = wxFont(m_fontSize, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL); + wxFont font = wxFont(m_fontSize, m_fontFamily, m_fontStyle, m_fontWeight); wxMemoryDC memDC; memDC.SetFont(font); -- cgit