[−][src]Struct sdl2::render::CanvasBuilder
The type that allows you to build Window-based renderers.
By default, the renderer builder will prioritize for a hardware-accelerated renderer, which is probably what you want.
Methods
impl CanvasBuilder
[src]
pub fn new(window: Window) -> CanvasBuilder
[src]
Initializes a new CanvasBuilder
.
pub fn build(self) -> Result<WindowCanvas, IntegerOrSdlError>
[src]
Builds the renderer.
pub fn index(self, index: u32) -> CanvasBuilder
[src]
Sets the index of the rendering driver to initialize.
If you desire the first rendering driver to support the flags provided,
or if you're translating code from C which passes -1 for the index,
do not invoke the index
method.
pub fn software(self) -> CanvasBuilder
[src]
Set the renderer to a software fallback. This flag is accumulative, and may be specified with other flags.
pub fn accelerated(self) -> CanvasBuilder
[src]
Set the renderer to use hardware acceleration. This flag is accumulative, and may be specified with other flags.
pub fn present_vsync(self) -> CanvasBuilder
[src]
Synchronize renderer present
method calls with the refresh rate.
This flag is accumulative, and may be specified with other flags.
pub fn target_texture(self) -> CanvasBuilder
[src]
Set the renderer to support rendering to a texture. This flag is accumulative, and may be specified with other flags.
Trait Implementations
impl From<Window> for CanvasBuilder
[src]
fn from(window: Window) -> CanvasBuilder
[src]
Auto Trait Implementations
impl !RefUnwindSafe for CanvasBuilder
impl !Send for CanvasBuilder
impl !Sync for CanvasBuilder
impl Unpin for CanvasBuilder
impl !UnwindSafe for CanvasBuilder
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
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> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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>,