summaryrefslogtreecommitdiffstats
path: root/Project/OpenGLText.cpp
diff options
context:
space:
mode:
authorThales Lima Oliveira <thaleslima.ufu@gmail.com>2017-12-31 18:00:25 -0200
committerGitHub <noreply@github.com>2017-12-31 18:00:25 -0200
commit0c0280cfcf540f943fd2dbfdf7ac0304ea96a465 (patch)
tree51c89fc8155dcc447743dc89a1ab5ce36acc72cf /Project/OpenGLText.cpp
parentc8193665975686fb8a344bee3dc94914a3d3558a (diff)
parentdbe0b112622f8e91fa3e44a6b6e1aa7e230d3ded (diff)
downloadPSP.git-0c0280cfcf540f943fd2dbfdf7ac0304ea96a465.tar.gz
PSP.git-0c0280cfcf540f943fd2dbfdf7ac0304ea96a465.tar.xz
PSP.git-0c0280cfcf540f943fd2dbfdf7ac0304ea96a465.zip
Merge pull request #43 from Thales1330/wip/math-expr-control-block
Wip math expr control block
Diffstat (limited to 'Project/OpenGLText.cpp')
-rw-r--r--Project/OpenGLText.cpp13
1 files changed, 6 insertions, 7 deletions
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 <https://www.gnu.org/licenses/>.
*/
-#include "OpenGLText.h"
#include <wx/log.h>
+#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);