-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed relative paths of asset loading examples. #28
base: devel
Are you sure you want to change the base?
Conversation
Looks good to me. Any one with more experience handling external files want to comment? |
Here's my 2c: The ideal would be to have a notion of multiple 'search In UNIX systems there is getcwd() and there is the application path in Could be something like this: al::SearchPaths::init(argc, argv); // tries parsing argv[0], getcwd(), and std::string path = al::SearchPaths::find("image.jpg"); // tries each path And to add a searchpath: al::SearchPaths::add(...); It would be super nice if the search could handle subfolders, e.g.: std::string path = al::SearchPaths::find("resources/image.jpg"); (It should also be smart and detect absolute paths starting with a slash) On Apr 4, 2014, at 6:56 AM, Andres Cabrera [email protected] wrote:
|
I think the handling of external files will depend heavily on the context. If it's just an example or build-and-run app meant to run locally, then it Another situation is deploying an app. Here we want resources to live http://stackoverflow.com/questions/1023306/finding-current-executables-path-without-proc-self-exe Lance On Thu, Apr 3, 2014 at 11:56 PM, Andres Cabrera [email protected]:
|
It doesn't address the topics at hand, but I have some linux code to find the directory a binary is in.
|
f4ec4dc
to
3f25abe
Compare
3f25abe
to
717ce26
Compare
717ce26
to
4856e9d
Compare
@matthewjameswright recently helped a student with al::SearchPaths and might have some thoughts. |
I give starter code to load an image...
...or a sound file: gam::SamplePlayer<> samplePlayer; AlloApp() { On Nov 11, 2014, at 2:52 AM, Drew Waranis [email protected] wrote:
|
4856e9d
to
bc65410
Compare
This is very useful I think examples should be updated to use this. I On Tue, Nov 11, 2014 at 12:12 PM, Matt Wright [email protected]
|
67dfa81
to
fbcbca5
Compare
Updated the paths in these examples to be relative to the root AlloSystem directory, which run.sh is required to be run from.
This suggests a possible update to run.sh: querying run.sh's absolute path and then using that as the basis for all other paths would allow the script it to be run from any pwd.