Freetype是否预装在Mac上? [英] Does freetype comes pre-installed on Mac?

查看:410
本文介绍了Freetype是否预装在Mac上?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对Mac OS X环境比较陌生. 我试图安装freetype库以在OpenGL中显示文本,但失败了. 我在某个论坛上看到,freetype预先安装了Mac OS X山狮. 我只是想确认一下. 如果Mac确实随附了它,那么我如何将其包含在我的项目中? 如果Mac不附带它,那么在Mac上安装freetype的第一步的理想选择是什么?

I am relatively new to Mac OS X environment. I was trying to install freetype library to display text in OpenGL, but I failed. I read on some forum that freetype comes pre-installed with Mac OS X mountain lion. I just wanted to confirm this. If it does in fact comes with Mac then how can I include it in my project? If it doesn't comes with Mac then what is the ideal set of step one would follow to install freetype in Mac?

推荐答案

动态链接库已预先安装,因此您可以使用任何需要freetype2的软件:

The dynamic linking library comes pre-installed, so you can use any software that requires freetype2 out of the box:

/usr/X11/lib/libfreetype.6.dylib

但是,构建freetype2项目所需的实际标头以及此类标头并未随OS X一起提供.要获取这些标头,您需要安装Xcode;当您使用任何版本的OS X平台SDK安装Xcode时,它都带有freetype2:

However, the actual headers and such required to build a freetype2 project do not ship with OS X. To get these, you need to install Xcode; when you install Xcode with any version of the OS X platform SDK, it comes with freetype2:

/Developer/SDKs/MacOSX10.6.sdk/usr/X11/include/freetype2/freetype/freetype.h

这些天来,我认为您必须浏览App Store才能下载Xcode,但这是免费的,这就是开始在OS X上开发GL/freetype2软件所需要的全部.我相信他们已经停止包括OS X上的Xcode会在10.6版中安装DVD,因此注册为Apple Developer或通过App Store可能是您唯一的选择.


顺便说一句,当您第一次在OS X上使用OpenGL时,您将不得不跳过一些麻烦.它与大多数平台略有不同,尤其是在运行时加载(或不加载)扩展时.即使底层GPU不支持所有功能,Apple仍为所有OS X 10.7+系统实现OpenGL 2.1/3.2核心的全部功能集-它具有软件后备功能,可用于硬件不支持的任何功能.

These days, I think you have to go through the App Store in order to download Xcode, but it is free and that is about all you need to get started developing GL / freetype2 software on OS X. I believe they stopped including Xcode on the OS X install DVDs with the release of 10.6, so registering as an Apple Developer or going through the App Store is probably your only option.


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,您还必须忍受比平均时间更长的等待时间,但这是您为保证的功能集支持所付出的代价.

So you don't have to worry about loading extensions based on the installed GPU capabilities, but you do have to worry about whether using a feature will throw you onto a software path. You also have to put up with longer than average wait time for new versions of OpenGL to be implemented, but this is the price you pay for guaranteed feature set support I suppose.

我建议您在开始时使用glfw或SDL2之类的东西,尤其是如果您不喜欢Objective C(有人吗?).如今,许多新的OpenGL上下文管理都需要使用Objective C(可可)来完成;苹果并不是自己的C API(碳)的忠实拥护者. glfw和SDL2对您隐藏了所有这些内容,因此,如果您不想要,则无需编写任何丑陋的Objective C代码:)

I would suggest you use something like glfw or SDL2 when starting out, especially if you don't like Objective C (does anyone, honestly?). A lot of newer OpenGL context management these days needs to be done using Objective C (cocoa); Apple is not a big fan of their own C APIs (carbon). glfw and SDL2 hide all this stuff from you so you never have to write a single piece of ugly Objective C code if you do not want :)

这篇关于Freetype是否预装在Mac上?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