Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'extern/bFTGL/src/FTLibrary.cpp')
-rwxr-xr-xextern/bFTGL/src/FTLibrary.cpp64
1 files changed, 64 insertions, 0 deletions
diff --git a/extern/bFTGL/src/FTLibrary.cpp b/extern/bFTGL/src/FTLibrary.cpp
new file mode 100755
index 00000000000..29ab5ae2693
--- /dev/null
+++ b/extern/bFTGL/src/FTLibrary.cpp
@@ -0,0 +1,64 @@
+#include "FTLibrary.h"
+
+
+FTLibrary& FTLibrary::Instance()
+{
+ static FTLibrary ftlib;
+ return ftlib;
+}
+
+
+FTLibrary::~FTLibrary()
+{
+ if( library != 0)
+ {
+ FT_Done_FreeType( *library);
+
+ delete library;
+ library= 0;
+ }
+
+// if( manager != 0)
+// {
+// FTC_Manager_Done( manager );
+//
+// delete manager;
+// manager= 0;
+// }
+}
+
+
+FTLibrary::FTLibrary()
+: library(0),
+ err(0)
+{
+ Initialise();
+}
+
+
+bool FTLibrary::Initialise()
+{
+ if( library != 0)
+ return true;
+
+ library = new FT_Library;
+
+ err = FT_Init_FreeType( library);
+ if( err)
+ {
+ delete library;
+ library = 0;
+ return false;
+ }
+
+// FTC_Manager* manager;
+//
+// if( FTC_Manager_New( lib, 0, 0, 0, my_face_requester, 0, manager )
+// {
+// delete manager;
+// manager= 0;
+// return false;
+// }
+
+ return true;
+}