Commit 06dd59491ec8dfbc06a546a2789f9d020965425e

sammy 2008-04-25T10:01:29

* Implement Render() for all Font types. Patch by Eric Beets.

diff --git a/include/FTFont.h b/include/FTFont.h
index c6ae8cf..120d6bb 100644
--- a/include/FTFont.h
+++ b/include/FTFont.h
@@ -455,6 +455,7 @@ FTGL_EXPORT float ftglLineHeight (FTGLfont*);
 FTGL_EXPORT void  ftglBBox       (FTGLfont*, const char *, float[]);
 FTGL_EXPORT float ftglAdvance    (FTGLfont*, const char *);
 FTGL_EXPORT void  ftglRender     (FTGLfont*, const char *);
+FTGL_EXPORT void  ftglRenderMode (FTGLfont*, const char *, int);
 
 FTGL_EXPORT FT_Error ftglError (FTGLfont*);
 
diff --git a/include/FTGLBitmapFont.h b/include/FTGLBitmapFont.h
index 6b83105..ee9557e 100644
--- a/include/FTGLBitmapFont.h
+++ b/include/FTGLBitmapFont.h
@@ -80,14 +80,30 @@ class FTGL_EXPORT FTGLBitmapFont : public FTFont
         void Render(const char* string);
 
         /**
+         * Render a string of characters
+         *
+         * @param string    'C' style string to be output.
+         * @param renderMode    Render mode to display
+         */
+        void Render(const char* string, int renderMode) { Render(string); }
+
+        /**
          * Renders a string of characters
-         * 
+         *
          * @param string    'C' style wide string to be output.
          */
         void Render(const wchar_t* string);
 
+        /**
+         * Render a string of characters
+         *
+         * @param string    wchar_t string to be output.
+         * @param renderMode    Render mode to display
+         */
+        void Render(const wchar_t *string, int renderMode) { Render(string); }
+
         // attributes
-        
+
     private:
         /**
          * Construct a FTBitmapGlyph.
@@ -96,7 +112,7 @@ class FTGL_EXPORT FTGLBitmapFont : public FTFont
          * @return  An FTBitmapGlyph or <code>null</code> on failure.
          */
         inline virtual FTGlyph* MakeGlyph( unsigned int g);
-                
+
         /* Internal generic Render() implementation */
         template <typename T>
         inline void RenderI(const T* string);
diff --git a/include/FTGLOutlineFont.h b/include/FTGLOutlineFont.h
index aefe992..17cc068 100644
--- a/include/FTGLOutlineFont.h
+++ b/include/FTGLOutlineFont.h
@@ -88,12 +88,28 @@ class FTGL_EXPORT FTGLOutlineFont : public FTFont
         void Render(const char* string);
 
         /**
+         * Render a string of characters
+         *
+         * @param string    'C' style string to be output.
+         * @param renderMode    Render mode to display
+         */
+        void Render(const char* string, int renderMode) { Render(string); }
+
+        /**
          * Renders a string of characters
          *
          * @param string    wchar_t string to be output.
          */
         void Render(const wchar_t* string);
 
+        /**
+         * Render a string of characters
+         *
+         * @param string    wchar_t string to be output.
+         * @param renderMode    Render mode to display
+         */
+        void Render(const wchar_t *string, int renderMode) { Render(string); }
+
     private:
         /**
          * Construct a FTOutlineGlyph.
diff --git a/include/FTGLPixmapFont.h b/include/FTGLPixmapFont.h
index 5394dc9..94e8e43 100644
--- a/include/FTGLPixmapFont.h
+++ b/include/FTGLPixmapFont.h
@@ -67,26 +67,42 @@ class FTGL_EXPORT FTGLPixmapFont : public FTFont
          * @param bufferSizeInBytes  the length of the buffer in bytes
          */
         FTGLPixmapFont( const unsigned char *pBufferBytes, size_t bufferSizeInBytes);
-        
+
         /**
          * Destructor
          */
         ~FTGLPixmapFont();
-        
+
         /**
          * Renders a string of characters
          * 
          * @param string    'C' style string to be output.   
          */
         void Render( const char* string);
-        
+
+        /**
+         * Render a string of characters
+         *
+         * @param string    'C' style string to be output.
+         * @param renderMode    Render mode to display
+         */
+        void Render(const char* string, int renderMode) { Render(string); }
+
         /**
          * Renders a string of characters
-         * 
-         * @param string    wchar_t string to be output.     
+         *
+         * @param string    wchar_t string to be output.
          */
         void Render(const wchar_t* string);
 
+        /**
+         * Render a string of characters
+         *
+         * @param string    wchar_t string to be output.
+         * @param renderMode    Render mode to display
+         */
+        void Render(const wchar_t *string, int renderMode) { Render(string); }
+
     private:
         /**
          * Construct a FTPixmapGlyph.
@@ -95,7 +111,7 @@ class FTGL_EXPORT FTGLPixmapFont : public FTFont
          * @return  An FTPixmapGlyph or <code>null</code> on failure.
          */
         inline virtual FTGlyph* MakeGlyph(unsigned int g);
-        
+
         /* Internal generic Render() implementation */
         template <typename T>
         inline void RenderI(const T* string);
diff --git a/include/FTGLTextureFont.h b/include/FTGLTextureFont.h
index 9f95992..6ae67dc 100644
--- a/include/FTGLTextureFont.h
+++ b/include/FTGLTextureFont.h
@@ -84,19 +84,34 @@ class  FTGL_EXPORT FTGLTextureFont : public FTFont
 
         /**
          * Renders a string of characters
-         * 
-         * @param string    'C' style string to be output.   
+         *
+         * @param string    'C' style string to be output.
          */
         virtual void Render(const char* string);
-        
+
+        /**
+         * Render a string of characters
+         *
+         * @param string    'C' style string to be output.
+         * @param renderMode    Render mode to display
+         */
+        void Render(const char* string, int renderMode) { Render(string); }
+
         /**
          * Renders a string of characters
-         * 
-         * @param string    wchar_t string to be output.     
+         *
+         * @param string    wchar_t string to be output.
          */
         virtual void Render(const wchar_t* string);
 
-        
+        /**
+         * Render a string of characters
+         *
+         * @param string    wchar_t string to be output.
+         * @param renderMode    Render mode to display
+         */
+        void Render(const wchar_t *string, int renderMode) { Render(string); }
+
     private:
         /**
          * Construct a FTTextureGlyph.
@@ -105,7 +120,7 @@ class  FTGL_EXPORT FTGLTextureFont : public FTFont
          * @return  An FTTextureGlyph or <code>null</code> on failure.
          */
         inline virtual FTGlyph* MakeGlyph( unsigned int glyphIndex);
-                
+
         /**
          * Get the size of a block of memory required to layout the glyphs
          *
diff --git a/src/FTGlue.cpp b/src/FTGlue.cpp
index d8d1a1b..7a861a6 100644
--- a/src/FTGlue.cpp
+++ b/src/FTGlue.cpp
@@ -163,6 +163,10 @@ C_FUN(float, ftglAdvance, (FTGLfont *f, const char* s),
 // virtual void FTFont::Render(const char* string);
 C_FUN(void, ftglRender, (FTGLfont *f, const char * s), return, Render, (s));
 
+// virtual void Render(const char* string, int renderMode);
+C_FUN(void, ftglRenderMode, (FTGLfont *f, const char *s, int r),
+      return, Render, (s, r));
+
 // FT_Error FTFont::Error() const;
 C_FUN(FT_Error, ftglError, (FTGLfont *f), return -1, Error, ());