Skip to content
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

Try to clean up asset folders for sample apps. #128

Merged
merged 2 commits into from
Aug 23, 2018
Merged

Try to clean up asset folders for sample apps. #128

merged 2 commits into from
Aug 23, 2018

Conversation

prideout
Copy link
Contributor

This removes the build step where we copy a subset of assets, and makes
it so that FilamentApp hands out a "root path" for assets. For now this
is determined based on the location of the executable. This allows
developers to launch samples from any CWD.

Closes #11

This removes the build step where we copy a subset of assets, and makes
it so that FilamentApp hands out a "root path" for assets. For now this
is determined based on the location of the executable. This allows
developers to launch samples from any CWD.

Closes #11
// Returns the path to the Filament root for loading assets. For now this is determined by
// looking up from the executable folder, which allows users to launch samples from any folder.
static const utils::Path& getRootPath() {
static const utils::Path root = utils::Path::getCurrentExecutable().getAncestor(3);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This assumes we always run samples from out/xxx/samples. This will break if someone builds manually with cmake or if we distribute the samples in a zip file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, and we were already making this assumption in some places, this merely consolidates the badness.

Maybe I should add back the asset-copying stuff to CMake, which would allow me to replace getAncestor with getParent...

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's the best solution.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@prideout prideout merged commit 099738e into master Aug 23, 2018
@prideout prideout deleted the pr/assets branch August 23, 2018 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants