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

Replace boolean flags on Texture::from_image with TextureSettings struct #53

Open
bvssvni opened this issue Apr 19, 2015 · 7 comments
Open
Assignees
Labels

Comments

@bvssvni
Copy link
Member

bvssvni commented Apr 19, 2015

Passing multiple boolean flags is bad API design. This should be replaced with a struct so the code is self documenting.

@Potpourri
Copy link
Member

I agree, but force_alpha and flip_vertical is unnecessary in Texture::from_image.

@bvssvni
Copy link
Member Author

bvssvni commented Apr 19, 2015

@Potpourri Ah, there is a Settings struct already!

@bvssvni
Copy link
Member Author

bvssvni commented Apr 19, 2015

Maybe we should redesign Settings a bit. The members could be private it could use builder methods with defaults.

@Potpourri
Copy link
Member

Yeah, I think builder is single right solution.

@kvark
Copy link
Member

kvark commented Apr 19, 2015

👍

@kvark
Copy link
Member

kvark commented Apr 19, 2015

Alternatively, move the flipping call into from_image.

@bvssvni bvssvni self-assigned this Jun 20, 2015
@bvssvni
Copy link
Member Author

bvssvni commented Jun 20, 2015

I'll remove Settings::force_alpha since it is not implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants