"System none" initialization on Allegro 5

Good old Allegro 4 had AL_SYSTEM_NONE option when you want to use Allegro in text mode or GDI or xWindows. Is there something similar for Allegro 5? I'm looking for it but I cant find anything.

Problem is that I started an editor, I want to use Allegro to manipulate some data so I can reuse some code from the game. But it raises an ugly SIGSEV from pthread_mutex_lock.c after initialising Allegro. I'm using Lazarus and seems that the system library conflicts with Allegro when it tries to deal with low-level OS stuff (open a GUI window).


I think it would be a good addition and should not be too hard to do. Maybe make it a config option, so you could do:

al_set_config_value(al_get_system_config(), "system", "driver", "NONE");

Only problem could be that even things like filesystem access are somewhat platform dependent, so may have to shuffle some things around a bit.


AFAIK, for filesystem it uses stdio stuff, doesn't it? May be Android or iOS needs some weird stuff but I think this feature wont be used in such platforms.

For the API I think the version 4 way should be the best one. A collection of constants or an enum with several options.


You could have non stdio stuff. My SpeedHack/TINS game template basically uses PhyFS. Also, there's a memfile thing that I haven't looked into.


PhyFS is an add-on. So if you don't initialize it, it won't be used. I'm asking about the Allegro core, and may be the image and codec add-ons.


This seems like a niche enough feature to add a new version of al_install_system, e.g. al_install_system_none or w/e.

I don't exactly know what is involved in this system none though, so somebody else needs to implement it. In particular, Allegro uses TLS pretty heavily inside pretty much everywhere, and that pthread crash might be TLS related. It might end up being a lot of work.

Thread #616413. Printed from Allegro.cc