Navigation Menu

Skip to content

Commit

Permalink
Use canvas provided by the winit
Browse files Browse the repository at this point in the history
  • Loading branch information
chemicstry committed Mar 30, 2020
1 parent 45f8c7c commit 48915cb
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions init/src/windowed.rs
Expand Up @@ -313,15 +313,9 @@ rendy_with_gl_backend! {
pub fn init_gl<T: 'static>(config: &Config<impl DevicesConfigure, impl HeapsConfigure, impl QueuesConfigure>, window_builder: WindowBuilder, event_loop: &EventLoop<T>) -> Result<Self, WindowedRendyInitError> {
let window = window_builder.build(event_loop)?;

web_sys::window()
.unwrap()
.document()
.unwrap()
.body()
.unwrap()
.append_child(&winit::platform::web::WindowExtWebSys::canvas(&window)).unwrap();

let surface = rendy_core::gl::Surface::from_raw_handle(&window);
let surface = rendy_core::gl::Surface::from_canvas(
winit::platform::web::WindowExtWebSys::canvas(&window)
);
let instance = rendy_core::Instance::new(surface);

let (factory, families) = rendy_factory::init_with_instance_ref(&instance, config)?;
Expand Down

0 comments on commit 48915cb

Please sign in to comment.