Allegro.cc - Online Community

Allegro.cc Forums » Allegro Development » tried allegro 5 today, some ideas

This thread is locked; no one can reply to it. rss feed Print
 1   2   3 
tried allegro 5 today, some ideas
kronoman
Member #2,911
November 2002
avatar

hello

well, I have some things to say about allegro 5

first, works really fast, Im using a ASUS EEE netbook , 1.6 Atom, and really works awesome, more fps than the allegro 4.x series on my projects

the ttf font support rocks!!

computer: ASUS EEE 1,6ghz
system: windows xp

now, what I did not liked...

pretty hard to compile, had to download a lot of stuff that I detail here:
the documents about what to download and where from arent that clear

allegro-4.9.21.7z
cmake-2.8.2-win32-x86.zip
dx9mgw.zip
freetype-2.3.5-1-bin.zip
freetype-2.3.5-1-lib.zip
jpeg-6b-4-bin.zip
jpeg-6b-4-lib.zip
libpng-1.2.37-bin.zip
libpng-1.2.37-lib.zip
zlib-1.2.3-bin.zip
zlib-1.2.3-lib.zip

then, make install did not install the proper dlls, so I had to install them by hand
or the examples will not run

dlls needed (A LOT, 13,04 MB OF THEM)
allegro_acodec-4.9.dll
allegro_audio-4.9.dll
allegro_color-4.9.dll
allegro_dialog-4.9.dll
allegro_font-4.9.dll
allegro_image-4.9.dll
allegro_main-4.9.dll
allegro_memfile-4.9.dll
allegro_primitives-4.9.dll
allegro_ttf-4.9.dll
allegro-4.9.dll
jpeg62.dll
libpng3.dll
d3dx9.dll
freetype6.dll

I did not compiled the ogg, DUMB stuff etc

so well, whats my point? I feel it a little bloated, no more small 500 kb games that I could send to my friends by mail :(

also, aint very clear on the documentation about what files you need, or how to install, UNINSTALL them if you dont want to use A5 anymore, and how to compile your game
I mean, I can figure it all by myself , but would be cool to have it on the documentation
maybe the lists that I put above will help

the features of A5 are really cool, just like I said, I found the build docs pretty thin, and the product a little big, i.e a small game will be at least 15 MB?

btw, never managed to get audio on the examples, but I got audio on the demo speed
this samples did nothing on my machine
ex_acodec.exe
ex_acodec_multi.exe
ex_audio_props.exe
ex_audio_simple.exe

the demo a5steroids should work anyways if you did not compiled ogg, just dont use those resources

thanks for your time, just trying to help to improve and make easier to use A5

Matthew Leverton
Supreme Loser
January 1999
avatar

You can download binaries, including single DLL ones, here:

http://allegro5.org/

SPEED uses code generated music and sound, which is why that worked. Otherwise you are stuck with WAV files if you don't have OGG.

Trent Gamblin
Member #261
April 2000
avatar

The game doesn't need to be 15MB. For example, here's a game that's a 1.5MB binary: http://www.nooskewl.com/stuff/downloads/Happy-WordZ-1.1-linux.zip. That includes the dlls and a fair bit of graphics and even music.

Elias
Member #358
May 2000

The next version will also not include libpng and libjpeg by default (we use GDI+ instead) so less size. And Micał (hope I spell that right) also managed to create a single .dll which includes all the addons and dependencies. So no need to build yourself, and very easy distribution.

--
"Either help out or stop whining" - Evert

X-G
Member #856
December 2000
avatar

The lack of fully compatible MSVC10 binaries is still a problem. The batch currently up on the site inexplicably link to the MSVC9 debug runtime, and are thus useless for MSVC10.

--
Since 2008-Jun-18, democracy in Sweden is dead. | 悪霊退散!悪霊退散!怨霊、物の怪、困った時は ドーマン!セーマン!ドーマン!セーマン! 直ぐに呼びましょう陰陽師レッツゴー!

kronoman
Member #2,911
November 2002
avatar

thanks for all the info

now, the link to the pre compiled binaries should be clear on the readme inside the source files pack, like some warning, you could do this faster if you want :)

I downloaded my copy from here

http://alleg.sourceforge.net/

that goes here

http://sourceforge.net/projects/alleg/files/allegro-unstable/4.9.21/

I cant see any reference or link to the binary files, or a visible link to the new website of Allegro that I found thanks to you: http://allegro5.org/

other idea, I know there is OGG support, but a MP3 add-on would be nice too

and about GDI+, will that work on linux?

we need more info on the docs on how to distribute a game for linux, i.e in binary form, at least for the major current distros

that kind of info would make allegro useful for commercial development of games

Trent Gamblin
Member #261
April 2000
avatar

kronoman said:

and about GDI+, will that work on linux?

No, it's a Windows thing. But every Linux distro already has libpng and libjpeg, so you don't have to include those with your distribution. Same for libogg, libvorbis, libvorbisefile, and others can be installed by the package manager.

Quote:

we need more info on the docs on how to distribute a game for linux, i.e in binary form, at least for the major current distros

The best solution I've find so far is to compile on an old version of Ubuntu (I use 8.04). I haven't had many problems when doing that. I like as much stuff statically as makes sense (like stuff that may vary between distros: lua, physfs and so on). Then I include the allegro shared libraries with my program, though you can link statically also. I put the shared libs in though, and run my game with a little script:

#!/bin/sh

LD_LIBRARY_PATH=shared_libs:$DL_LIBRARY_PATH ./mygame.real

Michał Cichoń
Member #11,736
March 2010

Elias said:

<slash>Micał (hope I spell that right)<slash>

Almost. Michał - that's my name in Polish, Michael in English. So you miss 'h' letter. ; )

kronoman said:

other idea, I know there is OGG support, but a MP3 add-on would be nice too

To use MP3 in your game/application you have to pay a fee. Check this site for details.

kronoman said:

and about GDI+, will that work on linux?

No, it would not. GDI+ is not available under Linux. libpng and jpeglib will be used instead.

"God starts from scratch too"

verthex
Member #11,340
September 2009
avatar

Well, it would be nice to have a tutorial on setting up allegro 5 for fedora linux users. I'm not entirely sure how a dll would work on linux, since the .so file is the equivalent for linux.

Plus a wiki on allegro "methods" support would be nice, something like a chart that shows what works on mac, windows, linux, etc. for allegro 5.

Arthur Kalliokoski
Member #5,540
February 2005
avatar

verthex said:

Well, it would be nice to have a tutorial on setting up allegro 5 for fedora linux users.

What? I have Slackware, and all I had to do was say

tar xv allegro-blahblah.tar.gz
cd allegro-4.9
mkdir build
cd build
cmake ..
make
make install (as root)

#define GL_TIMEOUT_IGNORED 0xFFFFFFFFFFFFFFFFull

kronoman
Member #2,911
November 2002
avatar

To use MP3 in your game/application you have to pay a fee

From the site

However, no license is needed for private, non-commercial activities (e.g., home-entertainment, receiving broadcasts and creating a personal music library), not generating revenue or other consideration of any kind or for entities with associated annual gross revenue less than US$ 100 000.00.

I wish I had to pay the license, I would be making 100 K !!! :D

now, the legal issue is solved, some examples of code on how to link MP3 to A5??

Thomas Fjellstrom
Member #476
June 2000
avatar

kronoman said:

However, no license is needed for private, non-commercial activities (e.g., home-entertainment, receiving broadcasts and creating a personal music library), not generating revenue or other consideration of any kind or for entities with associated annual gross revenue less than US$ 100 000.00.

If that Jukebox is ever used in a public place or restaraunt they may want money.

as for actual games, that isn't included in your quoted text, it has its own exceptions. 5000 distributed copies.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro SVN Snapshots] - [Allegro TODO] - [Web Hosting]
"God Bless Joe Pesci" -- George Carlin
"Goto is the buldozer of coding. Sometimes, the buldozer is just the right tool for the job. Not often, but sometimes." -- LordBob

Bruce Perry
Member #270
April 2000

I would not bother with mp3 support in Allegro. Aside from the legal minefield, there is the fact that mp3 is technically outdated. Ogg Vorbis surpasses it by miles, particularly for smaller file sizes. You know how bad most Flash animations used to sound 5-10 years ago? That's what mp3 does for smaller file sizes.

In my view, the only reason to use mp3 is when you want maximum compatibility and you are not in control of the player. For example, if you are distributing music for people to play on their letter-of-the-alphabet-Pods, it makes a degree of sense.

Occasionally it's useful, e.g. if your game can make use of the end-user's existing music library, but that's quite rare. In my view it would be sufficient for Allegro 5 to recommend one or more existing mp3 libraries, but to start with a paragraph explaining what Ogg Vorbis is and persuading people as to why they should use it. :)

(I may be biased by some mild sadness that Ogg Vorbis hasn't had more success in the commercial world.)

Thanks for making the suggestion thread. I'm not involved with Allegro 5 development (too busy), but it's good to see this sort of thing happening. I have been trying to find time to start using Allegro 5 myself, and I want it to be as good as it can be :)

By the way, in #allegro we were wondering where you were :)

--
Bruce "entheh" Perry [ Web site | DUMB | Set Up Us The Bomb !!! | Balls ]
The brxybrytl has you.

verthex
Member #11,340
September 2009
avatar

What? I have Slackware, and all I had to do was say

tar xv allegro-blahblah.tar.gz
cd allegro-4.9
mkdir build
cd build
cmake ..
make
make install (as root)

All I could find are binaries, what about the tar file. Where is it?
edit NM: Tar files

Also I tried:

tar xv allegro-blahblah.tar.gz

and the cursor hangs.

Tried xvfz but I could not get make to work in the build directory, got an error
saying the makefile target could not be found???

I got the makefile but then I get this error at the end

