在 iPhone 上使用开罗?
我正在开发一个潜在的跨平台 C++ 应用程序,对于 Windows 和 OS X,Cairo 似乎可以满足我对 2D 图形的大部分需求,并允许我在平台之间共享大量代码。在理想的世界中,我真的希望能够在 iPhone/iPad 应用程序中使用相同(或非常相似)的绘图代码。
我意识到这意味着我需要先为 iPhone 编译 Cairo,然后才能尝试使用它,但我不知道如何去做。
如果有人能指出我正确的方向,我将非常感激。
I'm doing some work on a potentially cross-platform C++ application and for Windows and OS X it seems that Cairo will meet most of my needs for 2D graphics and allow me to share a lot of code between platforms. In an ideal world I'd really like to be able to use the same (or very similar) drawing code in iPhone/iPad apps.
I realise that this means that I'll need to compile Cairo for iPhone before I try to use it, but I've got no real idea on how to go about this.
If anyone can point me in the right direction I'd be very grateful.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
为了向那些碰巧尝试走与我相同路线的人更新此内容,我从未编译过它(当我询问建议时,我没有从开罗邮件列表得到太多回应)。对于 iOS 或 OSX 来说,Cairo 似乎并不是一个好主意。我最近遇到这篇帖子,它很清楚地表明它不是在 iOS 或 OSX 上稳定。
我现在很高兴我决定放弃 Cairo 作为我的跨平台图形方法,转而采用自制/本机方法。虽然这需要更多的努力,但对于我想要实现的目标来说,这是一个相当好的妥协。
To update this for anyone who happens to try going down the same route as I did, I never did get it to compile (I didn't get much response from the Cairo mailing list when I asked for suggestions). It seems that Cairo isn't really a very good idea for iOS or OSX. I've recently come across this post which pretty clearly says that it's not stable on iOS or OSX.
I'm now quite glad that I made the decision to ditch Cairo as my cross-platform graphics method and go to a home-brew/native method. Although it involves a bit more effort, it's been a pretty good compromise for what I was trying to achieve.
在 Windows 上,我使用 Visual Studio 编译了 Cairo,如下所示:
由于 Cairo 将使用 Quartz 进行字体和文本处理,因此您无需编译Pango(它有 Glib 作为依赖项)和 FreeType。我认为 iPhone 的设置应该类似。
此条目来自 Vladimir Vukićević 的博客显示Cairo 自 2008 年起就在 iPhone 上运行:)
On Windows I've compiled Cairo using Visual Studio like this:
Since Cairo will be using Quartz for font and text handling you will not have to compile Pango (which has Glib as dependency) and FreeType. I assume the setup for iPhone should be similar.
This entry from Vladimir Vukićević's blog shows that Cairo runs on iPhone since 2008 :)