库之间的关系:Clutter、Cogl、Clutter、GTK+等
我对上面列出的库的关系有点困惑,我的想法如下:
- Cairo 是一个 2D 图形库,GTK+ 使用它来渲染小部件。卡里奥等级低。
- Cogl是一个基于OpenGL的3D图形库(或者一个fork?我不知道),而Clutter是一个基于Cogl的3D GUI工具包。
如果这是正确的,Clutter 有一天会取代 GTK+ 吗?
而且...
如果您认为有更好的地方可以提出这个问题或者我应该首先阅读一些书籍,请告诉我!我是出于兴趣自学编程。
I'm a little confused about the relationship of the libraries listed above, here are what I think:
- Cairo is a 2D graphic library, and GTK+ uses it to render widgets. Cario is low-level.
- Cogl is a 3D graphic library based on OpenGL(or a fork? I don’t know), and Clutter is a 3D GUI toolkit based on Cogl.
If this is correct, will Clutter replace GTK+ someday?
And...
If you think there is a better place to ask this question or some books I should read first, please tell me! I'm self-learning programming for interest.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,Cairo 是一个高质量的 2D 绘图 API,GTK+ 使用 Cairo 来绘制自己。
Cogl 是一个 GPU 编程库,内部可以使用 GL 或 GLES 来访问图形管道(尽管理论上它可以在支持的平台上轻松使用 DirectX)。
Clutter 使用 Cogl 进行渲染,但它也可以使用 Cairo 进行 2D 元素。
Clutter 不会取代 GTK+:GTK+ 是一个非常复杂的库,它提供系统集成、复杂的小部件以及 Clutter 没有兴趣提供的其他实用 API。
未来将比黑白替代品更加灰色。
Cairo可以使用Cogl进行绘图; Cogl将对GPU管道进行编程,但Cairo将生成要提交的几何图形,因此您可以获得高质量的2D结果。 Cairo 已经可以直接使用 GL,但 Cogl 已经有了更好的状态跟踪。
Clutter 可以使用 GDK(GTK+ 窗口系统 API)与窗口系统表面对话并获取输入事件。
将来,GTK+ 完全有可能在内部使用 Clutter 作为其小部件的基础 - 尽管这仍然是一项正在进行的工作。
简而言之,图表可以是:
yes, Cairo is a high quality 2D drawing API, and GTK+ uses Cairo to draw itself.
Cogl is a GPU programming library that internally can use GL or GLES to access the graphics pipeline (though in theory it could as easily use DirectX on supported platforms).
Clutter uses Cogl for rendering, but it can also use Cairo for 2D elements.
Clutter will not replace GTK+: GTK+ is a very complex library that provides system integration, complex widgets, and other utility API that Clutter has no interest in providing.
the future is going to be a bit more gray than a black-and-white replacement.
Cairo can use Cogl to draw; Cogl will program the GPU pipeline, but Cairo will generate the geometry to be submitted, so you can have high quality 2D results. Cairo already can use GL directly, but Cogl has a better state tracking already.
Clutter can use GDK, the GTK+ windowing system API, to talk to the windowing system surfaces and get input events.
in the future, it's entirely possible that GTK+ will use Clutter internally as the base for its widgets - though that's still a work in progress.
in short, a diagram could be: