Struct rich_sdl2_rust::renderer::Renderer
source · pub struct Renderer<'window> { /* private fields */ }
Expand description
A SDL2 renderer. This is often used for rendering with pen::Pen
.
Implementations§
source§impl<'window> Renderer<'window>
impl<'window> Renderer<'window>
sourcepub fn output_size(&self) -> Result<Size>
pub fn output_size(&self) -> Result<Size>
Returns the geometry size of the output from the renderer.
sourcepub fn clip(&'window mut self, area: Rect) -> ClippedRenderer<'window>
pub fn clip(&'window mut self, area: Rect) -> ClippedRenderer<'window>
Clips the renderer by area
.
sourcepub fn logical_size(&self) -> Option<Size>
pub fn logical_size(&self) -> Option<Size>
Returns the logical size of the renderer if available.
sourcepub fn set_logical_size(&self, _: Size)
pub fn set_logical_size(&self, _: Size)
Sets the logical size of the renderer.
sourcepub fn is_forced_integer_scale(&self) -> bool
pub fn is_forced_integer_scale(&self) -> bool
Returns whether integer scaled is forced.
sourcepub fn force_integer_scale(&self, enabled: bool)
pub fn force_integer_scale(&self, enabled: bool)
Sets whether integer scaled is forced.
sourcepub fn set_viewport(&self, area: Option<Rect>)
pub fn set_viewport(&self, area: Option<Rect>)
Sets the viewport rectangle of the renderer.
sourcepub fn set_target<'texture: 'window>(
&'window self,
texture: &'texture Texture<'_>
)
pub fn set_target<'texture: 'window>( &'window self, texture: &'texture Texture<'_> )
Sets the render target to the texture.
sourcepub fn set_target_default(&self)
pub fn set_target_default(&self)
Resets the render target to the original window.
Trait Implementations§
source§impl<'window> RendererInfoExt for Renderer<'window>
impl<'window> RendererInfoExt for Renderer<'window>
source§fn renderer_info(&self) -> RendererInfo
fn renderer_info(&self) -> RendererInfo
Returns the information of the renderer.
Auto Trait Implementations§
impl<'window> !RefUnwindSafe for Renderer<'window>
impl<'window> !Send for Renderer<'window>
impl<'window> !Sync for Renderer<'window>
impl<'window> Unpin for Renderer<'window>
impl<'window> !UnwindSafe for Renderer<'window>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more