From 87945ffa75ebe37db19d3afe92760e44bc0eaae3 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Fri, 29 Sep 2023 23:54:30 +0300 Subject: [PATCH] fixed some tests --- src/fyrox/obsolete/custom_game_loop.md | 2 +- src/fyrox/scripting/executor.md | 3 ++- src/fyrox/sound/hrtf.md | 5 +++-- src/fyrox/tutorials/fps/tutorial-1/tutorial-part-1.md | 4 ++-- src/fyrox/ui/button.md | 4 ++-- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/fyrox/obsolete/custom_game_loop.md b/src/fyrox/obsolete/custom_game_loop.md index 52101e80..360c2aa3 100644 --- a/src/fyrox/obsolete/custom_game_loop.md +++ b/src/fyrox/obsolete/custom_game_loop.md @@ -24,7 +24,7 @@ Here is an example of custom game loop with comments that will guide your throug # use std::{sync::Arc}; fn main() { - let event_loop = EventLoop::new(); + let event_loop = EventLoop::new().unwrap(); // Then initialize the engine. let graphics_context_params = GraphicsContextParams { diff --git a/src/fyrox/scripting/executor.md b/src/fyrox/scripting/executor.md index db1f5797..32ca5b0a 100644 --- a/src/fyrox/scripting/executor.md +++ b/src/fyrox/scripting/executor.md @@ -55,8 +55,9 @@ You can set window title when creating executor instance: # use fyrox::engine::executor::Executor; # use fyrox::window::WindowAttributes; # use fyrox::engine::GraphicsContextParams; +# use fyrox::event_loop::EventLoop; let executor = Executor::from_params( - Default::default(), + EventLoop::new().unwrap(), GraphicsContextParams { window_attributes: WindowAttributes { title: "My Game".to_string(), diff --git a/src/fyrox/sound/hrtf.md b/src/fyrox/sound/hrtf.md index 5939db44..5a645796 100644 --- a/src/fyrox/sound/hrtf.md +++ b/src/fyrox/sound/hrtf.md @@ -28,11 +28,12 @@ Once it is loaded, all sounds in the scene will use the HRTF for rendering. The # extern crate fyrox; # use fyrox::scene::{ # graph::Graph, -# sound::{self, HrirSphere, HrtfRenderer, Renderer}, +# sound::{self, HrirSphere, HrirSphereResource, HrirSphereResourceExt, HrtfRenderer, Renderer}, # }; # fn use_hrtf(graph: &mut Graph) { - let hrir_sphere = HrirSphere::from_file("path/to/hrir.bin", sound::SAMPLE_RATE).unwrap(); + let hrir_sphere = HrirSphereResource::from_hrir_sphere( + HrirSphere::from_file("path/to/hrir.bin", sound::SAMPLE_RATE).unwrap(), "path/to/hrir.bin".into()); graph .sound_context .state() diff --git a/src/fyrox/tutorials/fps/tutorial-1/tutorial-part-1.md b/src/fyrox/tutorials/fps/tutorial-1/tutorial-part-1.md index 8c734570..ec74dd6a 100644 --- a/src/fyrox/tutorials/fps/tutorial-1/tutorial-part-1.md +++ b/src/fyrox/tutorials/fps/tutorial-1/tutorial-part-1.md @@ -85,7 +85,7 @@ impl Game { fn main() { // Create event loop that will be used to "listen" events from the OS. - let event_loop = EventLoop::new(); + let event_loop = EventLoop::new().unwrap(); // Finally create an instance of the engine. let graphics_context_params = GraphicsContextParams { @@ -194,7 +194,7 @@ Finally, we at the point where the interesting stuff happens - `fn main()`. We'r ```rust,no_run # extern crate fyrox; # use fyrox::event_loop::EventLoop; -let event_loop = EventLoop::new(); +let event_loop = EventLoop::new().unwrap(); ``` The event loop is a "magic" thing that receives events from the operating system and feeds your application, this is a very diff --git a/src/fyrox/ui/button.md b/src/fyrox/ui/button.md index 3476e7ed..a72f7eab 100644 --- a/src/fyrox/ui/button.md +++ b/src/fyrox/ui/button.md @@ -85,14 +85,14 @@ useful: # core::pool::Handle, # event_loop::ControlFlow, # gui::{button::ButtonMessage, message::UiMessage, UiNode}, -# plugin::PluginContext, +# plugin::{PluginContext, Plugin}, # }; # struct Game { button: Handle, } -impl Game { +impl Plugin for Game { fn on_ui_message( &mut self, context: &mut PluginContext,