Skip to content

Commit

Permalink
fixed some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mrDIMAS committed Sep 29, 2023
1 parent 1938c18 commit 87945ff
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/fyrox/obsolete/custom_game_loop.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 2 additions & 1 deletion src/fyrox/scripting/executor.md
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
5 changes: 3 additions & 2 deletions src/fyrox/sound/hrtf.md
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions src/fyrox/tutorials/fps/tutorial-1/tutorial-part-1.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/fyrox/ui/button.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<UiNode>,
}
impl Game {
impl Plugin for Game {
fn on_ui_message(
&mut self,
context: &mut PluginContext,
Expand Down

0 comments on commit 87945ff

Please sign in to comment.