Logo Search packages:      
Sourcecode: blender version File versions

FTGLBitmapFont.cpp

#include "FTGLBitmapFont.h"
#include "FTBitmapGlyph.h"


00005 FTGLBitmapFont::FTGLBitmapFont( const char* fontname)
:   FTFont( fontname)
{}


00010 FTGLBitmapFont::FTGLBitmapFont( const unsigned char *pBufferBytes, size_t bufferSizeInBytes)
:   FTFont( pBufferBytes, bufferSizeInBytes)
{}


00015 FTGLBitmapFont::~FTGLBitmapFont()
{}


00019 FTGlyph* FTGLBitmapFont::MakeGlyph( unsigned int g)
{
    FT_GlyphSlot ftGlyph = face.Glyph( g, FT_LOAD_DEFAULT);

    if( ftGlyph)
    {
        FTBitmapGlyph* tempGlyph = new FTBitmapGlyph( ftGlyph);
        return tempGlyph;
    }

    err = face.Error();
    return NULL;
}


00034 void FTGLBitmapFont::Render( const char* string)
{   
    glPushClientAttrib( GL_CLIENT_PIXEL_STORE_BIT);
    glPushAttrib( GL_ENABLE_BIT);
    
    glPixelStorei( GL_UNPACK_LSB_FIRST, GL_FALSE);
    glPixelStorei( GL_UNPACK_ALIGNMENT, 1);

    glDisable( GL_BLEND);

    FTFont::Render( string);

    glPopAttrib();
    glPopClientAttrib();
}


00051 void FTGLBitmapFont::Render( const wchar_t* string)
{   
    glPushClientAttrib( GL_CLIENT_PIXEL_STORE_BIT);
    glPushAttrib( GL_ENABLE_BIT);
    
    glPixelStorei( GL_UNPACK_LSB_FIRST, GL_FALSE);
    glPixelStorei( GL_UNPACK_ALIGNMENT, 1);
    
    glDisable( GL_BLEND);

    FTFont::Render( string);

    glPopAttrib();
    glPopClientAttrib();
}


Generated by  Doxygen 1.6.0   Back to index