February 27th, 4:46am 3 comments

[OpenGL] FreeType and FTGL for Xcode

1) Download FreeType from: http://www.freetype.org and FTGL source from: http://sourceforge.net/projects/ftgl/

2) Extract the source and open a Terminal to navigate under the corresponding folder

3) For each do following steps in Terminal:
a) ./configure
b) make

4) find the libfreetype.a library file, for my case, it is under the folder of objs/.libs

5) copy the libfreetype.a and the include folder to a place, these are the files needed for apps;

6) Similarly for the FTGL, do ./configure, make and find the libftgl.a which is under src/.libs/

7) copy the libftgl.a and the folder FTGL under the src folder for future use.

For testing,

In Xcode, create a command-line app.

Copy the code from FTGL's demo folder's c-demo.c to the main.c of the newly created Xcode project.

drag libftgl.a, libfreetype.a and the header folders FTGL, freetype and the f2build.h to the project.

Screen_shot_2011-02-27_at_pm_0

To compile the program we also need the "config.h" file from the FTGL's folder and add the OpenGL and GLUT frameworks.

Finally the result is :
Untitled

Posted