Allegro 与 OpenGL 速度/效率对比

发布于 2024-11-01 01:49:24 字数 117 浏览 7 评论 0原文

我已经使用 Allegro 5 一段时间了,最​​近开始使用 Freeglut 研究 OpenGL。

我准备做出改变,但我想知道这是否真的值得。 OpenGL 的绘图操作真的比 Allegro5 高效吗?

I've been using Allegro 5 for a while now, and recently began looking into OpenGL with Freeglut.

I would be ready to make a switch, but I would like to know if it's really worth it. Is OpenGL really much more efficient than Allegro5 for its drawing operations?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

微凉 2024-11-08 01:49:24

Allegro 5 只有两个图形驱动程序:Direct3D 和 OpenGL。在 Windows 上,您可以在两者之间进行选择。在其他平台上,您必须使用 OpenGL。因此,您的问题有点无关紧要,因为 Allegro 5 中的所有内容(除非您明确使用未加速的内存位图)都是硬件加速的,并且很可能通过 OpenGL 进行加速。

如果您正在构建 3D 游戏,那么 Allegro 并没有任何非常有用的图形例程。但您仍然可以使用它来设置显示窗口并获取 OpenGL 上下文。然后您可以继续使用 Allegro 来处理其他组件(输入、声音等)。

Allegro 5 only has two graphics drivers: Direct3D and OpenGL. On Windows, you have a choice between the two. On other platforms, you must use OpenGL. So your question is a bit irrelevant as everything (unless you explicitly use unaccelerated memory bitmaps) in Allegro 5 is hardware accelerated, and quite likely via OpenGL.

If you are building a 3D game, then Allegro doesn't really have any graphical routines that are very useful. But you could still use it to set up the display window and get an OpenGL context. Then you could continue to use Allegro for the other components (input, sound, etc).

成熟稳重的好男人 2024-11-08 01:49:24

这取决于您执行的绘图操作。

它还取决于您执行的操作是否可以通过 OpenGL 进行硬件加速以及该加速是否有益。 (在 OpenGL 上,它还可能取决于您执行这些操作的方式,因为已知某些绘图方法明显比其他绘图方法慢。)

如果您想确定,请编写一些简单的程序,其中使用 Allegro 的非加速进行绘图API,然后是另一个使用等效 OpenGL 操作进行绘制的 API,并对它们进行分析。

(总的来说,我认为如果你的程序太简单或依赖于太简单的操作,你的结果可能毫无意义。许多绘图操作非常快,即使使用硬件加速,你也可能看不到任何差异,或者差异可能很小,所以没关系。)

It depends on the drawing operations that you perform.

It also depends on whether the operations you perform can be hardware-accelerated by OpenGL and whether that acceleration is beneficial. (On OpenGL, it can also depend on how you perform those operations, since some drawing methods are known to be measurably slower than others.)

If you want to know for sure, then write some simple programs where one draws with Allegro's un-accelerated API, then another which draws with equivalent OpenGL operations, and profile them.

(By and large, I think your results may be meaningless, if your program is too simple or relies on operations that are too simple. Many drawing operations are so quick that even with hardware acceleration, you might not see any difference, or the difference may be so small that it won't matter.)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文