Allegro

Everything related to the code /
Tout ce qui touche au code
Post Reply
User avatar
Cire
Moderator
Posts: 350
Joined: Tue Oct 31, 2006 5:59 pm
Location: Somewhere on Earth

Allegro

Post by Cire » Sat Dec 08, 2007 9:12 pm

Last I remember there was plans to eventually free ourselves from Allgero, I'am kinda curious as to if this is still the case. I believe it would be a smart move as allegro is very much a kludge. What I mean by this is that The allegro builds simply allow us to use a library of common functions that more or less pass and perhaps fill in additional data on each platform to approarpiate librarys.

We use very few calls to allegro base libary itself, by briefly examining the project i see just a few calls to it mainly timer interupts, which we could easilly create our own timers by adding a timer class to the project.

The excetpion is GL, TA3D is wrapped very heaily around AllegroGL. Since GL is already cross platfrom supported it would be wise to collect DC's from AllegroGL and start working with GL itself dirrectly and overtime phase it out.

Why is this important:
Well there are several reasons:
1] Reduced project size.
2] Easier platform compliation, since less 3rd party libs involved.
3] Easier to debug.
4] Probably the most important is reduced memory overhead, and faster code execuation, its much faster to do for example keyboard input-> var, then say Allegro GL call -> keyboard input -> var, and since allegro library wouln't be needed memory overhead would also be further reduced.
5] More control, since Allegro controls what we can do, by using direct libraries we would have much more control of data rather then what Allegro provides us with.

Now i'am not saing we should immeadatly drop Allegro/GL from the project, but we should seriously start looking at the future, since the project is nearing its multi-player point, we really want to start providing a game thats not a memory and cpu hog, and to provide something that both flexable and expandable.

Thoughts on this are welcome.

++Cire
Females: impossible to live with, most powerful money reducing agent known to man, 99% of the time they drive us insane; yet somehow we desire to have as many as we can.

User avatar
AF
Administrateur - Site Admin
Posts: 139
Joined: Thu Dec 28, 2006 8:19 pm
Location: NW UK
Contact:

Post by AF » Sat Dec 08, 2007 10:36 pm

I would say an incremental shift from AllegroGL resulting in a final push to get rid of it would be best.

This may also help fix doxygen parsing of TA3D.

User avatar
zuzuf
Administrateur - Site Admin
Posts: 3281
Joined: Mon Oct 30, 2006 8:49 pm
Location: Toulouse, France
Contact:

Post by zuzuf » Sat Dec 08, 2007 10:56 pm

Allegro & AllegroGL memory overhead is very small compared to TA3D's footprint !!! And there are lots of Allegro & AllegroGL calls everywhere in the code, for keyboard, mouse, FONTs, image loading, image manipulation, timers, unicode <-> ASCII routines, ...

I totally disagree with 1) since replacing Allegro will imply replacing it with home made code or with other libraries, so I also disagree with 2) since we'll be using more 3rd party libs, and 3) I never had problems with Allegro while debugging.

4) Allegro memory overhead is very small, Allegro's code is very optimized, and all the functions we use are fast. There are no AllegroGL -> keyboard function, Allegro handles keyboard itself, and if we replace Allegro we'd use something that's not cross platform or something that's doing exactly the same job.

5) Allegro let you control exactly what you want without having to bother with the platform you're using.

6) Currently it's not a good idea to do the changes that would be required to replace Allegro with something else because it's lots of work and we've other things to do at the moment and at this point the project is gaining popularity so it won't be seen as a good thing to change the base now and add new bugs ... for nothing.

Allegro is a good base, it doesn't use useless extra calls, makes the code cross platform and its fast (yes it's fast), so it's what we need.

Even if we decide to get rid of Allegro, there would be thousands of things to rewrite, why reinvent the wheel ? And what would we use instead ?
=>;-D Penguin Powered

User avatar
Balthazar
Moderator
Posts: 2055
Joined: Wed Nov 01, 2006 4:31 pm
Location: Russian Federation
Contact:

Post by Balthazar » Sun Dec 09, 2007 9:10 am

Well, from my point of view, the only reason to drop Allegro in some parts of code - is to make available D3D support. Yes, it will work only in Windows, but D3D cool :)

User avatar
AF
Administrateur - Site Admin
Posts: 139
Joined: Thu Dec 28, 2006 8:19 pm
Location: NW UK
Contact:

Post by AF » Sun Dec 09, 2007 10:46 am

Perhaps then we should at the very least move to the newer Allegro codebase with the merged in OpenGL stuff (4.3?)

User avatar
zuzuf
Administrateur - Site Admin
Posts: 3281
Joined: Mon Oct 30, 2006 8:49 pm
Location: Toulouse, France
Contact:

Post by zuzuf » Sun Dec 09, 2007 11:15 am

Currently Allegro 4.3 isn't ready, when it'll be ready we'll do the move to it, there is no need to start using something buggy at the moment.

D3D support can be done without dropping Allegro, the GFX is class can be used as a abstraction layer, but we'll need to replace every OpenGL call by a call to the GFX class. We first need to replace those calls slowly, then when it'll be done, someone will be able to make a gfx module for D3D.

Also, without AllegroGL, Allegro uses directx on win32 to draw on the screen, it doesn't use 3D routines but it's start.
=>;-D Penguin Powered

User avatar
Corsaire
Posts: 68
Joined: Sun Feb 25, 2007 6:44 pm

Post by Corsaire » Sun Dec 09, 2007 12:14 pm

I think moving to D3D is pretty stupid since directx technologies are windows only, remember that one of the goal of TA3D is to be portable to various systems.
Only OpenGL is supported on Windows, Linux (and BSDs), OSX.

I think it's a waste of time.

User avatar
zuzuf
Administrateur - Site Admin
Posts: 3281
Joined: Mon Oct 30, 2006 8:49 pm
Location: Toulouse, France
Contact:

Post by zuzuf » Sun Dec 09, 2007 12:21 pm

I agree, this is a waste of time. OpenGL is superior to D3D in many aspects mainly it's supported on lots of platforms and its API compatibility doesn't change every new revision ...

OpenGL is supported on almost all UNIX based OS: Linux, BSDs, Solaris, OSX, ... and on windows.

And it's why OpenGL still exists, because companies like Nvidia, ATI, ... and people like John Carmack understood it's superior.
=>;-D Penguin Powered

User avatar
Balthazar
Moderator
Posts: 2055
Joined: Wed Nov 01, 2006 4:31 pm
Location: Russian Federation
Contact:

Post by Balthazar » Sun Dec 09, 2007 2:57 pm

Well, then let`s stay as it is now, at least while there are more important things to do. :)

User avatar
zuzuf
Administrateur - Site Admin
Posts: 3281
Joined: Mon Oct 30, 2006 8:49 pm
Location: Toulouse, France
Contact:

Post by zuzuf » Sun Dec 09, 2007 2:58 pm

Yes, currently those things aren't a priority
=>;-D Penguin Powered

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests