Allegro5 & SDL2 support?

For other topics related to the FreeBASIC project or its community.
Posts: 2
Joined: Nov 15, 2009 18:39

Allegro5 & SDL2 support?

Postby popcade » Aug 24, 2013 12:59

The libs come with FreeBasic 0.9x are still old, so I want to try with my limited skill, but doesn't work.
Has anyone managed to make these libraries working with FB?

For example SDL2 now changed it's license to zlib, what I want to do is make static libraries with SDL2/SDL2_mixer(without LGPL components)/SDL2_net/SDL2_ttf, but after many tries , I can't build them successfully. SDL2 doesn't come with static libraries, which is very inconvenient.

And in Allegro5 the situation is slightly better as it comes with static libraries, but there're so many libs and I don't know how to start, nor I know if it works with FB.

I migrated from other basic language and doesn't know much about FB, but I feel FB has potentials, the outdated libs may be issues to new users IMHO.
Site Admin
Posts: 3210
Joined: Jul 28, 2005 14:45
Location: Germany

Re: Allegro5 & SDL2 support?

Postby dkl » Aug 24, 2013 13:49

Currently FB's Allegro and SDL headers are out-dated, the most important thing we'd need to do is to update them. Well, that is assuming that there were significant enough changes since Allegro 4 and SDL 1 but I think that's safe to assume.

(I'm planning to work on that, once I can get my binding creator tool working well enough)

SDL's MinGW libs should work with FB, although there's always the issue of the different MinGW toolchains being slightly incompatible.
Posts: 226
Joined: Mar 12, 2006 16:25

Re: Allegro5 & SDL2 support?

Postby RockTheSchock » Aug 27, 2013 13:44

Allegro 5 doesnt support DOS anymore. The last version supporting DOS is the older Allegro 4.2 . I thibnk its great that Freebasic support Win, Linux and DOS. So please take that in to account. It would be nice to have a new and separate from that for legacy support.

Other libs that break compatibility with DOS should be handled in same way. So if someones really needs DOS support, he just includes the older Version.

Perhaps it would be even nicer to generally name libs examples folders the other way arround.Legacy libs with normal name and up to date ones like allegro_new
Site Admin
Posts: 3210
Joined: Jul 28, 2005 14:45
Location: Germany

Re: Allegro5 & SDL2 support?

Postby dkl » Aug 27, 2013 13:59

I think we can use version #defines to select the wanted API version of a library, for example:

Code: Select all

'' checks for __ALLEGRO_VER__ to declare structures/functions:
#if __ALLEGRO_VER__ = 42
declare function someAllegro4Function( ) as integer
#elseif __ALLEGRO_VER__ = 50
declare function someAllegro5Function( ) as integer

'' FB programs can then #define the version of they want to use:
#define __ALLEGRO_VER__ 42
#include ""

This problem also exists with libpng, GIFLIB, jpeglib, and others: multiple but incompatible versions existing and in use.

Return to “Community Discussion”

Who is online

Users browsing this forum: No registered users and 2 guests