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]
impl Texture
pub fn builder(context: &RenderContext) -> TextureBuilder
[src]
pub fn builder(context: &RenderContext) -> TextureBuilder
Returns a texture builder for texture construction.
Examples
let tex = Texture::builder(&rendercontext) .dimensions((640, 480)) .magnify(TextureFilter::Nearest) .minify(TextureFilter::Linear) .build() .unwrap();
pub fn new(context: &RenderContext, width: u32, height: u32) -> Self
[src]
pub 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.
pub fn from_file(context: &RenderContext, file: &str) -> Result<Self>
[src]
pub fn from_file(context: &RenderContext, file: &str) -> Result<Self>
Creates a new texture from given file.
pub fn filtered(
context: &RenderContext,
width: u32,
height: u32,
minify: TextureFilter,
magnify: TextureFilter
) -> Self
[src]
pub fn filtered(
context: &RenderContext,
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.
pub fn clone_with_options(
&self,
minify: TextureFilter,
magnify: TextureFilter,
wrap: TextureWrap
) -> Self
[src]
pub fn clone_with_options(
&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.
pub fn clear(&self, color: Color)
[src]
pub fn clear(&self, color: Color)
Clears the texture with given color.
pub fn dimensions(&self) -> (u32, u32)
[src]
pub fn dimensions(&self) -> (u32, u32)
Returns the dimensions of the texture.
Trait Implementations
impl Clone for Texture
[src]
impl Clone for Texture
fn clone(&self) -> Texture
[src]
fn clone(&self) -> Texture
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Debug for Texture
[src]
impl Debug for Texture
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl AsRenderTarget for Texture
[src]
impl AsRenderTarget for Texture
fn as_render_target(&self) -> RenderTarget
[src]
fn as_render_target(&self) -> RenderTarget
Returns a RenderTarget representing a texture or a frame.
impl AsUniform for Texture
[src]
impl AsUniform for Texture
fn as_uniform(&self) -> Uniform
[src]
fn as_uniform(&self) -> Uniform