Porting Allegro code over to SDL

Hi,

I want to reuse a lot of code (~50k loc) from another project (Gusanos/Vermes), which is based on Allegro, to our project (OpenLieroX), which is based on SDL.

Do you have any suggestions on that?

I thought of multiple options:

  1. Include both SDL and Allegro into our project and hope they work fine together. I’d like to avoid this though because of the additional dependency and I can imagine that I would run into a lot of trouble here.

  2. Write a small Allegro wrapper. Basically for all functions which are needed in that project.

I’ll start with this second option now but it also seems a lot of work. Perhaps some of you have some better suggestions/ideas.

Thanks,
Albert

Well I would start by isolating all the Allegro APIs that you need.
You may find there are other libraries out there that implement the
same functionality independently of a larger lib, and where
applicable, possibly on top of SDL APIs.On Mon, Nov 30, 2009 at 8:39 AM, albert wrote:

Hi,

I want to reuse a lot of code (~50k loc) from another project
(Gusanos/Vermes), which is based on Allegro, to our project (OpenLieroX),
which is based on SDL.

Do you have any suggestions on that?

I thought of multiple options:

  1. Include both SDL and Allegro into our project and hope they work fine
    together. I’d like to avoid this though because of the additional dependency
    and I can imagine that I would run into a lot of trouble here.

  2. Write a small Allegro wrapper. Basically for all functions which are
    needed in that project.

I’ll start with this second option now but it also seems a lot of work.
Perhaps some of you have some better suggestions/ideas.

Thanks,
Albert


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


http://codebad.com/

Do you (or anyone) know any other projects where such work was done?

(I’ll crawl myself now a bit but not sure if I’ll find something this way.)

My suggestion is to gather the functions that you need and post them
(or a link to a page displaying them) on this mailing list. I think
any sort of SDL wrapper of Allegro (assuming one does not exist) would
be useful to many people who wouldn’t switch for loss of codebase.
I’d do what I could to provide some implementations and I’m sure other
people would chip in, making your job easier.

Jonny DOn Mon, Nov 30, 2009 at 9:19 AM, albert wrote:

Do you (or anyone) know any other projects where such work was done?

(I’ll crawl myself now a bit but not sure if I’ll find something this way.)


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Some first work here:

http://openlierox.git.sourceforge.net/git/gitweb.cgi?p=openlierox/openlierox;a=blob;f=src/gusanos/src/allegro.h;h=b304e721a9bacb7dfd21428dc84a4c4889786a0c;hb=refs/heads/Gusanos-0.59

Ok, I am finished, at least I have the project compiling now, i.e. I have added all functions which I need for this project.

http://openlierox.git.sourceforge.net/git/gitweb.cgi?p=openlierox/openlierox;a=blob;f=src/gusanos/src/allegro.h;hb=526a90029e6c3cf463ea1f1e54613917f77585ce

Now I just have to implement those… :stuck_out_tongue: