Added Error() stuff
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
diff --git a/include/FTLibrary.h b/include/FTLibrary.h
index d88dc01..5c4c0ff 100755
--- a/include/FTLibrary.h
+++ b/include/FTLibrary.h
@@ -16,6 +16,8 @@ class FTLibrary
static FTLibrary& Instance();
FT_Library* GetLibrary() const { return lib;}
+ virtual FT_Error Error() const { return err;}
+
virtual ~FTLibrary();
// attributes
@@ -31,6 +33,8 @@ class FTLibrary
FT_Library* lib;
// FTC_Manager* manager; /* the cache manager */
+ FT_Error err;
+
};
#endif // __FTLibrary__
diff --git a/src/FTLibrary.cpp b/src/FTLibrary.cpp
index ccdc25c..64e575a 100755
--- a/src/FTLibrary.cpp
+++ b/src/FTLibrary.cpp
@@ -36,14 +36,15 @@ FTLibrary::FTLibrary()
}
-bool FTLibrary::Init()
+bool FTLibrary::Init()
{
if( lib != 0 )
return true;
lib = new FT_Library;
-
- if( FT_Init_FreeType( lib)) // false = no error
+
+ err = FT_Init_FreeType( lib);
+ if( err)
{
delete lib;
lib= 0;