From a01a98feeeb86d6572b4c1947391dba1ee261b5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emil=20Gardstr=C3=B6m?= Date: Tue, 19 Jul 2016 18:56:39 +0200 Subject: [PATCH 01/13] Updated code to match #67 functionality. Also mentions rustup instead of multirust. --- book/src/getting_started/hello_world.md | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/book/src/getting_started/hello_world.md b/book/src/getting_started/hello_world.md index 21e8ec51bf..a71d5e0635 100644 --- a/book/src/getting_started/hello_world.md +++ b/book/src/getting_started/hello_world.md @@ -8,6 +8,9 @@ copy and paste the following code: extern crate amethyst; use amethyst::engine::{Application, Duration, State, Trans}; +use amethyst::context::{Context, Config}; +use std::rc::Rc; +use std::cell::RefCell; struct HelloWorld; @@ -27,13 +30,16 @@ impl State for HelloWorld { } fn main() { - let mut game = Application::new(HelloWorld); + let config = Config::from_file("../resources/config.yml").unwrap(); + let context = Context::new(config); + let context_ref = Rc::new(RefCell::new(context)); + let mut game = Application::new(HelloWorld, context_ref); game.run(); } ``` -Then, compile and run the code with `cargo run`, or `amethyst run` if you -have the [CLI tool installed][ct]. +Then, compile and run the code inside "**src/**" with `cargo run`, +or `amethyst run` if you have the [CLI tool installed][ct]. [ct]: ./getting_started/automatic_setup.html @@ -46,11 +52,11 @@ Game stopped! ``` If instead you see `error: use of unstable library feature` then make sure -you're using the [nightly release][nr] of Rust. You can use [multirust][mr] to +you're using the [nightly release][nr] of Rust. You can use [rustup][ru] to install stable and nightly Rust side-by-side. [nr]: https://doc.rust-lang.org/book/release-channels.html -[mr]: https://github.com/brson/multirust +[ru]: https://rustup.rs Congratulations! You have successfully written your first Amethyst application. From 592fc10d1889b15b4c2f7c91b5f8589c7755c748 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emil=20Gardstr=C3=B6m?= Date: Tue, 19 Jul 2016 19:08:06 +0200 Subject: [PATCH 02/13] Added an easier way to manage a local clone. --- .../src/getting_started/manual_cargo_setup.md | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/book/src/getting_started/manual_cargo_setup.md b/book/src/getting_started/manual_cargo_setup.md index bb97beed59..ad13de6a7c 100644 --- a/book/src/getting_started/manual_cargo_setup.md +++ b/book/src/getting_started/manual_cargo_setup.md @@ -16,15 +16,27 @@ the following lines to your "Cargo.toml": [dependencies] amethyst = "*" ``` +### From Git via cargo -### From Git +If you don't want to get Amethyst from Crates.io but directly from the +Git repository, you can add the following lines to your "Cargo.toml": -If you don't want to get Amethyst from Crates.io, you can clone the entire SDK -from the Git repository. Once you're done, create a new Cargo project and `cd` -into it. +```toml +[dependencies] +amethyst = { git = "https://github.com/amethyst/amethyst.git" } +``` + +See the [crates guide][crg] for more information on the Cargo manifest file. + +[crg]: http://doc.crates.io/specifying-dependencies.html#specifying-dependencies-from-git-repositories + +### From Git via clone + +Instead of using the above, you can also clone the entire SDK from the +Git repository. Once you're done, create a new Cargo project and `cd` into it. ``` -$ git clone https://github.com/ebkalderon/amethyst.git +$ git clone https://github.com/amethyst/amethyst.git $ cargo new --bin hello_world $ cd hello_world ``` From 0ed6c5222d61fd537e7683ac2444821c0e0a3e1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emil=20Gardstr=C3=B6m?= Date: Tue, 19 Jul 2016 19:48:27 +0200 Subject: [PATCH 03/13] A little more descriptive way on how to take care of nightly. --- book/src/getting_started.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/book/src/getting_started.md b/book/src/getting_started.md index 9e22ac5edf..bf4fd1febe 100644 --- a/book/src/getting_started.md +++ b/book/src/getting_started.md @@ -19,8 +19,11 @@ Rust compiler. Here are the system requirements (they're pretty modest): ## Setting Up > Note: This guide assumes you have nightly Rust and Cargo installed, and also -> have a working Internet connection. Please take care of these prerequisites -> first before proceeding. +> have a working Internet connection. +> Please take care of these prerequisites first before proceeding. +> See [rustup][ru] for an easy way to have two installations of rust. + +[ru]: https://rustup.rs There are two ways to get started working with Amethyst: From bf730cf60905fd44e8e63d554f931c48c48f00a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emil=20Gardstr=C3=B6m?= Date: Tue, 19 Jul 2016 20:58:00 +0200 Subject: [PATCH 04/13] Updated text and fixed faulty link. --- book/src/getting_started.md | 4 ++-- book/src/getting_started/hello_world.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/book/src/getting_started.md b/book/src/getting_started.md index bf4fd1febe..ae4bb97030 100644 --- a/book/src/getting_started.md +++ b/book/src/getting_started.md @@ -21,9 +21,9 @@ Rust compiler. Here are the system requirements (they're pretty modest): > Note: This guide assumes you have nightly Rust and Cargo installed, and also > have a working Internet connection. > Please take care of these prerequisites first before proceeding. -> See [rustup][ru] for an easy way to have two installations of rust. +> See [rustup][ru] for handling multiple rust toolchains. -[ru]: https://rustup.rs +[ru]: https://www.rustup.rs/ There are two ways to get started working with Amethyst: diff --git a/book/src/getting_started/hello_world.md b/book/src/getting_started/hello_world.md index a71d5e0635..4f3191986b 100644 --- a/book/src/getting_started/hello_world.md +++ b/book/src/getting_started/hello_world.md @@ -56,7 +56,7 @@ you're using the [nightly release][nr] of Rust. You can use [rustup][ru] to install stable and nightly Rust side-by-side. [nr]: https://doc.rust-lang.org/book/release-channels.html -[ru]: https://rustup.rs +[ru]: https://www.rustup.rs Congratulations! You have successfully written your first Amethyst application. From f2369361aaa424f7f71ceee8467cc98130a43cf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emil=20Gardstr=C3=B6m?= Date: Wed, 20 Jul 2016 01:44:23 +0200 Subject: [PATCH 05/13] Improved on the ecs example. --- src/ecs/Cargo.toml | 7 ++++ src/ecs/examples/usage.rs | 72 +++++++++++++++++++++++++++------------ 2 files changed, 57 insertions(+), 22 deletions(-) diff --git a/src/ecs/Cargo.toml b/src/ecs/Cargo.toml index 5551611d7d..26535beacb 100644 --- a/src/ecs/Cargo.toml +++ b/src/ecs/Cargo.toml @@ -14,3 +14,10 @@ license = "MIT" [dependencies] time = "^0.1" specs = "^0.7.0" + +[[example]] +name = "usage" +path = "examples/usage.rs" + +[dev-dependencies] +rand = "0.3" diff --git a/src/ecs/examples/usage.rs b/src/ecs/examples/usage.rs index 2b14c9e233..11b45fcd15 100644 --- a/src/ecs/examples/usage.rs +++ b/src/ecs/examples/usage.rs @@ -1,5 +1,6 @@ -///! Example of a basic entity-component system with 3 types of components. +///! Example of a basic entity-component system with 3 types of generic components. extern crate time; +extern crate rand; extern crate amethyst_ecs as ecs; @@ -7,28 +8,30 @@ use time::Duration; use ecs::{World, Simulation, Processor, RunArg, Component, VecStorage, JoinIter}; -// Define our components. +// First we define our components. +// Position in 3d of the Entity #[derive(Debug)] struct Position { x: f32, y: f32, z: f32, } -impl Component for Position { - type Storage = VecStorage; -} -#[derive(Debug)] -struct Light { - x: f32, - y: f32, - z: f32, +impl Position { + fn add_speed(&mut self, speed: &Speed) { + self.x += speed.dx; + self.y += speed.dy; + self.z += speed.dz; + } + } -impl Component for Light { - type Storage = VecStorage; + +impl Component for Position { + type Storage = VecStorage; } +// Example of a mesh component #[derive(Debug)] struct Mesh { handle: u64, @@ -37,16 +40,36 @@ struct Mesh { impl Component for Mesh { type Storage = VecStorage; } +// Example of a speed component +#[derive(Debug)] +struct Speed { + dx: f32, + dy: f32, + dz: f32, +} +impl Component for Speed { + type Storage = VecStorage; +} // Define our processors. +struct Update; +impl Processor for Update { + fn run(&mut self, arg: RunArg, _: Duration) { + let (mut p, s) = arg.fetch(|w| (w.write::(), w.read::())); // Make p writable. + for (p, s) in JoinIter::new((&mut p, &s)) { // We want to only update entities with position and mesh. + p.add_speed(&s); + } + } +} + struct Render { frame_count: u32, } impl Processor for Render { fn run(&mut self, arg: RunArg, _: Duration) { - let (p, m) = arg.fetch(|w| (w.read::(), w.read::())); - for (p, _) in JoinIter::new((&p, &m)) { + let (p, m) = arg.fetch(|w| (w.read::(), w.read::())); // Make p writable. + for (p, _) in JoinIter::new((&p, &m)) { // We want to only render entities with mesh and position. println!("Render {:?}", p); } self.frame_count += 1; @@ -55,24 +78,24 @@ impl Processor for Render { } fn main() { + use rand::distributions::{IndependentSample, Range}; + let mut rng = rand::thread_rng(); + let between = Range::new(-10f32, 10.); + let mut world = World::new(); world.register::(); - world.register::(); + world.register::(); world.register::(); let mut simulation = Simulation::build(world, 4) - .with(Render { frame_count: 0 }, "Renderer", 1000) + .with(Update { }, "Updater", 1000) // High priority + .with(Render { frame_count: 0 }, "Renderer", 500) // Low priority .done(); - for i in 0..180 { + for _ in 0..180 { simulation.mut_world() .create_now() .with(Position { - x: i as f32 * 0.1, - y: 0.0, - z: 0.0, - }) - .with(Light { x: 0.0, y: 0.0, z: 0.0, @@ -81,6 +104,11 @@ fn main() { handle: 1234567890, y: 12, }) + .with(Speed { + dx: between.ind_sample(&mut rng), + dy: between.ind_sample(&mut rng), + dz: between.ind_sample(&mut rng), + }) .build(); } From f92708d70de322993e0f628c410ecff12205b895 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emil=20Gardstr=C3=B6m?= Date: Wed, 20 Jul 2016 02:13:34 +0200 Subject: [PATCH 06/13] Satisfied rustfmt and fixed small typo. --- src/ecs/examples/usage.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/ecs/examples/usage.rs b/src/ecs/examples/usage.rs index 11b45fcd15..cdb2538dd1 100644 --- a/src/ecs/examples/usage.rs +++ b/src/ecs/examples/usage.rs @@ -24,7 +24,6 @@ impl Position { self.y += speed.dy; self.z += speed.dz; } - } impl Component for Position { @@ -57,7 +56,8 @@ struct Update; impl Processor for Update { fn run(&mut self, arg: RunArg, _: Duration) { let (mut p, s) = arg.fetch(|w| (w.write::(), w.read::())); // Make p writable. - for (p, s) in JoinIter::new((&mut p, &s)) { // We want to only update entities with position and mesh. + for (p, s) in JoinIter::new((&mut p, &s)) { + // We want to only update entities with position and speed. p.add_speed(&s); } } @@ -69,7 +69,8 @@ struct Render { impl Processor for Render { fn run(&mut self, arg: RunArg, _: Duration) { let (p, m) = arg.fetch(|w| (w.read::(), w.read::())); // Make p writable. - for (p, _) in JoinIter::new((&p, &m)) { // We want to only render entities with mesh and position. + for (p, _) in JoinIter::new((&p, &m)) { + // We want to only render entities with position and mesh. println!("Render {:?}", p); } self.frame_count += 1; @@ -81,14 +82,14 @@ fn main() { use rand::distributions::{IndependentSample, Range}; let mut rng = rand::thread_rng(); let between = Range::new(-10f32, 10.); - + let mut world = World::new(); world.register::(); world.register::(); world.register::(); let mut simulation = Simulation::build(world, 4) - .with(Update { }, "Updater", 1000) // High priority + .with(Update, "Updater", 1000) // High priority .with(Render { frame_count: 0 }, "Renderer", 500) // Low priority .done(); From 5d1c0661b1d701d3882f31a5018f5f5a3f524b63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emil=20Gardstr=C3=B6m?= Date: Wed, 20 Jul 2016 14:04:24 +0200 Subject: [PATCH 07/13] Fixed travis checks. Due to a problem with cargo test (see rust-lang/cargo#860), dev-dependencies are not imported when using -p. --- src/ecs/Cargo.toml | 2 -- src/ecs/examples/usage.rs | 17 ++++++++--------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/ecs/Cargo.toml b/src/ecs/Cargo.toml index 26535beacb..43781c3157 100644 --- a/src/ecs/Cargo.toml +++ b/src/ecs/Cargo.toml @@ -19,5 +19,3 @@ specs = "^0.7.0" name = "usage" path = "examples/usage.rs" -[dev-dependencies] -rand = "0.3" diff --git a/src/ecs/examples/usage.rs b/src/ecs/examples/usage.rs index cdb2538dd1..67f59f2756 100644 --- a/src/ecs/examples/usage.rs +++ b/src/ecs/examples/usage.rs @@ -1,6 +1,5 @@ ///! Example of a basic entity-component system with 3 types of generic components. extern crate time; -extern crate rand; extern crate amethyst_ecs as ecs; @@ -79,10 +78,10 @@ impl Processor for Render { } fn main() { - use rand::distributions::{IndependentSample, Range}; - let mut rng = rand::thread_rng(); - let between = Range::new(-10f32, 10.); - + // Replace this with your favorite rng. + fn pfrand(i: u32) -> f32 { + (i as f32) * 1.21912 + } let mut world = World::new(); world.register::(); world.register::(); @@ -93,7 +92,7 @@ fn main() { .with(Render { frame_count: 0 }, "Renderer", 500) // Low priority .done(); - for _ in 0..180 { + for i in 0..180 { simulation.mut_world() .create_now() .with(Position { @@ -106,9 +105,9 @@ fn main() { y: 12, }) .with(Speed { - dx: between.ind_sample(&mut rng), - dy: between.ind_sample(&mut rng), - dz: between.ind_sample(&mut rng), + dx: pfrand(i), + dy: pfrand(i), + dz: pfrand(i), }) .build(); } From 708323e805c8b00fe987eb5bd30fdc205299de7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emil=20Gardstr=C3=B6m?= Date: Tue, 2 Aug 2016 21:51:06 +0200 Subject: [PATCH 08/13] Updated to match #80 and #78 --- book/src/getting_started/hello_world.md | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/book/src/getting_started/hello_world.md b/book/src/getting_started/hello_world.md index 4f3191986b..c28bf501a4 100644 --- a/book/src/getting_started/hello_world.md +++ b/book/src/getting_started/hello_world.md @@ -9,31 +9,28 @@ extern crate amethyst; use amethyst::engine::{Application, Duration, State, Trans}; use amethyst::context::{Context, Config}; -use std::rc::Rc; -use std::cell::RefCell; +use amethyst::ecs::World; struct HelloWorld; impl State for HelloWorld { - fn on_start(&mut self) { + fn on_start(&mut self, _: &mut Context, _: &mut World) { println!("Game started!"); } - fn update(&mut self, _delta: Duration) -> Trans { + fn update(&mut self, _: &mut Context, _: &mut World) -> Trans { println!("Hello from Amethyst!"); Trans::Quit } - fn on_stop(&mut self) { + fn on_stop(&mut self, _: &mut Context, _: &mut World) { println!("Game stopped!"); } } fn main() { let config = Config::from_file("../resources/config.yml").unwrap(); - let context = Context::new(config); - let context_ref = Rc::new(RefCell::new(context)); - let mut game = Application::new(HelloWorld, context_ref); + let mut game = Application::build(HelloWorld, config).done(); game.run(); } ``` From a52cf6c167fa021f2e820c7a0251a600376bc376 Mon Sep 17 00:00:00 2001 From: Lucio Franco Date: Wed, 3 Aug 2016 11:51:34 -0600 Subject: [PATCH 09/13] fix readme with new doc url --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4a16203052..5ecd6ea570 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ Read the [online book][bk] for a comprehensive tutorial to using Amethyst. There is also an online crate-level [API reference][ar]. [bk]: https://www.amethyst.rs/book/ -[ar]: https://www.amethyst.rs/doc/amethyst/ +[ar]: https://www.amethyst.rs/doc/ ## Quick Example From ff613955f00def725d84c41412d5d169d9960e6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emil=20Gardstr=C3=B6m?= Date: Sat, 6 Aug 2016 16:19:06 +0200 Subject: [PATCH 10/13] Make examples smarter by knowing where config lives absolutely. --- examples/sphere.rs | 5 ++++- examples/window.rs | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/examples/sphere.rs b/examples/sphere.rs index 62dfb34d04..e9591a400d 100644 --- a/examples/sphere.rs +++ b/examples/sphere.rs @@ -82,7 +82,10 @@ impl State for Example { fn main() { use amethyst::context::Config; - let config = Config::from_file("../config/window_example_config.yml").unwrap(); + let config = Config::from_file( + format!("{}/config/window_example_config.yml", + env!("CARGO_MANIFEST_DIR")) + ).unwrap(); let mut game = Application::build(Example, config).done(); game.run(); } diff --git a/examples/window.rs b/examples/window.rs index ca7cb95917..aedfe5a996 100644 --- a/examples/window.rs +++ b/examples/window.rs @@ -44,7 +44,10 @@ impl State for Example { fn main() { use amethyst::context::Config; - let config = Config::from_file("../config/window_example_config.yml").unwrap(); + let config = Config::from_file( + format!("{}/config/window_example_config.yml", + env!("CARGO_MANIFEST_DIR")) + ).unwrap(); let mut game = Application::build(Example, config).done(); game.run(); } From 2df329c361e1b0ee93bfd6f93a652b00d4ef108e Mon Sep 17 00:00:00 2001 From: Nikita Chashchinskii Date: Sat, 6 Aug 2016 15:39:32 +0300 Subject: [PATCH 11/13] Pass Context to Application::build instead of Config --- examples/hello_world.rs | 3 ++- src/engine/app.rs | 19 +++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/examples/hello_world.rs b/examples/hello_world.rs index 397b967437..ee4fbd0888 100644 --- a/examples/hello_world.rs +++ b/examples/hello_world.rs @@ -25,6 +25,7 @@ impl State for Example { fn main() { let config = Config::default(); - let mut game = Application::build(Example, config).done(); + let context = Context::new(config); + let mut game = Application::build(Example, context).done(); game.run(); } diff --git a/src/engine/app.rs b/src/engine/app.rs index 67e96cb7d6..2010a81da5 100644 --- a/src/engine/app.rs +++ b/src/engine/app.rs @@ -3,7 +3,7 @@ use super::state::{State, StateMachine}; use context::timing::{SteadyTime, Stopwatch}; use context::event::EngineEvent; -use context::{Config, Context}; +use context::Context; use ecs::{Planner, World, Processor, Priority}; use std::sync::{Arc, Mutex}; use std::ops::DerefMut; @@ -16,11 +16,10 @@ pub struct Application { } impl Application { - /// Creates a new Application with the given initial game state, planner, and config. - pub fn new(initial_state: T, planner: Planner>>, config: Config) -> Application + /// Creates a new Application with the given initial game state, planner, and context. + pub fn new(initial_state: T, planner: Planner>>, context: Context) -> Application where T: State + 'static { - let context = Context::new(config); let context = Arc::new(Mutex::new(context)); Application { states: StateMachine::new(initial_state, planner), @@ -30,10 +29,10 @@ impl Application { } /// Build a new Application using builder pattern. - pub fn build(initial_state: T, config: Config) -> ApplicationBuilder + pub fn build(initial_state: T, context: Context) -> ApplicationBuilder where T: State + 'static { - ApplicationBuilder::new(initial_state, config) + ApplicationBuilder::new(initial_state, context) } /// Starts the application and manages the game loop. @@ -87,19 +86,19 @@ pub struct ApplicationBuilder where T: State + 'static { initial_state: T, - config: Config, + context: Context, planner: Planner>>, } impl ApplicationBuilder where T: State + 'static { - pub fn new(initial_state: T, config: Config) -> ApplicationBuilder { + pub fn new(initial_state: T, context: Context) -> ApplicationBuilder { let world = World::new(); let planner = Planner::new(world, 1); ApplicationBuilder { initial_state: initial_state, - config: config, + context: context, planner: planner, } } @@ -115,6 +114,6 @@ impl ApplicationBuilder } pub fn done(self) -> Application { - Application::new(self.initial_state, self.planner, self.config) + Application::new(self.initial_state, self.planner, self.context) } } From aff004a59732b75c055ae11a7584dd3be6696dff Mon Sep 17 00:00:00 2001 From: Nikita Chashchinskii Date: Sat, 6 Aug 2016 15:40:42 +0300 Subject: [PATCH 12/13] Update hello world example in the book --- book/src/getting_started/hello_world.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/book/src/getting_started/hello_world.md b/book/src/getting_started/hello_world.md index c28bf501a4..caf68cd67c 100644 --- a/book/src/getting_started/hello_world.md +++ b/book/src/getting_started/hello_world.md @@ -7,7 +7,7 @@ copy and paste the following code: ```rust extern crate amethyst; -use amethyst::engine::{Application, Duration, State, Trans}; +use amethyst::engine::{Application, State, Trans}; use amethyst::context::{Context, Config}; use amethyst::ecs::World; @@ -29,8 +29,9 @@ impl State for HelloWorld { } fn main() { - let config = Config::from_file("../resources/config.yml").unwrap(); - let mut game = Application::build(HelloWorld, config).done(); + let config = Config::default(); + let context = Context::new(config); + let mut game = Application::build(HelloWorld, context).done(); game.run(); } ``` From 97c8c88afdba8fbd77b33a061211bfe1a72604b6 Mon Sep 17 00:00:00 2001 From: Nikita Chashchinskii Date: Tue, 16 Aug 2016 23:57:05 +0300 Subject: [PATCH 13/13] Fix sphere.rs and window.rs examples --- examples/sphere.rs | 3 ++- examples/window.rs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/sphere.rs b/examples/sphere.rs index e9591a400d..3f83bb2d34 100644 --- a/examples/sphere.rs +++ b/examples/sphere.rs @@ -86,6 +86,7 @@ fn main() { format!("{}/config/window_example_config.yml", env!("CARGO_MANIFEST_DIR")) ).unwrap(); - let mut game = Application::build(Example, config).done(); + let context = Context::new(config); + let mut game = Application::build(Example, context).done(); game.run(); } diff --git a/examples/window.rs b/examples/window.rs index aedfe5a996..612b254201 100644 --- a/examples/window.rs +++ b/examples/window.rs @@ -48,6 +48,7 @@ fn main() { format!("{}/config/window_example_config.yml", env!("CARGO_MANIFEST_DIR")) ).unwrap(); - let mut game = Application::build(Example, config).done(); + let context = Context::new(config); + let mut game = Application::build(Example, context).done(); game.run(); }