Add a `LoadScene` message to the backend thread

This commit is contained in:
Patrick Walton 2019-02-12 11:03:37 -08:00
parent 31f1fae951
commit 7511b3bd2f
1 changed files with 2 additions and 0 deletions

View File

@ -363,6 +363,7 @@ impl SceneThread {
fn run(mut self) {
while let Ok(msg) = self.receiver.recv() {
match msg {
MainToSceneMsg::LoadScene(scene) => self.scene = scene,
MainToSceneMsg::SetDrawableSize(size) => {
self.scene.view_box =
RectF32::new(Point2DF32::default(),
@ -380,6 +381,7 @@ impl SceneThread {
}
enum MainToSceneMsg {
LoadScene(Scene),
SetDrawableSize(Size2D<u32>),
Build(BuildOptions),
}