Struct radiant_rs::Texture[][src]

pub struct Texture { /* fields omitted */ }

A texture to draw or draw to.

Textures serve as drawing targets for userdefined Postprocessors or custom Programs. A texture can also be drawn with Renderer::rect().

Methods

impl Texture
[src]

Returns a texture builder for texture construction.

Examples

let tex = Texture::builder(&rendercontext)
                    .dimensions((640, 480))
                    .magnify(TextureFilter::Nearest)
                    .minify(TextureFilter::Linear)
                    .build()
                    .unwrap();

Creates a new texture with given dimensions. The texture will use linear interpolation for magnification or minification and internally use the F16F16F16F16 format.

Creates a new texture from given file.

Creates a new texture with given dimensions and filters. It will internally use the F16F16F16F16 format.

Clones texture with new filters and wrapping function. Both source and clone reference the same texture data.

Clears the texture with given color.

Returns the dimensions of the texture.

Trait Implementations

impl Clone for Texture
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Texture
[src]

Formats the value using the given formatter. Read more

impl AsRenderTarget for Texture
[src]

Returns a RenderTarget representing a texture or a frame.

impl AsUniform for Texture
[src]

Auto Trait Implementations

impl !Send for Texture

impl !Sync for Texture