Trait riddle_platform_winit::ext::PlatformSystemExt[][src]

pub trait PlatformSystemExt {
    fn new_shared() -> (PlatformSystemHandle, PlatformMainThreadState);
}

Required methods

fn new_shared() -> (PlatformSystemHandle, PlatformMainThreadState)[src]

Create a new platform system and its main thread state pair.

Do not call if using the riddle crate as recommended, as RiddleLib manages the creation and platform lifetime automatically.

Example

This example is only relevant if you’re not using riddle

let (platform_system, main_thread_state) = PlatformSystem::new_shared();
let window = WindowBuilder::new().build(main_thread_state.borrow_context())?;

main_thread_state.run::<PlatformError, _>(move |ctx| {
    match ctx.event() {
        PlatformEvent::WindowClose(_) => { ctx.quit(); }
        _ => ()
    };
    Ok(())
})
Loading content...

Implementors

impl PlatformSystemExt for PlatformSystem[src]

Loading content...