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

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

A texture for a rendering context.

Every Texture is owned by a TextureCreator. Internally, a texture is destroyed via its Drop implementation. A texture can only be used by the Canvas it was originally created from, it is undefined behavior otherwise.

Methods

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

[src]

Queries the attributes of the texture.

[src]

Sets an additional color value multiplied into render copy operations.

[src]

Gets the additional color value multiplied into render copy operations.

[src]

Sets an additional alpha value multiplied into render copy operations.

[src]

Gets the additional alpha value multiplied into render copy operations.

[src]

Sets the blend mode used for drawing operations (Fill and Line).

[src]

Gets the blend mode used for texture copy operations.

[src]

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.

[src]

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

[src]

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.

[src]

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

[src]

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

[src]

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

[src]

Trait Implementations

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

[src]

Executes the destructor for this type. Read more