Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mod particle;
- mod universe;
- use crate::universe::Universe;
- use amethyst::{
- assets::{PrefabLoader, PrefabLoaderSystem, RonFormat},
- core::transform::TransformBundle,
- prelude::*,
- renderer::{DisplayConfig, DrawFlat, Pipeline, PosNormTex, RenderBundle, Stage},
- utils::{application_root_dir, scene::BasicScenePrefab},
- };
- pub type MyPrefabData = BasicScenePrefab<Vec<PosNormTex>>;
- fn main() -> amethyst::Result<()> {
- amethyst::start_logger(Default::default());
- let app_root = application_root_dir();
- let config_path = format!("{}/resources/display_config.ron", app_root);
- let config = DisplayConfig::load(&config_path);
- let resources = format!("{}/resources", app_root);
- let pipe = Pipeline::build().with_stage(
- Stage::with_backbuffer()
- .clear_target([0.00196, 0.23726, 0.21765, 1.0], 1.0)
- .with_pass(DrawFlat::<PosNormTex>::new()),
- );
- let game_data = GameDataBuilder::default()
- .with(PrefabLoaderSystem::<MyPrefabData>::default(), "", &[])
- .with_bundle(RenderBundle::new(pipe, Some(config)))?
- .with_bundle(TransformBundle::new())?;
- let mut game = Application::new(resources, Universe {}, game_data)?;
- game.run();
- Ok(())
- }
Add Comment
Please, Sign In to add comment