Struct sdl2::render::CanvasBuilder
[−]
[src]
pub struct CanvasBuilder { /* fields omitted */ }
The type that allows you to build Window-based renderers.
By default, the renderer builder will prioritize for a hardware-accelerated renderer, which is porbably what you want.
Methods
impl CanvasBuilder
[src]
fn new(window: Window) -> CanvasBuilder
Initializes a new CanvasBuilder
.
fn build(self) -> Result<WindowCanvas, IntegerOrSdlError>
Builds the renderer.
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.
fn software(self) -> CanvasBuilder
Set the renderer to a software fallback. This flag is accumulative, and may be specified with other flags.
fn accelerated(self) -> CanvasBuilder
Set the renderer to use hardware acceleration. This flag is accumulative, and may be specified with other flags.
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.
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
impl From<Window> for CanvasBuilder
[src]
fn from(window: Window) -> CanvasBuilder
Performs the conversion.