pub unsafe fn create_renderer<'win>(
    &'win self, driver_index: Option<usize>, flags: RendererFlags,
  ) -> Result<Renderer<'sdl, 'win>, String> {
    let index = driver_index.map(|u| u as i32).unwrap_or(-1);
    let ptr = SDL_CreateRenderer(self.ptr, index, flags.0 as u32);
    if ptr.is_null() {
      Err(get_error())
    } else {
      Ok(Renderer {
        ptr,
        _marker: PhantomData,
      })
    }
  }
/// Makes a renderer for the window.
///
/// # Safety
///
/// * Each renderer must only be used with its own window
/// * Each renderer must only be used with textures that it created
///
/// If you only have a single renderer then this is trivially proved, if you
/// make more than one renderer it's up to you to verify this.
Makes a renderer for the window.
Makes a renderer for the window .
pub unsafe fn create_renderer<'win>(
    &'win self, driver_index: Option<usize>, flags: RendererFlags,
  ) -> Result<Renderer<'sdl, 'win>, String> {
    let index = driver_index.map(|u| u as i32).unwrap_or(-1);
    let ptr = SDL_CreateRenderer(self.ptr, index, flags.0 as u32);
    if ptr.is_null() {
      Err(get_error())
    } else {
      Ok(Renderer {
        ptr,
        _marker: PhantomData,
      })
    }
  }
pub unsafe fn create_renderer < ' win > ( & ' win self , driver_index : Option < usize > , flags : RendererFlags , ) -> Result < Renderer < ' sdl , ' win > , String > { let index = driver_index . map ( | u | u as i32 ) . unwrap_or ( - 1 ) ; let ptr = SDL_CreateRenderer ( self . ptr , index , flags . 0 as u32 ) ; if ptr . is_null ( ) { Err ( get_error ( ) ) } else { Ok ( Renderer { ptr , _marker : PhantomData , } ) } }
Makes a renderer for the window.
Makes a renderer for the window .
&'win self
driver_index
Option<usize>
flags
RendererFlags
&'win self
driver_index
Option<usize>
flags
RendererFlags
safety
Each renderer must only be used with its own window
Each renderer must only be used with textures that it created

If you only have a single renderer then this is trivially proved, if you
make more than one renderer it's up to you to verify this.
Each renderer must only be used with its own window Each renderer must only be used with textures that it created If you only have a single renderer then this is trivially proved if you make more than one renderer it ' s up to you to verify this .