pub fn from_window(window: Window<'sdl>) -> Result<Self, String> {
    unsafe {
      let context: GLContext = window.gl_create_context()?;
      let ctx: beryllium::unsafe_raw_ffi::SDL_GLContext = core::mem::transmute(context);
      let win_ptr: *mut beryllium::unsafe_raw_ffi::SDL_Window = core::mem::transmute(window);
      Ok(Self {
        win_ptr,
        ctx,
        _marker: PhantomData,
      })
    }
  }
/// Given just a window, creates a context and returns a backend.
///
/// You have to have set the correct variables ahead of time so that the
/// correct context is created.
Given just a window, creates a context and returns a backend.
You have to have set the correct variables ahead of time so that the
correct context is created.
Given just a window creates a context and returns a backend . You have to have set the correct variables ahead of time so that the correct context is created .
pub fn from_window(window: Window<'sdl>) -> Result<Self, String> {
    unsafe {
      let context: GLContext = window.gl_create_context()?;
      let ctx: beryllium::unsafe_raw_ffi::SDL_GLContext = core::mem::transmute(context);
      let win_ptr: *mut beryllium::unsafe_raw_ffi::SDL_Window = core::mem::transmute(window);
      Ok(Self {
        win_ptr,
        ctx,
        _marker: PhantomData,
      })
    }
  }
pub fn from_window ( window : Window < ' sdl > ) -> Result < Self , String > { unsafe { let context : GLContext = window . gl_create_context ( ) ? ; let ctx : beryllium :: unsafe_raw_ffi :: SDL_GLContext = core :: mem :: transmute ( context ) ; let win_ptr : * mut beryllium :: unsafe_raw_ffi :: SDL_Window = core :: mem :: transmute ( window ) ; Ok ( Self { win_ptr , ctx , _marker : PhantomData , } ) } }
Given just a window, creates a context and returns a backend.
Given just a window creates a context and returns a backend .
window
Window<'sdl>
window
Window<'sdl>