Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Difference between 4 and 5

This thread is locked; no one can reply to it. rss feed Print
Difference between 4 and 5
AceBlkwell
Member #13,038
July 2011
avatar

I've looked around and couldn't really find an answer. What is the difference between Allegro 4 & 5? I realize there will be command difference and graphics handling difference but I was under the impression that 5 was geared towards event driven programming (like visual c++) where 4 was geared towards more of a starting with main top down kind of programming?

Am I close or totally out in left field? I'm thinking of graduating on but didn't want to learn a whole new flow. Took me a while to move between C and old GWbasic years ago ;D.

Thx
Ace

Bruce Perry
Member #270
April 2000

What you said is true to an extent, but more fundamentally, 4 evolved from DOS and has quirks to match, while 5 was built more with windowed platforms and other modern features (e.g. GPU acceleration) in mind.

However, with 5, you still write your own event loop - or not if you decide you don't need it (but I find an event loop is the most correct way to do things).

--
Bruce "entheh" Perry [ Web site | DUMB | Set Up Us The Bomb !!! | Balls ]
Programming should be fun. That's why I hate C and C++.
The brxybrytl has you.

Vanneto
Member #8,643
May 2007

Allegro 5 is written in C and can be used with C perfectly. It's event driven, yes, but I don't think it's much like Visual C++ style of events you use when using Forms.

The main difference is support for hardware acceleration. Allegro 5 uses OpenGL or DirectX (depending on your system/choice) and is thus hardware accelerated "out of the box". It also has support for compression using PhysicsFS, various audio formats, images, video playback, primitives, shaders, TrueType fonts, threads... It's almost too much to list.

You can't really compare 4 and 5. Allegro 5 is a beast. For a relatively simple, not too graphics intensive game, sure, go ahead and use Allegro 4, it's a wonderful experience. But for anything serious, you'd want to go with 5, because that is the one being actively developed and is supported.

In capitalist America bank robs you.

Audric
Member #907
January 2001

Vanneto said:

For a relatively simple, not too graphics intensive game, sure, go ahead and use Allegro 4

Sorry but no, this is no good advice.
Nobody should start learning Allegro 4 now. This knowledge is getting obsolete faster and faster, and even the best Allegro 4 resources and tutorials can be completely misleading when you read them now. Eg:
- Any advice about "floating point is slow",
- assumption that screen is 256-color by default,
- dirty rectangle systems (fail whenever DirectX loses the content of graphic memory),
- relying on reading the screen's pixels (slow and cumbersome now).

AceBlkwell
Member #13,038
July 2011
avatar

Thx for all of the advice. I currently use 4.4.2(?) and have a game about ready. For the next one I'll install Allegro 5. As Vanetto mentioned, I don't written anything hard core yet so all of the OpenGL type stuff I haven't use to this point. Actually 4.4.2 works pretty well for me but in the spirit of improving and wanting to get away from console mouse free simple programs, I think I'll graduate on.

Thx again
Ace

Knight Lore
Member #16,395
June 2016
avatar

Well, I'm in a very similar position to OP. I was researching about the possibility to port my projects to Allegro 5 and ended making my first steps in 4.2 (!!!)

Audric said:

Nobody should start learning Allegro 4 now

Well, looks like here are we, a few who dont think so :)

_________________________
8 bits craftsmanship

Audric
Member #907
January 2001

I only want people to be aware of the disadvantages / limitations. If you're well-informed and still find it the better choice in your situation, go ahead, and welcome :)

Knight Lore
Member #16,395
June 2016
avatar

Thanks Audric, well, in fact my laptop turns 12 next week and more importantly, I'll try to port to DOS. Allegro 4 is lovely but in turn Allegro5 is better suited to these times. Only give it a try to the good old 4.2

In fact, I know about Allegro from 15 years or so, but not until very recently I decided to go in a serious manner

_________________________
8 bits craftsmanship

dada__
Member #16,089
September 2015
avatar

I'm developing a game specifically for DOS :) But I realize that I'm the odd one here, the only reason I'm doing it is because I think it's an interesting challenge, and as a sort of homage to the old 90s PC games I grew up with. So naturally I use Allegro 4.

I guess I could still recompile it for modern platforms as long as I keep compatibility in mind though. But if I wasn't doing such an obscure project, I would definitely be using Allegro 5 instead.

anto80
Member #3,230
February 2003
avatar

Back in 1999, I used Allegro 3. Then I used Allegro 4. Mostly to code for 320x240 diplay in 256 colors.

Then again I used Allegro 4 + AllegroGL when it came to performance problem on bigger sprites, bigger resolutions, resizable windowed modes...
And now, since ~2014 I use Allegro 5.0.10 and I'm perfectly satisfied.
It was such a pain to convert most functions I wrote for previous version into Allegro5-compatible ones but I totally don't regret.

___________
Currently working on his action/puzzle game CIPHER PUSHER : Blocks/Vortexes/Seafood! Facebook - Twitter - webpage

bamccaig
Member #7,536
July 2006
avatar

Mark Oates
Member #1,146
March 2001
avatar

dada__ said:

I'm developing a game specifically for DOS :) But I realize that I'm the odd one here, the only reason I'm doing it is because I think it's an interesting challenge, and as a sort of homage to the old 90s PC games I grew up with.

You'd like this:

video

--
Visit CLUBCATT.com for cat shirts, cat mugs, puzzles, art and more <-- coupon code ALLEGRO4LIFE at checkout and get $3 off any order of 3 or more items!

AllegroFlareAllegroFlare DocsAllegroFlare GitHub

bamccaig
Member #7,536
July 2006
avatar

I think that there's a certain kind of purity to the simpler time of old... I can only dream about being a programmer in the 70s working with UNIX and C in a time when they were new and bleeding edge! I worked my way through an x86 assembler tutorial and it was a lot of fun. It's somewhat surprising what you can accomplish in assembly even today. It's not terribly difficult. That said, you don't gain much from it other than ego and nostalgia. :)

Mark Oates
Member #1,146
March 2001
avatar

It's surprisingly not too much different from C code. Logistically, it's the same... but linguistically different.

--
Visit CLUBCATT.com for cat shirts, cat mugs, puzzles, art and more <-- coupon code ALLEGRO4LIFE at checkout and get $3 off any order of 3 or more items!

AllegroFlareAllegroFlare DocsAllegroFlare GitHub

beoran
Member #12,636
March 2011

Basically Allegro 4 = Allegro Classic and Allegro 5 = Allegro for Contemporary platforms. I'd say the only reason these days to use Allegro 4 these days is if you want to make retro games for DOS for some reason. For all other uses I strongly recommend Allegro 5 which is somewhat more complex but a lot more powerful and better supported.

Knight Lore
Member #16,395
June 2016
avatar

Retro games for DOS are highly portable. Think about emulators.
DOSBox Works very well in Android.

_________________________
8 bits craftsmanship

Go to: