The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
porting Allegro code over to SDL
albert


Joined: 22 Oct 2009
Posts: 29
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
porting Allegro code over to SDL
Donny Viszneki
Guest

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:
Quote:
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

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org





--
http://codebad.com/
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
albert


Joined: 22 Oct 2009
Posts: 29
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.)

Edit: First thing I found:
http://www.google.com/codesearch/p?hl=en#kEkH0HJetBU/pub/NetBSD/packages/distfiles/raines-0.40.2.tar.bz2|AsYpJGGnM3g/raine/source/sdl/&q=allegro.h%20SDL (raines project)
Very very small wrapper though, mostly just a converter from Allegros surface to SDLs surface - almost all other functions are missing.
porting Allegro code over to SDL
Jonny D


Joined: 12 Sep 2009
Posts: 932
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 D


On Mon, Nov 30, 2009 at 9:19 AM, albert wrote:
Quote:
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

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
albert


Joined: 22 Oct 2009
Posts: 29
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
albert


Joined: 22 Oct 2009
Posts: 29
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... Razz