Main Page | Class Hierarchy | Data Structures | File List | Data Fields | Globals

FTLibrary.cpp

Go to the documentation of this file.
00001 #include    "FTLibrary.h"
00002 
00003 
00004 const FTLibrary&  FTLibrary::Instance()
00005 {
00006     static FTLibrary ftlib;
00007     return ftlib;
00008 }
00009 
00010 
00011 FTLibrary::~FTLibrary()
00012 {
00013     if( library != 0)
00014     {
00015         FT_Done_FreeType( *library);
00016 
00017         delete library;
00018         library= 0;
00019     }
00020 
00021 //  if( manager != 0)
00022 //  {
00023 //      FTC_Manager_Done( manager );
00024 //
00025 //      delete manager;
00026 //      manager= 0;
00027 //  }
00028 }
00029 
00030 
00031 FTLibrary::FTLibrary()
00032 :   library(0),
00033     err(0)
00034 {
00035     Initialise();
00036 }
00037 
00038 
00039 bool FTLibrary::Initialise()
00040 {
00041     if( library != 0)
00042         return true;
00043 
00044     library = new FT_Library;
00045     
00046     err = FT_Init_FreeType( library);
00047     if( err)
00048     {
00049         delete library;
00050         library = 0;
00051         return false;
00052     }
00053     
00054 //  FTC_Manager* manager;
00055 //  
00056 //  if( FTC_Manager_New( lib, 0, 0, 0, my_face_requester, 0, manager )
00057 //  {
00058 //      delete manager;
00059 //      manager= 0;
00060 //      return false;
00061 //  }
00062 
00063     return true;
00064 }

Generated on Sun Dec 5 22:24:06 2004 for FTGL by doxygen 1.3.6