FTGLBitmapFont.cpp
Go to the documentation of this file.00001 #include "FTGLBitmapFont.h"
00002 #include "FTBitmapGlyph.h"
00003
00004
00005 FTGLBitmapFont::FTGLBitmapFont( const char* fontname)
00006 : FTFont( fontname)
00007 {}
00008
00009
00010 FTGLBitmapFont::FTGLBitmapFont( const unsigned char *pBufferBytes, size_t bufferSizeInBytes)
00011 : FTFont( pBufferBytes, bufferSizeInBytes)
00012 {}
00013
00014
00015 FTGLBitmapFont::~FTGLBitmapFont()
00016 {}
00017
00018
00019 FTGlyph* FTGLBitmapFont::MakeGlyph( unsigned int g)
00020 {
00021 FT_GlyphSlot ftGlyph = face.Glyph( g, FT_LOAD_DEFAULT);
00022
00023 if( ftGlyph)
00024 {
00025 FTBitmapGlyph* tempGlyph = new FTBitmapGlyph( ftGlyph);
00026 return tempGlyph;
00027 }
00028
00029 err = face.Error();
00030 return NULL;
00031 }
00032
00033
00034 void FTGLBitmapFont::Render( const char* 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 FTFont::Render( string);
00045
00046 glPopAttrib();
00047 glPopClientAttrib();
00048 }
00049
00050
00051 void FTGLBitmapFont::Render( const wchar_t* 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 FTFont::Render( string);
00062
00063 glPopAttrib();
00064 glPopClientAttrib();
00065 }
00066
Generated on Fri Aug 13 13:40:45 2004 for FTGL by
1.3.7