mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-12-25 15:33:44 +03:00
split out experimental playground GUI stuff into its own crate
This commit is contained in:
parent
64d4117c0c
commit
571aa2f786
@ -12,5 +12,6 @@ members = [
|
|||||||
"headless",
|
"headless",
|
||||||
"kml",
|
"kml",
|
||||||
"map_model",
|
"map_model",
|
||||||
|
"playground_gui",
|
||||||
"sim",
|
"sim",
|
||||||
]
|
]
|
||||||
|
@ -873,3 +873,10 @@ ah no, it's because we use max_lookahead_dist in accel_to_follow, and the speed
|
|||||||
https://www.reddit.com/r/rust_gamedev/comments/7f7w60/auditioning_a_replacement_for_bearlibterminal/
|
https://www.reddit.com/r/rust_gamedev/comments/7f7w60/auditioning_a_replacement_for_bearlibterminal/
|
||||||
|
|
||||||
https://github.com/ggez/ggez/blob/master/examples/drawing.rs
|
https://github.com/ggez/ggez/blob/master/examples/drawing.rs
|
||||||
|
|
||||||
|
things to follow:
|
||||||
|
- https://suhr.github.io/gsgt/
|
||||||
|
- https://wiki.alopex.li/LearningGfx
|
||||||
|
- https://github.com/nical/lyon/blob/master/examples/gfx_basic/src/main.rs
|
||||||
|
|
||||||
|
- porting to wasm: https://aimlesslygoingforward.com/blog/2017/12/25/dose-response-ported-to-webassembly/
|
||||||
|
@ -27,7 +27,6 @@ extern crate strum;
|
|||||||
extern crate strum_macros;
|
extern crate strum_macros;
|
||||||
|
|
||||||
mod colors;
|
mod colors;
|
||||||
mod experimental;
|
|
||||||
mod kml;
|
mod kml;
|
||||||
mod plugins;
|
mod plugins;
|
||||||
mod render;
|
mod render;
|
||||||
@ -46,10 +45,6 @@ struct Flags {
|
|||||||
#[structopt(long = "rng_seed")]
|
#[structopt(long = "rng_seed")]
|
||||||
rng_seed: Option<u8>,
|
rng_seed: Option<u8>,
|
||||||
|
|
||||||
/// Use the experimental GUI
|
|
||||||
#[structopt(long = "experimental")]
|
|
||||||
experimental_gui: bool,
|
|
||||||
|
|
||||||
/// Extra KML to display
|
/// Extra KML to display
|
||||||
#[structopt(long = "kml")]
|
#[structopt(long = "kml")]
|
||||||
kml: Option<String>,
|
kml: Option<String>,
|
||||||
@ -61,19 +56,10 @@ struct Flags {
|
|||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let flags = Flags::from_args();
|
let flags = Flags::from_args();
|
||||||
if flags.experimental_gui {
|
ezgui::run(
|
||||||
ezgui::run(
|
ui::UI::new(flags.load, flags.scenario_name, flags.rng_seed, flags.kml),
|
||||||
experimental::UI::new(),
|
"A/B Street",
|
||||||
"Experimental drawing mechanism",
|
1024,
|
||||||
1024,
|
768,
|
||||||
768,
|
);
|
||||||
);
|
|
||||||
} else {
|
|
||||||
ezgui::run(
|
|
||||||
ui::UI::new(flags.load, flags.scenario_name, flags.rng_seed, flags.kml),
|
|
||||||
"A/B Street",
|
|
||||||
1024,
|
|
||||||
768,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
11
playground_gui/Cargo.toml
Normal file
11
playground_gui/Cargo.toml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
[package]
|
||||||
|
name = "playground_gui"
|
||||||
|
version = "0.1.0"
|
||||||
|
authors = ["Dustin Carlino <dabreegster@gmail.com>"]
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
ezgui = { path = "../ezgui" }
|
||||||
|
geom = { path = "../geom" }
|
||||||
|
map_model = { path = "../map_model" }
|
||||||
|
piston = "*"
|
||||||
|
piston2d-graphics = "*"
|
@ -1,8 +1,13 @@
|
|||||||
|
extern crate ezgui;
|
||||||
|
extern crate geom;
|
||||||
|
extern crate graphics;
|
||||||
|
extern crate map_model;
|
||||||
|
extern crate piston;
|
||||||
|
|
||||||
use ezgui::canvas::Canvas;
|
use ezgui::canvas::Canvas;
|
||||||
use ezgui::input::UserInput;
|
use ezgui::input::UserInput;
|
||||||
use ezgui::{EventLoopMode, GfxCtx, GUI};
|
use ezgui::{EventLoopMode, GfxCtx, GUI};
|
||||||
use geom::{PolyLine, Polygon, Pt2D};
|
use geom::{PolyLine, Polygon, Pt2D};
|
||||||
use graphics;
|
|
||||||
use graphics::types::Color;
|
use graphics::types::Color;
|
||||||
use map_model::geometry;
|
use map_model::geometry;
|
||||||
use piston::input::Key;
|
use piston::input::Key;
|
||||||
@ -361,3 +366,7 @@ impl Iterator for RelatedColors {
|
|||||||
])
|
])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
ezgui::run(UI::new(), "GUI Playground", 1024, 768);
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user