在 iPhone 上使用开罗?

发布于 2024-09-16 10:59:31 字数 231 浏览 5 评论 0原文

我正在开发一个潜在的跨平台 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

紫南 2024-09-23 10:59:31

为了向那些碰巧尝试走与我相同路线的人更新此内容,我从未编译过它(当我询问建议时,我没有从开罗邮件列表得到太多回应)。对于 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.

一影成城 2024-09-23 10:59:31

在 Windows 上,我使用 Visual Studio 编译了 Cairo,如下所示:

  • libpng-1.2.40
  • zlib-1.2.3
  • pixman-0.16.2
  • cairo-1.8.8

由于 Cairo 将使用 Quartz 进行字体和文本处理,因此您无需编译Pango(它有 Glib 作为依赖项)和 FreeType。我认为 iPhone 的设置应该类似。

条目来自 Vladimir Vukićević 的博客显示Cairo 自 2008 年起就在 iPhone 上运行:)

On Windows I've compiled Cairo using Visual Studio like this:

  • libpng-1.2.40
  • zlib-1.2.3
  • pixman-0.16.2
  • cairo-1.8.8

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 :)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文