Re: [AD] Additions for al_get_path() (was Re: Allegro 5 TODOs (from wiki))

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


> Windows doesn't seem to have the equivalent of a "settings" directory,
> probably because settings are supposed to go into the registry - which
> I'm guessing isn't addressable as a filesystem.
>
Both Windows XP and Vista have application folders and user data
folders that can be queried. Is this part of the Allegro API
documented somewhere? I was looking for them when creating the hiscore
file for the a5 version of Speed but couldn't find it.

Basically, the most helpful way is for it to work like:

al_set_path_app_name("Speed"); // implicitly creates the app data
folder if it doesn't exist.

al_get_system_folder(ALLEGRO_APP_DATA_PATH);

On Vista, it might return:

c:\users\All Users\Application Data\Speed\

al_get_system_filename(ALLEGRO_APP_DATA_PATH, "hiscores");

c:\users\All Users\Application Data\Speed\hiscores

al_get_system_filename(ALLEGRO_USER_DATA_PATH, "hiscores");

c:\users\Matthew\Application Data\Speed\hiscores

--
Matthew Leverton




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/