Set the correct state for font type
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 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121
diff --git a/demo/FTGLDemo.c b/demo/FTGLDemo.c
index c429301..69f083b 100644
--- a/demo/FTGLDemo.c
+++ b/demo/FTGLDemo.c
@@ -21,8 +21,8 @@
#define FONT_INFO "/usr/share/fonts/truetype/arial.ttf"
#endif
#ifdef __APPLE_CC__
- #define FONT_FILE "/Volumes/Shiny/Development/Source/GRAPHICS/GLTT/ftgl src /ftgl_dist/demo/arial.ttf"
- #define FONT_INFO "/Volumes/Shiny/Development/Source/GRAPHICS/GLTT/ftgl src /ftgl_dist/demo/arial.ttf"
+ #define FONT_FILE "/Users/henry/Development/PROJECTS/FTGL/ftglcvs/FTGL/demo/arial.ttf"
+ #define FONT_INFO "/Users/henry/Development/PROJECTS/FTGL/ftglcvs/FTGL/demo/arial.ttf"
#endif
#define EDITING 1
@@ -99,18 +99,18 @@ void do_display (void)
switch( current_font)
{
case FTGL_BITMAP:
- glDisable( GL_BLEND);
+// glDisable( GL_BLEND);
break;
case FTGL_PIXMAP:
- glDisable( GL_TEXTURE_2D);
- glEnable(GL_BLEND);
- glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // GL_ONE
+// glDisable( GL_TEXTURE_2D);
+// glEnable(GL_BLEND);
+// glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // GL_ONE
break;
case FTGL_OUTLINE:
- glDisable( GL_TEXTURE_2D);
- glEnable( GL_LINE_SMOOTH);
- glEnable(GL_BLEND);
- glBlendFunc( GL_SRC_ALPHA, GL_ONE); // GL_ONE_MINUS_SRC_ALPHA
+// glDisable( GL_TEXTURE_2D);
+// glEnable( GL_LINE_SMOOTH);
+// glEnable(GL_BLEND);
+// glBlendFunc( GL_SRC_ALPHA, GL_ONE); // GL_ONE_MINUS_SRC_ALPHA
break;
case FTGL_POLYGON:
glDisable( GL_BLEND);
diff --git a/src/FTGLBitmapFont.cpp b/src/FTGLBitmapFont.cpp
index 1fc4b59..6e39292 100755
--- a/src/FTGLBitmapFont.cpp
+++ b/src/FTGLBitmapFont.cpp
@@ -30,12 +30,14 @@ FTGlyph* FTGLBitmapFont::MakeGlyph( unsigned int g)
void FTGLBitmapFont::render( const char* string)
{
- glPushClientAttrib( GL_CLIENT_PIXEL_STORE_BIT);
+ glPushClientAttrib( GL_CLIENT_PIXEL_STORE_BIT | GL_ENABLE_BIT);
glPixelStorei( GL_UNPACK_LSB_FIRST, GL_FALSE);
glPixelStorei( GL_UNPACK_ROW_LENGTH, 0);
glPixelStorei( GL_UNPACK_ALIGNMENT, 1);
+ glDisable( GL_BLEND);
+
FTFont::render( string);
glPopClientAttrib();
@@ -45,11 +47,13 @@ void FTGLBitmapFont::render( const char* string)
void FTGLBitmapFont::render( const wchar_t* string)
{
- glPushClientAttrib( GL_CLIENT_PIXEL_STORE_BIT);
+ glPushClientAttrib( GL_CLIENT_PIXEL_STORE_BIT | GL_ENABLE_BIT);
glPixelStorei( GL_UNPACK_LSB_FIRST, GL_FALSE);
glPixelStorei( GL_UNPACK_ROW_LENGTH, 0);
glPixelStorei( GL_UNPACK_ALIGNMENT, 1);
+
+ glDisable( GL_BLEND);
FTFont::render( string);
diff --git a/src/FTGLOutlineFont.cpp b/src/FTGLOutlineFont.cpp
index 0f594bd..f733df3 100755
--- a/src/FTGLOutlineFont.cpp
+++ b/src/FTGLOutlineFont.cpp
@@ -32,6 +32,8 @@ void FTGLOutlineFont::render( const char* string)
{
glPushAttrib( GL_ENABLE_BIT | GL_HINT_BIT | GL_LINE_BIT | GL_PIXEL_MODE_BIT);
+ glDisable( GL_TEXTURE_2D);
+
glEnable( GL_LINE_SMOOTH);
glHint( GL_LINE_SMOOTH_HINT, GL_DONT_CARE);
glEnable(GL_BLEND);
@@ -48,6 +50,8 @@ void FTGLOutlineFont::render( const wchar_t* string)
{
glPushAttrib( GL_ENABLE_BIT | GL_HINT_BIT | GL_LINE_BIT | GL_PIXEL_MODE_BIT);
+ glDisable( GL_TEXTURE_2D);
+
glEnable( GL_LINE_SMOOTH);
glHint( GL_LINE_SMOOTH_HINT, GL_DONT_CARE);
glEnable(GL_BLEND);
diff --git a/src/FTGLPixmapFont.cpp b/src/FTGLPixmapFont.cpp
index e1ced15..ebecc8a 100755
--- a/src/FTGLPixmapFont.cpp
+++ b/src/FTGLPixmapFont.cpp
@@ -35,6 +35,8 @@ void FTGLPixmapFont::render( const char* string)
glEnable(GL_BLEND);
glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ glDisable( GL_TEXTURE_2D);
+
FTFont::render( string);
glPopAttrib();
@@ -48,6 +50,8 @@ void FTGLPixmapFont::render( const wchar_t* string)
glEnable(GL_BLEND);
glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+
+ glDisable( GL_TEXTURE_2D);
FTFont::render( string);