Minor formatting and moved Push Attribs to the font
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
diff --git a/src/FTGLPixmapFont.cpp b/src/FTGLPixmapFont.cpp
index ac35f34..310075d 100755
--- a/src/FTGLPixmapFont.cpp
+++ b/src/FTGLPixmapFont.cpp
@@ -44,7 +44,8 @@ void FTGLPixmapFont::render( const char* string)
void FTGLPixmapFont::render( const wchar_t* string)
{
glPushAttrib( GL_ENABLE_BIT | GL_PIXEL_MODE_BIT);
-
+ glPushClientAttrib( GL_CLIENT_PIXEL_STORE_BIT);
+
glEnable(GL_BLEND);
glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
@@ -52,6 +53,7 @@ void FTGLPixmapFont::render( const wchar_t* string)
FTFont::render( string);
+ glPopClientAttrib();
glPopAttrib();
}
diff --git a/src/FTPixmapGlyph.cpp b/src/FTPixmapGlyph.cpp
index 2a880bb..dba7e6b 100755
--- a/src/FTPixmapGlyph.cpp
+++ b/src/FTPixmapGlyph.cpp
@@ -100,19 +100,15 @@ float FTPixmapGlyph::Render( const FT_Vector& pen)
{
if( data)
{
- glPushClientAttrib( GL_CLIENT_PIXEL_STORE_BIT);
-
// Move the glyph origin
- glBitmap( 0, 0, 0.0, 0.0, pen.x + pos.x, pen.y - pos.y, (const GLubyte *)0);
+ glBitmap( 0, 0, 0.0, 0.0, pen.x + pos.x, pen.y - pos.y, (const GLubyte*)0);
glPixelStorei( GL_UNPACK_ROW_LENGTH, destWidth);
glDrawPixels( destWidth, destHeight, GL_RGBA, GL_UNSIGNED_BYTE, (const GLvoid*)data);
// Restore the glyph origin
- glBitmap( 0, 0, 0.0, 0.0, -pen.x - pos.x, -pen.y + pos.y, (const GLubyte *)0);
-
- glPopClientAttrib();
+ glBitmap( 0, 0, 0.0, 0.0, -pen.x - pos.x, -pen.y + pos.y, (const GLubyte*)0);
}
return advance;