开发者

Using Cairo on iPhone?

开发者 https://www.devze.com 2023-01-12 18:46 出处:网络
I\'m doing some work on a potentially cross-platform C++ application and for Windows and OS X it seems that 开发者_如何学CCairo will meet most of my needs for 2D graphics and allow me to share a lot o

I'm doing some work on a potentially cross-platform C++ application and for Windows and OS X it seems that 开发者_如何学CCairo 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.


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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消