Commit 488765fba13cd2bb80d4ebb54db8e93bdb6436c3

sammy 2010-05-23T17:50:29

Set proper polygon mode in FTPixmapFont, to fix rendering on OS X. Fix courtesy of Duncan Murdoch, from SF patch #2023536.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
diff --git a/src/FTFont/FTPixmapFont.cpp b/src/FTFont/FTPixmapFont.cpp
index 0c11fd5..7f9c623 100644
--- a/src/FTFont/FTPixmapFont.cpp
+++ b/src/FTFont/FTPixmapFont.cpp
@@ -85,11 +85,15 @@ inline FTPoint FTPixmapFontImpl::RenderI(const T* string, const int len,
                                          int renderMode)
 {
     // Protect GL_TEXTURE_2D and glPixelTransferf()
-    glPushAttrib(GL_ENABLE_BIT | GL_PIXEL_MODE_BIT | GL_COLOR_BUFFER_BIT);
+    glPushAttrib(GL_ENABLE_BIT | GL_PIXEL_MODE_BIT | GL_COLOR_BUFFER_BIT
+                  | GL_POLYGON_BIT);
 
     // Protect glPixelStorei() calls (made by FTPixmapGlyphImpl::RenderImpl).
     glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT);
 
+    // Needed on OSX
+    glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
+
     glDisable(GL_TEXTURE_2D);
 
     GLfloat ftglColour[4];