Helpful Information
 
 
Category: Mac Help
Mac and Allegro

So I have been working on this program using the allegro library, with Project Builder, and I love it so far.

My problem is, that when I have a bmp as a resource and have it all imported and when I reference it like "object.bmp" passing it to the load_bitmap function, it doesn't work.

When I include the absolute path in a string, such as "~/Users/Name/object.bmp" it will load it. But my problem is that if I ever want to distribute this program, It will have to be installed in a certain directory.

So my question is, How do I change the path to resources in Project Builder? or Has anyone else had this problem and figured it our?

I've never used Allegro, however in standard Mac Applications resources are usually stored inside the Application bundle in a special directory called Resources. This would probably be the best place to put the image(s) in question, if not then you should probably put your resources in "~/Library/" or "/Library/Application Support/".

The second path is probably what you're looking for since the first is stored in the users local Library. This is a good place to store user specific resources i.e. Safari stores a users bookmarks in "~/Library/Safari/Bookmarks.plist". This directory is also where Cocoa applications store the users preferences. Take a look in "~/Library/Preferences/" and you'll see what I mean :).

As I mentioned though, I haven't used Allegro so some of this info may not be relevant :D.

Hope this helps,

Mark.










privacy (GDPR)