Commit 64ff442e authored by Christian Schulte zu Berge's avatar Christian Schulte zu Berge
Browse files

GCC fixes: CMake file for fontrendering module and exception throwing in fontatlas.cpp.

parent 369d4951
......@@ -2,12 +2,14 @@
IF(${ModuleEnabled})
# dirty, dirty hack to force freetype to build stastic lib
SET(foo ${BUILD_SHARED_LIBS})
SET(BUILD_SHARED_LIBS 0)
SET(bsl ${BUILD_SHARED_LIBS})
IF(${CampvisSharedStaticModulesFix})
SET(BUILD_SHARED_LIBS 0)
ENDIF()
# build RadomWalksLib library
ADD_SUBDIRECTORY(modules/fontrendering/ext/freetype-2.5.4)
SET(BUILD_SHARED_LIBS ${foo})
SET(BUILD_SHARED_LIBS ${bsl})
SET(ThisModExternalLibs "freetype")
SET(ThisModIncludeDirs "${CampvisHome}/modules/fontrendering/ext/freetype-2.5.4/include")
......
......@@ -24,6 +24,7 @@
#include "fontatlas.h"
#include "cgt/exception.h"
#include "cgt/logmanager.h"
#include "cgt/textureunit.h"
......@@ -47,12 +48,12 @@ namespace campvis {
// Initialize the FreeType2 library
if (FT_Init_FreeType(&_ftLibrary)) {
LERROR("Could not init freetype library.");
throw std::exception("Could not init freetype library.");
throw cgt::Exception("Could not init freetype library.");
}
// Load a font
if (FT_New_Face(_ftLibrary, fontFileName.c_str(), 0, &_ftFace)) {
LERROR("Could not open font " << fontFileName);
throw std::exception("Could not open font file.");
throw cgt::Exception("Could not open font file.");
}
FT_Set_Pixel_Sizes(_ftFace, 0, height);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment