pub fn create_window<'sdl>(
    &'sdl self, title: &str, x: i32, y: i32, w: i32, h: i32, flags: WindowFlags,
  ) -> Result<Window<'sdl>, String> {
    let title_null: Vec<u8> = title.bytes().chain(Some(0)).collect();
    let ptr = unsafe {
      SDL_CreateWindow(
        title_null.as_ptr() as *const c_char,
        x,
        y,
        w,
        h,
        flags.0 as u32,
      )
    };
    if ptr.is_null() {
      Err(get_error())
    } else {
      Ok(crate::window::Window {
        ptr,
        _marker: PhantomData,
      })
    }
  }
/// Creates a new window, or gives an error message.
///
/// Note that not all possible flags have an effect! See [the
/// wiki](https://wiki.libsdl.org/SDL_CreateWindow) for guidance.
Creates a new window, or gives an error message.
Note that not all possible flags have an effect. See [the
wiki] for guidance.
Creates a new window or gives an error message . Note that not all possible flags have an effect . See [ the wiki ] for guidance .
pub fn create_window<'sdl>(
    &'sdl self, title: &str, x: i32, y: i32, w: i32, h: i32, flags: WindowFlags,
  ) -> Result<Window<'sdl>, String> {
    let title_null: Vec<u8> = title.bytes().chain(Some(0)).collect();
    let ptr = unsafe {
      SDL_CreateWindow(
        title_null.as_ptr() as *const c_char,
        x,
        y,
        w,
        h,
        flags.0 as u32,
      )
    };
    if ptr.is_null() {
      Err(get_error())
    } else {
      Ok(crate::window::Window {
        ptr,
        _marker: PhantomData,
      })
    }
  }
pub fn create_window < ' sdl > ( & ' sdl self , title : & str , x : i32 , y : i32 , w : i32 , h : i32 , flags : WindowFlags , ) -> Result < Window < ' sdl > , String > { let title_null : Vec < u8 > = title . bytes ( ) . chain ( Some ( 0 ) ) . collect ( ) ; let ptr = unsafe { SDL_CreateWindow ( title_null . as_ptr ( ) as * const c_char , x , y , w , h , flags . 0 as u32 , ) } ; if ptr . is_null ( ) { Err ( get_error ( ) ) } else { Ok ( crate :: window :: Window { ptr , _marker : PhantomData , } ) } }
Creates a new window, or gives an error message.
Creates a new window or gives an error message .
&'sdl self
title
&str
x
i32
y
i32
w
i32
h
i32
flags
WindowFlags
&'sdl self
title
&str
x
i32
y
i32
w
i32
h
i32
flags
WindowFlags