~ubuntu-branches/ubuntu/gutsy/blender/gutsy-security

« back to all changes in this revision

Viewing changes to extern/bFTGL/src/FTLibrary.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Florian Ernst
  • Date: 2005-11-06 12:40:03 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051106124003-3pgs7tcg5rox96xg
Tags: 2.37a-1.1
* Non-maintainer upload.
* Split out parts of 01_SConstruct_debian.dpatch again: root_build_dir
  really needs to get adjusted before the clean target runs - closes: #333958,
  see #288882 for reference

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include    "FTLibrary.h"
 
2
 
 
3
 
 
4
FTLibrary&  FTLibrary::Instance()
 
5
{
 
6
    static FTLibrary ftlib;
 
7
    return ftlib;
 
8
}
 
9
 
 
10
 
 
11
FTLibrary::~FTLibrary()
 
12
{
 
13
    if( library != 0)
 
14
    {
 
15
        FT_Done_FreeType( *library);
 
16
 
 
17
        delete library;
 
18
        library= 0;
 
19
    }
 
20
 
 
21
//  if( manager != 0)
 
22
//  {
 
23
//      FTC_Manager_Done( manager );
 
24
//
 
25
//      delete manager;
 
26
//      manager= 0;
 
27
//  }
 
28
}
 
29
 
 
30
 
 
31
FTLibrary::FTLibrary()
 
32
:   library(0),
 
33
    err(0)
 
34
{
 
35
    Initialise();
 
36
}
 
37
 
 
38
 
 
39
bool FTLibrary::Initialise()
 
40
{
 
41
    if( library != 0)
 
42
        return true;
 
43
 
 
44
    library = new FT_Library;
 
45
    
 
46
    err = FT_Init_FreeType( library);
 
47
    if( err)
 
48
    {
 
49
        delete library;
 
50
        library = 0;
 
51
        return false;
 
52
    }
 
53
    
 
54
//  FTC_Manager* manager;
 
55
//  
 
56
//  if( FTC_Manager_New( lib, 0, 0, 0, my_face_requester, 0, manager )
 
57
//  {
 
58
//      delete manager;
 
59
//      manager= 0;
 
60
//      return false;
 
61
//  }
 
62
 
 
63
    return true;
 
64
}