Skip to content

Commit

Permalink
update example for new renderer
Browse files Browse the repository at this point in the history
  • Loading branch information
mockersf committed Nov 25, 2021
1 parent 07b4bc2 commit 06d365b
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 3 deletions.
17 changes: 16 additions & 1 deletion examples/ios/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,19 @@ name = "bevy_ios_example"
crate-type = ["staticlib"]

[dependencies]
bevy = { path = "../../", features = [ "bevy_gilrs", "bevy_gltf", "bevy_wgpu", "bevy_winit", "render", "png", "hdr", "bevy_audio", "mp3"], default-features = false}
bevy = { path = "../../", features = [
"bevy_audio",
"bevy_core_pipeline",
"bevy_gltf2",
"bevy_wgpu",
"bevy_sprite2",
"bevy_render2",
"bevy_pbr2",
"bevy_winit",
"render",
"png",
"hdr",
"mp3",
"x11",
"filesystem_watcher"
], default-features = false}
27 changes: 25 additions & 2 deletions examples/ios/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,21 @@
use bevy::{prelude::*, window::WindowMode};
use bevy::{
audio::{Audio, AudioPlugin},
input::touch::TouchPhase,
math::{Vec2, Vec3},
pbr2::{PbrBundle, PointLight, PointLightBundle, StandardMaterial},
prelude::{
bevy_main, App, AssetServer, Assets, Commands, EventReader, Local, Query, Res, ResMut,
TouchInput, Transform, With,
},
render2::{
camera::{Camera, PerspectiveCameraBundle},
color::Color,
mesh::{shape, Mesh},
view::Msaa,
},
window::{WindowDescriptor, WindowMode, Windows},
PipelinedDefaultPlugins,
};

// the `bevy_main` proc_macro generates the required ios boilerplate
#[bevy_main]
Expand All @@ -11,7 +28,8 @@ fn main() {
..Default::default()
})
.insert_resource(Msaa { samples: 4 })
.add_plugins(DefaultPlugins)
.add_plugins(PipelinedDefaultPlugins)
.add_plugin(AudioPlugin)
.add_startup_system(setup_scene)
.add_startup_system(setup_music)
.run();
Expand Down Expand Up @@ -48,6 +66,11 @@ fn setup_scene(
// light
commands.spawn_bundle(PointLightBundle {
transform: Transform::from_xyz(4.0, 8.0, 4.0),
point_light: PointLight {
intensity: 5000.0,
shadows_enabled: true,
..Default::default()
},
..Default::default()
});
// camera
Expand Down

0 comments on commit 06d365b

Please sign in to comment.