-- Build files have been written to: /home/cf/Desktop
make[1]: CMakeFiles/Makefile2: No such file or directory
make[1]: *** No rule to make target `CMakeFiles/Makefile2'. Stop.
make: *** [all] Error 2

Evert
Member #794
November 2000
avatar

verthex said:

Tried xvfz

See the .gz ending? That means it's a gzip'ped file you're dealing with. Which means you need to gunzip it before you use it. And that's exactly what the z flag to tar does.

Quote:

but I could not get make to work in the build directory, got an error
saying the makefile target could not be found???

Post the exact commands that you typed here.
For you information, that should be something along the lines of

$ mkdir Build
$ cd Build
$ cmake ..
$ make

Thomas Fjellstrom
Member #476
June 2000
avatar

tar xv allegro-blahblah.tar.gz

Yeah, you want to put the 'f' flag there, and put it last. all you should need in most cases is: tar xf file.tar.gz

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro SVN Snapshots] - [Allegro TODO] - [Web Hosting]
"God Bless Joe Pesci" -- George Carlin
"Goto is the buldozer of coding. Sometimes, the buldozer is just the right tool for the job. Not often, but sometimes." -- LordBob

verthex
Member #11,340
September 2009
avatar

I got it to install using this for fedora 13:

tar xvfz allegro-4.9.21.tar.gz
cd allegro-4.9.21
mkdir Build
cd Build
cmake ..
make
make install (as root)

Not sure how this was a problem before, I did the same exact thing previously.

Now how do I setup the linker in codeblocks. What name.a do I use to link with?

I also noticed several of these messages with different names with .so extension.
heres an example...

Removed runtime path from "/usr/local/lib/liballegro_main.so.4.9.21"

Is that ok?
EDIT:

So I tried to compile this code after commenting out some statements related to common.c:

#SelectExpand
1#include <allegro5/allegro5.h> 2#include "allegro5/allegro_image.h" 3#include <allegro5/allegro_primitives.h> 4 5//#include "common.c" 6 7#define NUM_BUTTONS 3 8 9static void draw_mouse_button(int but, bool down) 10{ 11 const int offset[NUM_BUTTONS] = {0, 70, 35}; 12 ALLEGRO_COLOR grey; 13 ALLEGRO_COLOR black; 14 int x; 15 int y; 16 17 x = 400 + offset[but-1]; 18 y = 130; 19 20 grey = al_map_rgb(0xe0, 0xe0, 0xe0); 21 black = al_map_rgb(0, 0, 0); 22 23 al_draw_filled_rectangle(x, y, x + 26.5, y + 41.5, grey); 24 al_draw_rectangle(x, y, x + 26.5, y + 41.5, black, 0); 25 if (down) { 26 al_draw_filled_rectangle(x + 2, y + 2, x + 24.5, y + 39.5, black); 27 } 28} 29 30int main(void) 31{ 32 ALLEGRO_DISPLAY *display; 33 ALLEGRO_BITMAP *cursor; 34 ALLEGRO_MOUSE_STATE msestate; 35 ALLEGRO_KEYBOARD_STATE kbdstate; 36 int i; 37 38 if (!al_init()) { 39 //abort_example("Could not init Allegro.\n"); 40 return 1; 41 } 42 43 al_init_primitives_addon(); 44 al_install_mouse(); 45 al_install_keyboard(); 46 al_init_image_addon(); 47 48 display = al_create_display(640, 480); 49 if (!display) { 50 // abort_example("Error creating display\n"); 51 return 1; 52 } 53 54 al_hide_mouse_cursor(display); 55 56 cursor = al_load_bitmap("data/cursor.tga"); 57 if (!cursor) { 58 // abort_example("Error loading cursor.tga\n"); 59 return 1; 60 } 61 62 do { 63 al_get_mouse_state(&msestate); 64 al_get_keyboard_state(&kbdstate); 65 66 al_clear_to_color(al_map_rgb(0xff, 0xff, 0xc0)); 67 for (i = 1; i <= NUM_BUTTONS; i++) { 68 draw_mouse_button(i, al_mouse_button_down(&msestate, i)); 69 } 70 al_draw_bitmap(cursor, msestate.x, msestate.y, 0); 71 al_flip_display(); 72 73 al_rest(0.005); 74 } while (!al_key_down(&kbdstate, ALLEGRO_KEY_ESCAPE)); 75 76 return 0; 77}

I added liballeg.a in the link libraries but then I got this error:

ld||cannot find -lalleg|

This was in codeblocks.

I tried to put -lalleg in the box next to the libraries box under the "other linker options" heading with no luck, do I need to specify a directory?

If so where?

EDIT

I tried this page where on the bottom it says to change the project build options. I added the directory under usr/local/lib but adding liballegro.so didn't work?

I did remove the liballeg.a option in the link libraries section as well.

EDIT:

I just had to import every .so file from usr/local/lib and it compiled fine.

But then I got this error running the program in xterm,

{"name":"602127","src":"http:\/\/static.allegro.cc\/image\/cache\/4\/d\/4d8f2ea044bc275e5d7dd23211e142b2.png","w":513,"h":168,"tn":"http:\/\/static.allegro.cc\/image\/cache\/4\/d\/4d8f2ea044bc275e5d7dd23211e142b2"}602127

I did find these 2 pages (allegro thread and fedora thread) but Im not sure how to modify the sudo command to fix the above error.

Example:
sudo ln -s /opt/wx/2.8/lib/libwx_gtk2u-2.8.so.0 /usr/lib/libwx_gtk2u-2.8.so.0

Michał Cichoń
Member #11,736
March 2010

kronoman said:

now, the legal issue is solved, some examples of code on how to link MP3 to A5??

I wrote allegro_mpeg plugin which handle MP1, MP2 and MP3. As far as I know it cover whole Allegro feature set about sound and music.
Proper patch is attached to this message. Apply it on the current working copy of Allegro.
However, this plug-in don't use Allegro build system, so you need to compile it on your own.
Specify your compiler and I can provide you a binary version compiled with 13703 revision version of Allegro repository.

"God starts from scratch too"

kronoman
Member #2,911
November 2002
avatar

I wrote allegro_mpeg plugin which handle MP1, MP2 and MP3. As far as I know it cover whole Allegro feature set about sound and music.

wow, great! I just did a travel and left my netbook behind, I will try it when I get back to it... this patch should be done a plugin or addon to A5, like those add-ons that add MP3 to Ubuntu i.e, so if the guy is going to make something for in-home use, he can play around with MP3, or if he is in some country where copyright law is meaningless...

in #allegro we were wondering where you were :)

here and there, going around doing lots of stuff, I will get to #allegro soon to chat!

they may want money.

let them want money, they will need to get me first... not like RIAA, MPAA or something have any jurisdiction here, they can whine all what they want, but they are meaningless here

Bob
Free Market Evangelist
September 2000
avatar

Can Allegro detect which packages are missing and automagically install them, at least for the common platforms?

--
- Bob
[ Webpage | Allegro FAQ | Coding Tricks ]
"Oh, you want to do actual work. In that case, avoid the GameCube at all costs!" - Me

verthex
Member #11,340
September 2009
avatar

Bob said:

Can Allegro detect which packages are missing and automagically install them, at least for the common platforms?

On fedora and redhat its

yum install allegro
yum install allegro-devel

but thats the 4.2.2 version I believe. I wish it was possible to get allegro 5 with it.
And even if it was possible to install it then the codeblocks setup issues would still exist since the two things are unrelated.

Thomas Fjellstrom
Member #476
June 2000
avatar

verthex said:

And even if it was possible to install it then the codeblocks setup issues would still exist since the two things are unrelated.

There would be no setup issues since the distro will install allegro to /usr rather than /usr/local.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro SVN Snapshots] - [Allegro TODO] - [Web Hosting]
"God Bless Joe Pesci" -- George Carlin
"Goto is the buldozer of coding. Sometimes, the buldozer is just the right tool for the job. Not often, but sometimes." -- LordBob

Karadoc ~~
Member #2,749
September 2002
avatar

I recently found something really useful... it isn't directly related to allegro, but I'd like to share it here anyway: This guy had put together a useful MinGW bundle which includes most of the stuff one is likely to want to have installed for programming with MinGW. The reason I'm posting it is that it includes the most recent version of MinGW in a form that is much easier to get than from the MinGW homepage; this new MinGW is required for some a5 features. The package also includes a few packages that a5 uses, including libpng and libogg.

So I'd recommend that package to anyone who wants to use allegro.

-----------

Myrdos
Member #1,772
December 2001

Bob said:

Can Allegro detect which packages are missing and automagically install them, at least for the common platforms?

I suspect the best way would be to create .deb and .rpm packages.

__________________________________________________

Don Freeman
Member #5,110
October 2004
avatar

Just some ideas:

  • Need a way to get the desktop's color depth and size.

  • Need to either document, or add functions, as to what addons need shutdown/cleanup functions called and which don't.

  • Would be nice to see an al_center_display(display) type function, or as an option when creating a display.

  • Need to document that samples must be stopped before destroying them, as this causes a crash...at least under Windows.

Various others, but those are the ones I remember right now...been a long day at work.

--
"Everyone tells me I should forget about you, you don’t deserve me. They’re right, you don’t deserve me, but I deserve you."
"It’s so simple to be wise. Just think of something stupid to say and then don’t say it."

 1   2   3 


Go to: