SFML community forums
Help => General => Topic started by: SamuraiCrow on July 28, 2010, 06:24:30 pm
-
Hello,
I'm working on a cross-platform app using SFML 1.6. I'm currently using XCode 3.1.4 under MacOSX 10.5.8. I'd like to maintain a separate path for each platfrom to load its files from. Mac seems to be the only one that uses relative path for its resources in an app bundle. For now I've been using absolute paths to where my resources can be stored but that won't work in production code.
Here's how it's defined:
#ifndef __SYSTEM_SPECIFIC_H__
# define __SYSTEM_SPECIFIC_H__
# include <SFML/Config.hpp>
# ifdef SFML_SYSTEM_MACOS
# define RESOURCEPATH "../Resources/"
//# define RESOURCEPATH "/Users/samuraicrow/Documents/EventideCode/"
# else
# ifdef SFML_SYSTEM_LINUX
# define RESOURCEPATH "/usr/share/games/eventide/"
# else
# define RESOURCEPATH "Resources/"
# endif
# endif
#endif
-
Mac isn't the single operating system that works with relative paths. Why don't you put the files inside the application directory (or a subdirectory)? It should be possible to use the same (relative) path for every platform.
-
# define RESOURCEPATH "../Resources/"
Note that with SFML, the current working directory is always set to the Resources folder of the bundle application. Thus using [...]/Resources/../Resources points to... the Resources directory, as an empty string would.
-
I found the problem. I was still running an old version of SFML because I had dragged the frameworks to the wrong frameworks folder.