Struct lux::graphics::Texture
[−]
[src]
pub struct Texture {
// some fields omitted
}An owned texture on the hardware.
Methods
impl Texture
fn empty<D: HasDisplay>(d: &D, width: u32, height: u32) -> Result<Texture, LuxError>
Creates an empty texture with a given width and height.
Depending on the graphics card, the width and height might need to be powers of two.
fn to_sprite(self) -> Sprite
Converts this texture into a Sprite.
fn as_drawable<'a, D>(&'a mut self, d: &'a D) -> DrawableTexture<'a, D> where D: HasDisplay + HasPrograms
Returns a reference to this texture with a drawable context.