简体   繁体   English

CoreGraphics替代方案?

[英]CoreGraphics Alternative?

I'm looking for a 2D rendering library as an alternative to CoreGraphics on iPhone. 我正在寻找一个2D渲染库作为iPhone上CoreGraphics的替代品。 Everything in my app is pretty dynamic, which makes splitting things up into layers and animations rather hard. 我的应用程序中的所有内容都非常动态,这使得将内容分成层和动画相当困难。

I'm quite familiar with OpenGL , and that is how rendering is implemented right now. 我对OpenGL非常熟悉 ,这就是现在如何实现渲染。 Everything would be so much easier to expand and development would go so much faster if I didn't have to worry about the low-level stuff in OpenGL, though (And my code would look so much neater :D). 如果我不必担心OpenGL中的低级东西,那么一切都会更容易扩展,开发会更快得多(而且我的代码看起来更整洁:D)。

I prefer C++ over Objective-C, so if you know any C++ libraries for rendering, that would be great. 我更喜欢C ++而不是Objective-C,所以如果你知道任何用于渲染的C ++库,那就太棒了。 I can work with C too. 我也可以和C一起工作。 Path-based rendering, like in CoreGraphics or the JavaScript Canvas API, would be beneficial. 基于路径的渲染(如CoreGraphics或JavaScript Canvas API)将是有益的。 Would Cairo work on iPhone? 开罗会在iPhone上工作吗?

I've actually been working on my own 2D renderer, which I'll probably release even if I don't end up using in my app, because I enjoy working on it. 我实际上一直在使用我自己的2D渲染器,即使我最终没有在我的应用程序中使用,我也可能会发布它,因为我喜欢它。 Does the iPhone support the stencil buffer? iPhone是否支持模板缓冲区? I can do polygon triangulation, or use GLU's tesselation library, but the stencil buffer would safe a load of work in the long run. 我可以进行多边形三角剖分,或者使用GLU的tesselation库,但是模板缓冲区从长远来看可以安全地完成工作。

Edit: Also, I've implemented rendering in this app with CoreGraphics before, and it didn't get as good of a frame rate as I'd like. 编辑:此外,我之前使用CoreGraphics在这个应用程序中实现了渲染,并且它没有像我想的那样获得良好的帧速率。 I did some research, and people have suggested not using CoreGraphics for things that are constantly redrawing the screen. 我做了一些研究,人们建议不要将CoreGraphics用于不断重绘屏幕的东西。 Some said CoreGraphics doesn't use the GPU, others said it was some caching mechanism. 有人说CoreGraphics不使用GPU,其他人说这是一些缓存机制。 I've avoided it ever since. 从那以后我就一直避开它。

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. MonkVG是一个类似于OpenVG 1.1的矢量图形API实现,目前使用OpenGL ES后端,该后端应该与支持OpenGL ES 2.0的任何硬件兼容,后者包括大多数iOS和Android设备。

This is an open source BSD licensed project that is in active development. 这是一个正在开发的开源BSD许可项目。 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 它可以在GitHub http://github.com/micahpearlman/MonkVG找到

Also, there is a SVG and SWF (flash) renderers built on top of MonkVG: 此外,还有一个在MonkVG之上构建的SVG和SWF(flash)渲染器:

MonkSVG MonkSWF MonkSVG MonkSWF

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM