Added a render function to set LINE_SMOOTH for anti aliased lines
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
diff --git a/include/FTGLOutlineFont.h b/include/FTGLOutlineFont.h
index ecb7274..9c77bfc 100755
--- a/include/FTGLOutlineFont.h
+++ b/include/FTGLOutlineFont.h
@@ -15,6 +15,8 @@ class FTGLOutlineFont : public FTFont
FTGLOutlineFont();
~FTGLOutlineFont();
+ void render( const char* string);
+
// attributes
private:
diff --git a/src/FTGLOutlineFont.cpp b/src/FTGLOutlineFont.cpp
index 3a4f327..7a73bf8 100755
--- a/src/FTGLOutlineFont.cpp
+++ b/src/FTGLOutlineFont.cpp
@@ -1,3 +1,5 @@
+#include "GL/gl.h"
+
#include "FTGLOutlineFont.h"
#include "FTGlyphContainer.h"
#include "FTGL.h"
@@ -39,3 +41,19 @@ bool FTGLOutlineFont::MakeGlyphList()
glyphList->Add( tempGlyph);
}
}
+
+
+void FTGLOutlineFont::render( const char* string)
+{
+ glPushAttrib( GL_ENABLE_BIT | GL_HINT_BIT | GL_LINE_BIT | GL_PIXEL_MODE_BIT);
+
+ glEnable( GL_LINE_SMOOTH);
+ glHint( GL_LINE_SMOOTH_HINT, GL_DONT_CARE);
+ glEnable(GL_BLEND);
+ glBlendFunc( GL_SRC_ALPHA, GL_ONE); // GL_ONE_MINUS_SRC_ALPHA
+
+ FTFont::render( string);
+
+ glPopAttrib();
+
+}