start program without spawning thread so screen works on mac. improve mouse demo

This commit is contained in:
2020-10-06 12:28:49 +02:00
parent f4ced467e4
commit 2fa23dbbc3
3 changed files with 27 additions and 24 deletions
+4 -2
View File
@@ -48,13 +48,15 @@ impl RunThread {
self.info.cycle_time = cycle_time;
}
pub fn start(self) -> JoinHandle<()> {
/// Spawn as a thread
pub fn spawn(self) -> JoinHandle<()> {
std::thread::spawn(move || {
self.run();
})
}
fn run(mut self) {
/// Start synchronously
pub fn run(mut self) {
'run: loop {
match self.eval_op() {
Ok(EvalRes { cycles, advance }) => {