动态链接库已预先安装,因此您可以立即使用任何需要 freetype2 的软件:
/usr/X11/lib/libfreetype.6.dylib
然而,构建 freetype2 项目所需的实际标头和此类内容并不随 OS X 一起提供。要获得这些,您需要安装 Xcode;当您使用任何版本的 OS X 平台 SDK 安装 Xcode 时,它都会附带 freetype2:
/Developer/SDKs/MacOSX10.6.sdk/usr/X11/include/freetype2/freetype/freetype.h
如今,我认为您必须通过 App Store 才能下载 Xcode,但它是免费的,这就是您开始在 OS X 上开发 GL / freetype2 软件所需的全部内容。我相信他们已经停止在OS X 10.6 版本安装 DVD,因此注册为 Apple 开发人员或通过 App Store 可能是您唯一的选择。
By the way, you are going to have to jump through some hoops when you start using OpenGL on OS X for the first time. It is a little different from most platforms, particularly when it comes to loading (or rather not loading) extensions at run-time. Apple implements the full feature set for OpenGL 2.1 / 3.2 core for all OS X 10.7+ systems even if the underlying GPU does not support it all - it has software fallbacks for anything not supported by hardware.
因此,您不必担心根据已安装的 GPU 功能加载扩展,但您必须担心使用某个功能是否会将您带入软件路径。您还必须忍受比平均水平更长的等待时间才能实现新版本的 OpenGL,但我认为这是您为保证功能集支持而付出的代价。
我建议你在开始时使用 glfw 或 SDL2 之类的东西,特别是如果你不喜欢 Objective C (老实说,有人吗?)。如今,许多较新的 OpenGL 上下文管理需要使用 Objective C (cocoa) 来完成; Apple 并不是他们自己的 C API(carbon)的忠实粉丝。 glfw 和 SDL2 向您隐藏了所有这些东西,因此如果您不想的话,您永远不必编写一段丑陋的 Objective C 代码:)