c99动态数组
我正在为 iphone 编写一个非常小的、特定于项目的 OpenGLES 引擎,我确实需要在 c99 方言中使用一个良好、可靠且经过验证的动态数组库/宏。 (没有 C++、Obj-C、stl 等)
它对于渲染批处理和多边形网格是非常必要的,因此它应该能够处理各种类型的数据,并且在数组大小更改和插入新数据时额外产生最小的开销。
我一直在四处寻找,找到了两个满足我需要的候选人。
第一个来自 Cocos2d 的 ccCArray。
另一种是 Troy D. Hanson 编写的 utarray。
ccCArray 坚如磐石,经过社区的充分验证。 utarray 看起来不错,但我找不到任何人真正使用它。
还有什么建议吗?
I'm writing a very small, project-specific OpenGLES engine for iphone and I really need to use a good, solid, and proven dynamic array library/macro in c99 dialect. (No C++, Obj-C, stl whatsoever)
It's strongly necessary for render batch and polygon mesh, so it should be able to handle various types of data, and additionally causes minimal overhead when array size changes and new data is inserted.
I've been searching around and found two candidates for my need.
the first one is from ccCArray from Cocos2d.
and another one is utarray written by Troy D. Hanson.
ccCArray IS rock solid, thoroughly proven by community. utarray looks fine but I cannot find anyone actually uses it.
Any more suggestion?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
图书馆?! C++ 模板非常适合这种需求。我想说最多 15 个函数(不包括替代构造函数和 const getter),你就完成了。还可以将它用于任何类型、任何大小和任何大小类型(字节、整数等),而且它只是一个文件:一个 .h,或者更好地说,一个 .hpp
你有什么理由拒绝吗?看来你想让自己的生活变得更艰难:)
A library ?! A C++ template would be more than suitable for this need. I'd say about AT MOST 15 functions (excluding alternative constructors and const getters), and you're done. Also able to use it for ANY type, ANY size and ANY size type (byte, int etc.) And it's just one file: a .h or, better said, a .hpp
Any reason you're rejecting it ? Seems like you want to make life harder for yourself :)