Commit 68a99036c05706e1eee4ea64b0f8d6130fa1e344

sammy 2008-05-21T11:39:31

* Enable GL_TEXTURE_2D in FTFont::Render variations that need it.

diff --git a/src/FTFont/FTBufferFont.cpp b/src/FTFont/FTBufferFont.cpp
index a5d2e6a..a78abc2 100644
--- a/src/FTFont/FTBufferFont.cpp
+++ b/src/FTFont/FTBufferFont.cpp
@@ -138,8 +138,10 @@ inline FTPoint FTBufferFontImpl::RenderI(const T* string, const int len,
 
     FTBBox bbox = BBox(string, len, position, spacing);
 
-    int width = static_cast<int>(bbox.Upper().X() - bbox.Lower().X() + 2.5);
-    int height = static_cast<int>(bbox.Upper().Y() - bbox.Lower().Y() + 2.5);
+    int width = static_cast<int>(bbox.Upper().X() - bbox.Lower().X()
+                                  + border + border + 0.5);
+    int height = static_cast<int>(bbox.Upper().Y() - bbox.Lower().Y()
+                                   + border + border + 0.5);
 
     int texWidth = NextPowerOf2(width);
     int texHeight = NextPowerOf2(height);
@@ -161,7 +163,9 @@ inline FTPoint FTBufferFontImpl::RenderI(const T* string, const int len,
     glPushAttrib(GL_COLOR_BUFFER_BIT | GL_ENABLE_BIT);
     glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT);
 
+    /* FIXME: can we push/pop these instead? */
     glEnable(GL_BLEND);
+    glEnable(GL_TEXTURE_2D);
     glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // GL_ONE
 
     glBindTexture(GL_TEXTURE_2D, id);
diff --git a/src/FTFont/FTTextureFont.cpp b/src/FTFont/FTTextureFont.cpp
index f977c0a..9773ddd 100644
--- a/src/FTFont/FTTextureFont.cpp
+++ b/src/FTFont/FTTextureFont.cpp
@@ -228,7 +228,9 @@ inline FTPoint FTTextureFontImpl::RenderI(const T* string, const int len,
                                           FTPoint position, FTPoint spacing,
                                           int renderMode)
 {
+    /* FIXME: can we push/pop these instead? */
     glEnable(GL_BLEND);
+    glEnable(GL_TEXTURE_2D);
     glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // GL_ONE
 
     FTTextureGlyphImpl::ResetActiveTexture();