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

Implement ImageSize on gfx::TextureHandle #25

Closed
bvssvni opened this issue Feb 17, 2015 · 4 comments
Closed

Implement ImageSize on gfx::TextureHandle #25

bvssvni opened this issue Feb 17, 2015 · 4 comments

Comments

@bvssvni
Copy link
Member

bvssvni commented Feb 17, 2015

See #24

It might be possible to hack around this by:

  1. Add a Size property to this crate, use piston-quack to implement it for gfx::TextureHandle
  2. Add an auto impl with a where clause for ImageSize using the Size property.

If this works, then the compiles should allow 1) because the tuple (Size, gfx::TextureHandle) is owned by this crate, and 2) because where clauses can be used as refinements of impls.

@bvssvni
Copy link
Member Author

bvssvni commented Feb 17, 2015

It might be this doesn't work because ImageSize and T is not owned by this crate, and refinements are ignored.

@bvssvni
Copy link
Member Author

bvssvni commented Feb 17, 2015

Confirmed. This does not work.

@bvssvni bvssvni closed this as completed Feb 17, 2015
@kvark
Copy link
Member

kvark commented Feb 17, 2015

Perhaps, this is for the better. We could return more info from image loading than just a texture handle. For example, a flag saying that the image had alpha in it. Or the number of bits per component.

Edit: actually, all this info is available through gfx::TextureHandle, so it would be nice to return it, after all...

@bvssvni
Copy link
Member Author

bvssvni commented Feb 17, 2015

@kvark There is one alternative, where Gfx depends on piston-texture and implements ImageSize. https://github.com/PistonDevelopers/texture Not sure if that's the right thing, though.

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

No branches or pull requests

2 participants