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::draw_rect()
.
Methods
impl Texture
[src]
fn new(context: &RenderContext, width: u32, height: u32) -> Self
Creates a new texture with given dimensions. The texture will use linear interpolation
for magnification or minification and internally use the F16F16F16F16
format.
fn filtered(context: &RenderContext,
width: u32,
height: u32,
minify: TextureFilter,
magnify: TextureFilter)
-> Self
width: u32,
height: u32,
minify: TextureFilter,
magnify: TextureFilter)
-> Self
Creates a new texture with given dimensions and filters. It will internally use the F16F16F16F16
format.
fn from_info(context: &RenderContext, info: TextureInfo) -> Self
Creates a new texture from given TextureInfo struct.
fn clone_with_options(&self,
minify: TextureFilter,
magnify: TextureFilter,
wrap: TextureWrap)
-> Self
minify: TextureFilter,
magnify: TextureFilter,
wrap: TextureWrap)
-> Self
Clones texture with new filters and wrapping function. Both source and clone reference the same texture data.
fn clear(&self, color: Color)
Clears the texture with given color.
Trait Implementations
impl Clone for Texture
[src]
fn clone(&self) -> Texture
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more