4

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?

Johnathan
  • 787
  • 4
  • 10
  • 21

2 Answers2

4

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).

Matthew
  • 47,584
  • 11
  • 86
  • 98
2

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.)

greyfade
  • 24,948
  • 7
  • 64
  • 80