[−][src]Struct sfml::graphics::RenderTexture
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]
fn size(&self) -> Vector2u
[src]
fn clear(&mut self, color: Color)
[src]
fn set_view(&mut self, view: &View)
[src]
fn view(&self) -> &View
[src]
fn default_view(&self) -> &View
[src]
fn viewport(&self, view: &View) -> IntRect
[src]
fn map_pixel_to_coords(&self, point: Vector2i, view: &View) -> Vector2f
[src]
fn map_pixel_to_coords_current_view(&self, point: Vector2i) -> Vector2f
[src]
fn map_coords_to_pixel(&self, point: Vector2f, view: &View) -> Vector2i
[src]
fn map_coords_to_pixel_current_view(&self, point: Vector2f) -> Vector2i
[src]
fn draw(&mut self, object: &dyn Drawable)
[src]
fn draw_with_renderstates(
&mut self,
object: &dyn Drawable,
render_states: RenderStates
)
[src]
&mut self,
object: &dyn Drawable,
render_states: RenderStates
)
fn draw_text(&self, text: &Text, rs: RenderStates)
[src]
fn draw_shape(&self, shape: &CustomShape, rs: RenderStates)
[src]
fn draw_sprite(&self, sprite: &Sprite, rs: RenderStates)
[src]
fn draw_circle_shape(&self, circle_shape: &CircleShape, rs: RenderStates)
[src]
fn draw_rectangle_shape(
&self,
rectangle_shape: &RectangleShape,
rs: RenderStates
)
[src]
&self,
rectangle_shape: &RectangleShape,
rs: RenderStates
)
fn draw_convex_shape(&self, convex_shape: &ConvexShape, rs: RenderStates)
[src]
fn draw_vertex_array(&self, vertex_array: &VertexArray, rs: RenderStates)
[src]
fn draw_primitives(
&self,
vertices: &[Vertex],
ty: PrimitiveType,
rs: RenderStates
)
[src]
&self,
vertices: &[Vertex],
ty: PrimitiveType,
rs: RenderStates
)
fn push_gl_states(&mut self)
[src]
fn pop_gl_states(&mut self)
[src]
fn reset_gl_states(&mut self)
[src]
impl Drop for RenderTexture
[src]
impl Debug for RenderTexture
[src]
Auto Trait Implementations
impl !Send for RenderTexture
impl !Sync for RenderTexture
impl Unpin for RenderTexture
impl UnwindSafe for RenderTexture
impl RefUnwindSafe for RenderTexture
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,