I am using Allegro 5 library. I want to load font from dat file. In Allegro’s previous versions, there is useful methods for this. For example “load_datafile”, load_dat_font. How can I do this in Allegro 5?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The closest direct thing Allegro 5 has is the physfs addon. Useful links:
http://www.allegro.cc/manual/5/physfs.html
http://icculus.org/physfs/
With it you can load (for example) a Zip archive as a folder. So instead of using a datafile, you can use a Zip file.
See the manual for an example. In short, it looks like:
Then future calls to
al_load_bitmap()(etc) will look inside that zip file.If you want to do anything other than that, you will need to write your own custom file interface. It’s not terribly difficult, but I think you might as well use a Zip file.