Commit 021a316592ed7fb5d152ae81ae67679b66cf9c56

henry 2002-01-24T09:40:39

Set the correct state for font type

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);