Struct sdl2::render::CanvasBuilder
source · [−]pub struct CanvasBuilder { /* private fields */ }
Expand description
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.
Implementations
sourceimpl CanvasBuilder
impl CanvasBuilder
sourcepub fn new(window: Window) -> CanvasBuilder
pub fn new(window: Window) -> CanvasBuilder
Initializes a new CanvasBuilder
.
sourcepub fn build(self) -> Result<WindowCanvas, IntegerOrSdlError>
pub fn build(self) -> Result<WindowCanvas, IntegerOrSdlError>
Builds the renderer.
sourcepub fn index(self, index: u32) -> CanvasBuilder
pub fn index(self, index: u32) -> CanvasBuilder
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.
sourcepub fn software(self) -> CanvasBuilder
pub fn software(self) -> CanvasBuilder
Set the renderer to a software fallback. This flag is accumulative, and may be specified with other flags.
sourcepub fn accelerated(self) -> CanvasBuilder
pub fn accelerated(self) -> CanvasBuilder
Set the renderer to use hardware acceleration. This flag is accumulative, and may be specified with other flags.
sourcepub fn present_vsync(self) -> CanvasBuilder
pub fn present_vsync(self) -> CanvasBuilder
Synchronize renderer present
method calls with the refresh rate.
This flag is accumulative, and may be specified with other flags.
sourcepub fn target_texture(self) -> CanvasBuilder
pub fn target_texture(self) -> CanvasBuilder
Set the renderer to support rendering to a texture. This flag is accumulative, and may be specified with other flags.
Trait Implementations
sourceimpl From<Window> for CanvasBuilder
impl From<Window> for CanvasBuilder
sourcefn from(window: Window) -> CanvasBuilder
fn from(window: Window) -> CanvasBuilder
Converts to this type from the input type.
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more