3

我正在寻找一个 2D 渲染库来替代 iPhone 上的 CoreGraphics。我的应用程序中的所有内容都非常动态,这使得将内容拆分为图层和动画相当困难。

我对 OpenGL 非常熟悉,这就是现在实现渲染的方式。不过,如果我不必担心 OpenGL 中的低级内容,一切都会变得更容易扩展,开发也会变得更快(而且我的代码看起来会更整洁 :D)。

我更喜欢 C++ 而不是 Objective-C,所以如果你知道任何用于渲染的 C++ 库,那就太好了。我也可以使用 C。基于路径的渲染,如 CoreGraphics 或 JavaScript Canvas API,将是有益的。Cairo 可以在 iPhone 上运行吗?

我实际上一直在开发自己的 2D 渲染器,即使我最终没有在我的应用程序中使用它,我也可能会发布它,因为我喜欢使用它。iPhone 是否支持模板缓冲区?我可以进行多边形三角剖分,或者使用 GLU 的 tesselation 库,但从长远来看,模板缓冲区可以保证大量工作。

编辑:另外,我之前在这个应用程序中使用 CoreGraphics 实现了渲染,但它并没有达到我想要的帧速率。我做了一些研究,人们建议不要将 CoreGraphics 用于不断重绘屏幕的事情。有人说 CoreGraphics 不使用 GPU,也有人说这是某种缓存机制。从那以后我一直避免它。

4

1 回答 1

1

MonkVG is an OpenVG 1.1 like vector graphics API implementation currently using an OpenGL ES backend that should be compatible with any HW that supports OpenGL ES 2.0 which includes most iOS and Android devices.

This is an open source BSD licensed project that is in active development. At the time of this writing it is in a very early pre-release state (very minimal features implemented). Contributors and sponsors welcome.

It can be found at GitHub http://github.com/micahpearlman/MonkVG

Also, there is a SVG and SWF (flash) renderers built on top of MonkVG:

MonkSVG MonkSWF

于 2011-06-29T20:16:37.517 回答