为什么过剩如此严重?
尽管 openFrameworks 使用了 GLUT,但我看到了很多关于 GLUT 的不好的评论。
Cinder 开发人员表示,他们希望尽可能远离 GLUT……
那么这有什么不好呢?
I've seen a lot of bad comments about GLUT, although openFrameworks uses it.
Cinder developers have stated that they want to stay as far away from GLUT as possible...
So what's so bad about it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您永远不应该使用实际 GLUT。自 2001 年左右以来,它就没有更新过。另一方面,FreeGLUT 就很好了;它与原始版本 100% 向后兼容,并且仍处于半活跃开发状态。您可以假设此答案中对“GLUT”的任何进一步引用均表示“FreeGLUT”。
为什么 Cinder 开发人员不使用它是显而易见的:因为他们正在重写它的功能。他们正在编写 GLUT 的替代方案。
GLUT 是围绕应用程序的启动和运行而设计的。它的设计目的是让代码的放置位置变得简单明了,以使一切正常工作。这就是它的最终目的:让你可以轻松地将东西扔到屏幕上。
但在屏幕上扔东西通常并不是应用程序实际想要做的事情。当然,这是他们工作的一部分。但他们做的远不止这些。过剩的做事方式常常与编写严肃应用程序的人想要做的事情背道而驰。
这一切都是为了使用正确的工具完成正确的工作。 GLUT 非常适合组合简单、独立的视觉效果。如果您需要一些基本输入(鼠标移动、按键),那么它非常有用。但是,如果您有严格的计时需求,或者实际应用程序需要执行许多其他操作,那么 GLUT 将成为障碍而不是帮助。
没有理由你的口袋里不能有 GLUT 来进行简单的效果测试等,然后再拿出 Cinder 之类的东西来满足其他需要。
You should never use the actual GLUT. It hasn't been updated since 2001 or so. FreeGLUT on the other hand is just fine; it is 100% backwards compatible with the original and is still in semi-active development. You may assume that any further references in this answer to "GLUT" to mean "FreeGLUT".
Why the Cinder developers don't use it is obvious: because they're rewriting what it does. They're writing an alternative to GLUT.
GLUT is designed around getting an application up and running. It's designed to make it easy and obvious where to put your code in order to make everything work. That's what it is ultimately for: to make it easy for you to throw stuff onto the screen.
But throwing stuff on the screen is generally not what actual applications want to do. It's part of what they do, certainly. But they do much more than that. And the GLUT way of doing things often works counter to what someone writing a serious application wants to do.
It's all about using the right tool for the right job. GLUT is great for putting together a simple, self-contained visual effect. It's great if you want some basic input (mouse movements, key presses). But if you have strict timing needs, or many of the other things that a real application needs to do, then GLUT is going to be more of a hindrance than a help.
There is no reason why you can't have GLUT in your pocket for simple tests of effects and so forth, and then later bring out something like Cinder or whatever for something that has other needs.