[][src]Struct sfml::graphics::RenderTexture

pub struct RenderTexture { /* fields omitted */ }

Target for off-screen 2D rendering into a texture

Methods

impl RenderTexture[src]

pub fn new(width: u32, height: u32, depth_buffer: bool) -> Option<RenderTexture>[src]

Construct a new render texture

Arguments

  • width - Width of the render texture
  • height - Height of the render texture
  • depthBuffer - Do you want a depth-buffer attached? (useful only if you're doing 3D OpenGL on the rendertexture)

Return Some(RenderTexture) or None

pub fn display(&self)[src]

Update the contents of the target texture

pub fn set_active(&mut self, active: bool) -> bool[src]

Activate or deactivate a render texture as the current target for rendering

Arguments

  • active - true to activate, false to deactivate

pub fn texture(&self) -> &Texture[src]

Get the target texture of a render texture

Return the target texture

pub fn set_smooth(&mut self, smooth: bool)[src]

Enable or disable the smooth filter on a render texture

Arguments

  • smooth - true to enable smoothing, false to disable it

pub fn is_smooth(&self) -> bool[src]

Tell whether the smooth filter is enabled or not for a render texture

Return true if smoothing is enabled, false if it is disabled

pub fn set_repeated(&mut self, repeated: bool)[src]

Enable or disable texture repeating.

This function is similar to Texture::setRepeated. This parameter is disabled by default.

pub fn is_repeated(&self) -> bool[src]

Tell whether the texture is repeated or not.

pub unsafe fn generate_mipmap(&mut self) -> bool[src]

Generate a mipmap using the current texture data.

This function is similar to Texture::generate_mipmap and operates on the texture used as the target for drawing.

Safety

Be aware that any draw operation may modify the base level image data. For this reason, calling this function only makes sense after all drawing is completed and display has been called. Not calling display after subsequent drawing will lead to undefined behavior if a mipmap had been previously generated.

Trait Implementations

impl RenderTarget for RenderTexture[src]

impl Drop for RenderTexture[src]

impl Debug for RenderTexture[src]

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]