Allegro.cc - Online Community

Allegro.cc Forums » Installation, Setup & Configuration » Allegro 4 Vs 5

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

I’m still running Allegro 4. Is there a great benefit to graduating on to Allegro 5? Is it a difficult transition? Meaning is it just a matter of learning a new syntax or is the setup and flow greatly different?

Thanks

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

AceBlkwell
Member #13,038
July 2011
avatar

Your right Edgar. Even looks like I asked this a while back. I’ll pull up some tutorials

Thx

Ariesnl
Member #2,902
November 2002
avatar

Allegro 5 is easier to use ;)

If you're using C++ I do have an easy framework for you
Allegro 5 is event based, so that is some getting used to.

usage:

#SelectExpand
1int main(int argc, const char * argv[]) 2{ 3 srand (time(NULL)); 4 g_pProgram = new CustomProgram(1024,768,false); 5 while (g_pProgram->HandleEvents()) 6 { 7 8 9 10 11 } 12 13 delete g_pProgram; 14 return 0; 15}

Perhaps one day we will find that the human factor is more complicated than space and time (Jean luc Picard)
Current project: [Star Trek Project ] Join if you want ;-)

dthompson
Member #5,749
April 2005
avatar

Nutshell: Allegro 5 suits modern hardware better, and the library's design is (so far as I know) considered far more sensible.

______________________________________________________
Website. It was freakdesign.bafsoft.net.
This isn't a game!

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

AceBlkwell
Member #13,038
July 2011
avatar

Thx all, I’ll check it out. I’m guessing you can’t have both 4 and 5 installed on same machine? I still have a few 4 projects I might want to update. Was hoping I wouldn’t have to uninstall and reinstall to swap between the two.

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Chris Katko
Member #1,881
January 2002
avatar

There's no reason to use Allegro 4 unless you're targetting DOS or same era machinery. That's what it's designed for. Any nitpicks about Allegro 5 are 99% "I learned once and I don't want to learn something new." It's faster in every way.

-----sig:
“Programs should be written for people to read, and only incidentally for machines to execute.” - Structure and Interpretation of Computer Programs
"Political Correctness is fascism disguised as manners" --George Carlin

AceBlkwell
Member #13,038
July 2011
avatar

Yeah I wouldn’t want to use them within the same program. Ive wrote a few programs in 4 and if I want to update them at some point I’m not going to be able to recompile using 5.

Thx all

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Yes, you can port them if you choose. There is a guide for porting lurking somewhere on the wiki or the web mostly its just a matter of changing some types and function calls. And you have to change your input from polling to event based.

Chris Katko
Member #1,881
January 2002
avatar

If your code is crap (you mix input and logic and drawing everywhere) then it'll be a PITA. Otherwise, it's barely more than a control-F find-and-replace, then the event handler code (which can be as simple as "throw all the old code into a single event." and simply respond to other required events).

-----sig:
“Programs should be written for people to read, and only incidentally for machines to execute.” - Structure and Interpretation of Computer Programs
"Political Correctness is fascism disguised as manners" --George Carlin

AceBlkwell
Member #13,038
July 2011
avatar

I think there a signature of another member. To paraphrase, all code is written like crap but your own. In any case I think my last project was better than my earlier attempts. I’m going to see about putting it on the depot just to gauge people’s reaction to it.
Thanks for the help.

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

AceBlkwell
Member #13,038
July 2011
avatar

With programming code, I just go with, “ if you can’t understand my code, it must be beyond your current skill set.” Now that’s not necessarily true but it’s what I’m sticking with ;D

ks
Member #1,086
March 2001

For those who still use Allegro 4 I'm surprised Todd Cope's Allegro Legacy isn't mentioned more often as a potential transition to Allegro 5.

https://github.com/NewCreature/Allegro-Legacy

+++

Introduction

Allegro Legacy is a library that you can use in place of Allegro 4 to compile your programs and run them on modern systems. It utilizes Allegro 5 to access the system hardware, so it should theoretically run anywhere Allegro 5 can run.

Features

  • Full Allegro 4 API compatibility

  • Additional functions to take advantage of Allegro 5 features

Chris Katko
Member #1,881
January 2002
avatar

I was talking about objective code smells though and even mentioned an example. Mixing code logic, drawing functions everywhere.

-----sig:
“Programs should be written for people to read, and only incidentally for machines to execute.” - Structure and Interpretation of Computer Programs
"Political Correctness is fascism disguised as manners" --George Carlin

ZoriaRPG
Member #16,714
July 2017
avatar

Is there still active work on Allegro Legacy?

last I saw, it still had no MIDI and I never received an answer as to why it can't just use AG4 miDI stuff.

'Drawing functions everywhere', 'AG4 bitmaps', 'AG4 indexed colour', and 'AG4 packfile' are the key issues with any direct AG4 to AG5 port, and why ZC could never be sanely ported (and compatible).

Go to: