|
Porting Allegro 4 to Allegro 5 summary. |
Runesabre
Member #7,573
August 2006
|
I'm about to port an MMO game client I created 4 years ago in Allegro 4 to the latest Allegro 5. Can I expect this to be a lot of syntax trivia (i.e. replacing functions from Allegro 4 with corresponding Allegro 5 functions) or is Allegro 5 completely different from Allegro 4 from a fundamental/architectural point of view? Are there any consistent gotchas I should be planning for? I'm definitely looking forward to having iPhone and Android support with my favorite game development kit! _______________ |
kazzmir
Member #1,786
December 2001
|
You can read about my experience porting to Allegro5: http://www.allegro.cc/forums/thread/607477 To answer your questions, yes allegro5 is significantly different from allegro4 so its not just replacing function names. The most significant thing to keep in mind, imo, is that you can't just create bitmaps whenever you feel like in allegro5 and draw on them. You should try to draw on the main backbuffer (the double buffered screen) as much as possible, perhaps making sub-bitmaps of it when its convenient. If you have a lot of bitmaps in your program you will most likely end up with a few memory bitmaps and your whole program will slow down quite a bit. They should only be displayed if they are converted to video bitmaps which you can do easily with al_convert_bitmap, but make sure only to do it in the thread where the display was created. I suppose another thing to keep in mind is that allegro5 uses events where allegro4 used global polling. So instead of doing if (key[KEY_A]) you would set up a queue that gets an event placed on it and then check if that event is the A key: al_next_event(&event); if (event.type == KEYBOARD) ... something like that. Also drawing primitives and particularly putpixel are much slower in Allegro5 than their Allegro4 counterparts. |
Matthew Leverton
Supreme Loser
January 1999
|
They are completely different. The biggest changes will probably be:
|
Luiji99
Member #12,254
September 2010
|
To extend to the biggest changes list:
Programming should be fun. That's why I hate Java. |
Gideon Weems
Member #3,925
October 2003
|
Luiji99
Member #12,254
September 2010
|
Think of it like programming for OpenGL (2-D only) with a much simpler and highly-extended API. Programming should be fun. That's why I hate Java. |
Thomas Fjellstrom
Member #476
June 2000
|
You can use memory bitmaps if you like. But they aren't something you want to use in your main drawing code a lot. -- |
Runesabre
Member #7,573
August 2006
|
You have all been very helpful, thank you very much! _______________ |
|