I figured it out. What a pain.
Remember to build your project with the CoreFoundation framework and to include "CoreFoundation/CoreFoundation.h".
CFBundleRef mainBundle = CFBundleGetMainBundle();
CFURLRef resourcesURL = CFBundleCopyResourcesDirectoryURL(mainBundle);
char path[512];
if (!CFURLGetFileSystemRepresentation(resourcesURL, TRUE, (UInt8*)path, 512))
{
// error!
}
CFRelease(resourcesURL);
strncat(path, "/geometos.ttf", 512); // The final path
I know that this is a Mac OSX specific solution, only when developing .app bundles, but there should be some sort of reference to this in the SFML docs. I'm not talking about an explanation, because there is enough documentation through Apple, but this would have been a lot easier for me to figure out it the tutorials told me "When developing a .app bundle, the working directory will have to be determined pragmatically.", and then a link to the App Bundle Reference.