Removed FT_DoneGlyph and fix state stuff
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 49 50 51 52 53 54
diff --git a/src/FTGLBitmapFont.cpp b/src/FTGLBitmapFont.cpp
index 1658da0..36edefc 100755
--- a/src/FTGLBitmapFont.cpp
+++ b/src/FTGLBitmapFont.cpp
@@ -20,7 +20,7 @@ FTGlyph* FTGLBitmapFont::MakeGlyph( unsigned int g)
if( ftGlyph)
{
FTBitmapGlyph* tempGlyph = new FTBitmapGlyph( *ftGlyph);
- FT_Done_Glyph( *ftGlyph );
+// FT_Done_Glyph( *ftGlyph );
return tempGlyph;
}
@@ -32,8 +32,9 @@ FTGlyph* FTGLBitmapFont::MakeGlyph( unsigned int g)
void FTGLBitmapFont::render( const char* string)
{
- glPushClientAttrib( GL_CLIENT_PIXEL_STORE_BIT | GL_ENABLE_BIT);
-
+ glPushClientAttrib( GL_CLIENT_PIXEL_STORE_BIT);
+ glPushAttrib( GL_ENABLE_BIT);
+
glPixelStorei( GL_UNPACK_LSB_FIRST, GL_FALSE);
glPixelStorei( GL_UNPACK_ROW_LENGTH, 0);
glPixelStorei( GL_UNPACK_ALIGNMENT, 1);
@@ -42,15 +43,16 @@ void FTGLBitmapFont::render( const char* string)
FTFont::render( string);
+ glPopAttrib();
glPopClientAttrib();
-
}
void FTGLBitmapFont::render( const wchar_t* string)
{
- glPushClientAttrib( GL_CLIENT_PIXEL_STORE_BIT | GL_ENABLE_BIT);
-
+ glPushClientAttrib( GL_CLIENT_PIXEL_STORE_BIT);
+ glPushAttrib( GL_ENABLE_BIT);
+
glPixelStorei( GL_UNPACK_LSB_FIRST, GL_FALSE);
glPixelStorei( GL_UNPACK_ROW_LENGTH, 0);
glPixelStorei( GL_UNPACK_ALIGNMENT, 1);
@@ -59,7 +61,7 @@ void FTGLBitmapFont::render( const wchar_t* string)
FTFont::render( string);
+ glPopAttrib();
glPopClientAttrib();
-
}