pub fn begin_render<'a>(&'a self) -> Result<impl RenderContext + 'a> {
        let encoder = self.renderer.wgpu_device().with_device_info(|info| {
            Ok(info
                .device
                .create_command_encoder(&wgpu::CommandEncoderDescriptor { label: None }))
        })?;
        BufferedRenderer::new(self, encoder)
    }
/// Get a render context for the current swap chain frame.
///
/// # Example
///
/// ```no_run
/// # use riddle::{common::Color, platform::*, renderer::*, math::*, *};
/// # fn main() -> Result<(), RiddleError> {
/// # let rdl =  RiddleLib::new()?;
/// # let window = WindowBuilder::new().build(rdl.context())?;
/// # let renderer = Renderer::new_from_window(&window)?;
/// let target = SpriteRenderTarget::new(&renderer, vec2(100, 100))?;
///
/// let mut target_ctx = target.begin_render()?;
/// target_ctx.clear(Color::RED);
/// target_ctx.present();
/// # Ok(()) }
/// ```
Get a render context for the current swap chain frame.
Get a render context for the current swap chain frame .
pub fn begin_render<'a>(&'a self) -> Result<impl RenderContext + 'a> {
        let encoder = self.renderer.wgpu_device().with_device_info(|info| {
            Ok(info
                .device
                .create_command_encoder(&wgpu::CommandEncoderDescriptor { label: None }))
        })?;
        BufferedRenderer::new(self, encoder)
    }
pub fn begin_render < ' a > ( & ' a self ) -> Result < impl RenderContext + ' a > { let encoder = self . renderer . wgpu_device ( ) . with_device_info ( | info | { Ok ( info . device . create_command_encoder ( & wgpu :: CommandEncoderDescriptor { label : None } ) ) } ) ? ; BufferedRenderer :: new ( self , encoder ) }
Get a render context for the current swap chain frame.
Get a render context for the current swap chain frame .
&'a self
&'a self
example
None
use riddle::{common::color, platform::*, renderer::*, math::*, *};
None
fn main() -> result<(), riddleerror> {
None
let rdl =  riddlelib::new()?;
None
let window = windowbuilder::new().build(rdl.context())?;
None
let renderer = renderer::new_from_window(&window)?;
let target = SpriteRenderTarget::new(&renderer, vec2(100, 100))?.

let mut target_ctx = target.begin_render()?;
target_ctx.clear(Color::RED);
target_ctx.present().
let target = SpriteRenderTarget :: new ( &renderer vec2 ( 100 100 )) ? . let mut target_ctx = target . begin_render () ? ; target_ctx . clear ( Color :: RED ) ; target_ctx . present () .
ok(()) }
None