pub struct Texture<'renderer> { /* private fields */ }
Expand description

A texture used to draw the image to Renderer.

Implementations§

Constructs a texture from the renderer with access type.

Errors

Returns Err if failed to allocate, no rendering context was active, the format was unsupported, or the width or height were out of range.

Constructs a texture from the Surface. The texture will be readonly and the access type will be TextureAccess::Static.

Returns the alpha mod of the texture.

Sets the alpha mod of the texture.

Errors

Returns Err if setting the alpha mod is unsupported.

Panics

Panics if some unrecoverable error is occurred.

Returns the color mod of the texture.

Sets the color mod of the texture.

Obtains the lock for the texture in area, or whole if None.

Return the clip area of the texture if available.

Sets the clip area.

Binds the texture to the current OpenGL context. And returns the size in the context.

Errors

Returns Err if failed to bind the texture.

Unbinds the texture to the current OpenGL context.

Errors

Returns Err if failed to unbind the texture.

Trait Implementations§

Formats the value using the given formatter. Read more
Executes the destructor for this type. Read more
Returns the format of the texture.
Returns the access of the texture.
Returns the size of the texture.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.