| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
| <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> |
| <title>FTGL: FTGLBitmapFont.cpp Source File</title> |
| <link href="doxygen.css" rel="stylesheet" type="text/css"> |
| </head><body> |
| <!-- Generated by Doxygen 1.3.6 --> |
| <div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a></div> |
| <h1>FTGLBitmapFont.cpp</h1><a href="FTGLBitmapFont_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="preprocessor">#include "<a class="code" href="FTGLBitmapFont_8h.html">FTGLBitmapFont.h</a>"</span> |
| 00002 <span class="preprocessor">#include "<a class="code" href="FTBitmapGlyph_8h.html">FTBitmapGlyph.h</a>"</span> |
| 00003 |
| 00004 |
| <a name="l00005"></a><a class="code" href="classFTGLBitmapFont.html#a0">00005</a> <a class="code" href="classFTGLBitmapFont.html#a0">FTGLBitmapFont::FTGLBitmapFont</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>* fontFilePath) |
| 00006 : <a class="code" href="classFTFont.html">FTFont</a>( fontFilePath) |
| 00007 {} |
| 00008 |
| 00009 |
| <a name="l00010"></a><a class="code" href="classFTGLBitmapFont.html#a1">00010</a> <a class="code" href="classFTGLBitmapFont.html#a0">FTGLBitmapFont::FTGLBitmapFont</a>( <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *pBufferBytes, size_t bufferSizeInBytes) |
| 00011 : <a class="code" href="classFTFont.html">FTFont</a>( pBufferBytes, bufferSizeInBytes) |
| 00012 {} |
| 00013 |
| 00014 |
| <a name="l00015"></a><a class="code" href="classFTGLBitmapFont.html#a2">00015</a> <a class="code" href="classFTGLBitmapFont.html#a2">FTGLBitmapFont::~FTGLBitmapFont</a>() |
| 00016 {} |
| 00017 |
| 00018 |
| 00019 <a class="code" href="classFTGlyph.html">FTGlyph</a>* <a class="code" href="classFTFont.html#b0">FTGLBitmapFont::MakeGlyph</a>( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> g) |
| 00020 { |
| 00021 FT_GlyphSlot ftGlyph = face.<a class="code" href="classFTFace.html#a10">Glyph</a>( g, FT_LOAD_DEFAULT); |
| 00022 |
| 00023 <span class="keywordflow">if</span>( ftGlyph) |
| 00024 { |
| 00025 <a class="code" href="classFTBitmapGlyph.html">FTBitmapGlyph</a>* tempGlyph = <span class="keyword">new</span> <a class="code" href="classFTBitmapGlyph.html">FTBitmapGlyph</a>( ftGlyph); |
| 00026 <span class="keywordflow">return</span> tempGlyph; |
| 00027 } |
| 00028 |
| 00029 <a class="code" href="classFTFont.html#p3">err</a> = <a class="code" href="classFTFont.html#p0">face</a>.<a class="code" href="classFTFace.html#a12">Error</a>(); |
| 00030 <span class="keywordflow">return</span> NULL; |
| 00031 } |
| 00032 |
| 00033 |
| <a name="l00034"></a><a class="code" href="classFTGLBitmapFont.html#a3">00034</a> <span class="keywordtype">void</span> <a class="code" href="classFTGLBitmapFont.html#a3">FTGLBitmapFont::Render</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>* string) |
| 00035 { |
| 00036 glPushClientAttrib( GL_CLIENT_PIXEL_STORE_BIT); |
| 00037 glPushAttrib( GL_ENABLE_BIT); |
| 00038 |
| 00039 glPixelStorei( GL_UNPACK_LSB_FIRST, GL_FALSE); |
| 00040 glPixelStorei( GL_UNPACK_ALIGNMENT, 1); |
| 00041 |
| 00042 glDisable( GL_BLEND); |
| 00043 |
| 00044 <a class="code" href="classFTFont.html#a19">FTFont::Render</a>( string); |
| 00045 |
| 00046 glPopAttrib(); |
| 00047 glPopClientAttrib(); |
| 00048 } |
| 00049 |
| 00050 |
| <a name="l00051"></a><a class="code" href="classFTGLBitmapFont.html#a4">00051</a> <span class="keywordtype">void</span> <a class="code" href="classFTGLBitmapFont.html#a3">FTGLBitmapFont::Render</a>( <span class="keyword">const</span> <span class="keywordtype">wchar_t</span>* string) |
| 00052 { |
| 00053 glPushClientAttrib( GL_CLIENT_PIXEL_STORE_BIT); |
| 00054 glPushAttrib( GL_ENABLE_BIT); |
| 00055 |
| 00056 glPixelStorei( GL_UNPACK_LSB_FIRST, GL_FALSE); |
| 00057 glPixelStorei( GL_UNPACK_ALIGNMENT, 1); |
| 00058 |
| 00059 glDisable( GL_BLEND); |
| 00060 |
| 00061 <a class="code" href="classFTFont.html#a19">FTFont::Render</a>( string); |
| 00062 |
| 00063 glPopAttrib(); |
| 00064 glPopClientAttrib(); |
| 00065 } |
| 00066 |
| </pre></div><hr size="1"><address style="align: right;"><small>Generated on Sun Dec 5 22:24:06 2004 for FTGL by |
| <a href="http://www.doxygen.org/index.html"> |
| <img src="doxygen.png" alt="doxygen" align="middle" border=0 > |
| </a>1.3.6 </small></address> |
| </body> |
| </html> |