Skip to content

Changes Window usage to Arc<Window> #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/helper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,19 @@ mod helper {

#[cfg(feature="winit")]
mod helper {
use std::sync::Arc;
use super::*;
use winit::event::Event;
use winit::event_loop::{ControlFlow, EventLoop};
use winit::window::Window;

pub use winit;

pub fn game_loop<G, U, R, H, T>(event_loop: EventLoop<T>, window: Window, game: G, updates_per_second: u32, max_frame_time: f64, mut update: U, mut render: R, mut handler: H) -> !
pub fn game_loop<G, U, R, H, T>(event_loop: EventLoop<T>, window: Arc<Window>, game: G, updates_per_second: u32, max_frame_time: f64, mut update: U, mut render: R, mut handler: H) -> !
where G: 'static,
U: FnMut(&mut GameLoop<G, Time, Window>) + 'static,
R: FnMut(&mut GameLoop<G, Time, Window>) + 'static,
H: FnMut(&mut GameLoop<G, Time, Window>, &Event<'_, T>) + 'static,
U: FnMut(&mut GameLoop<G, Time, Arc<Window>>) + 'static,
R: FnMut(&mut GameLoop<G, Time, Arc<Window>>) + 'static,
H: FnMut(&mut GameLoop<G, Time, Arc<Window>>, &Event<'_, T>) + 'static,
T: 'static,
{
let mut game_loop = GameLoop::new(game, updates_per_second, max_frame_time, window);
Expand Down