Struct sdl2::render::Texture [] [src]

pub struct Texture<'r> { /* fields omitted */ }

A texture for a rendering context.

Every Texture is owned by a TextureCreator. A Texture cannot outlive the TextureCreator

A Texture can be safely accessed after the Canvas is dropped.

Methods

impl<'r> Texture<'r>
[src]

Queries the attributes of the texture.

Sets an additional color value multiplied into render copy operations.

Gets the additional color value multiplied into render copy operations.

Sets an additional alpha value multiplied into render copy operations.

Gets the additional alpha value multiplied into render copy operations.

Sets the blend mode for a texture, used by Renderer::copy().

Gets the blend mode used for texture copy operations.

Updates the given texture rectangle with new pixel data.

pitch is the number of bytes in a row of pixel data, including padding between lines

  • If rect is None, the entire texture is updated.

Updates a rectangle within a planar YV12 or IYUV texture with new pixel data.

Locks the texture for write-only pixel access. The texture must have been created with streaming access.

F is a function that is passed the write-only texture buffer, and the pitch of the texture (size of a row in bytes).

Remarks

As an optimization, the pixels made available for editing don't necessarily contain the old texture data. This is a write-only operation, and if you need to keep a copy of the texture data you should do that at the application level.

Binds an OpenGL/ES/ES2 texture to the current context for use with when rendering OpenGL primitives directly.

Unbinds an OpenGL/ES/ES2 texture from the current context.

Binds and unbinds an OpenGL/ES/ES2 texture from the current context.

Trait Implementations

impl<'r> Drop for Texture<'r>
[src]

A method called when the value goes out of scope. Read more