diff --git a/Cargo.lock b/Cargo.lock index 084c600..623e88b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,4 +4,4 @@ version = 3 [[package]] name = "motion" -version = "0.1.5" +version = "0.1.6" diff --git a/Cargo.toml b/Cargo.toml index 38dde1e..def6f9c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "motion" -version = "0.1.5" +version = "0.1.6" edition = "2021" authors = ["Juanperias"] description = "A bare metal physics engine." diff --git a/README.md b/README.md index 9500e75..9ffd0d0 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ let's start by making a simple event loop ```rust use std::{thread, time::Duration}; -use motion::event_loop::{EventLoop, EventLoopConfig}; +use motion::event_loop::EventLoopBuilder; // The definition of this function depends on the context in which motion is used fn sleep(duration: Duration) { @@ -19,7 +19,7 @@ fn sleep(duration: Duration) { } fn main() { - let el = EventLoop::new(EventLoopConfig { fps: 1 }); + let el = EventLoopBuilder::new().fps(1).build(); el.start(|_config| println!("Hello! in the event loop"), sleep); } diff --git a/src/forces/force.rs b/src/forces/force.rs index 09c59c3..71b70fc 100644 --- a/src/forces/force.rs +++ b/src/forces/force.rs @@ -10,7 +10,7 @@ use crate::obj::obj_2d::Object2d; /// struct Gravity; /// /// impl Force for Gravity { -/// fn apply_2d(&self, obj: &mut Object2d) { +/// fn apply_2d(&mut self, obj: &Object2d) { /// // Apply gravitational force to obj /// } /// } diff --git a/src/lib.rs b/src/lib.rs index c3fce0e..e5f256c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -11,13 +11,16 @@ //! With this you already have record installed in your project, you can start with a simple event loop //!```rust //!use std::{thread, time::Duration}; -//!use motion::event_loop::{EventLoop, EventLoopConfig}; -//! // The definition of this function depends on the context in which motion is used +//! +//!use motion::event_loop::EventLoopBuilder; +//! +// The definition of this function depends on the context in which motion is used //!fn sleep(duration: Duration) { -//! thread::sleep(duration); +//! thread::sleep(duration); //!} +//! //!fn main() { -//! let el = EventLoop::new(EventLoopConfig { fps: 1 }); +//! let el = EventLoopBuilder::new().fps(1).build(); //! //! el.start(|_config| println!("Hello! in the event loop"), sleep); //!}