From 349055ef2533bf3268f37d3c04e5adb84814f50a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustav=20S=C3=B6rn=C3=A4s?= Date: Sat, 30 Jan 2021 23:24:05 +0100 Subject: remove tokio from pong --- pong/src/main.rs | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'pong/src/main.rs') diff --git a/pong/src/main.rs b/pong/src/main.rs index 6382e92..c3cc0bf 100644 --- a/pong/src/main.rs +++ b/pong/src/main.rs @@ -33,15 +33,6 @@ extern_function!(key_down }, ); -extern_function!(my_next_frame - [] -> Type::Void => { - tokio::spawn(async { - next_frame().await - }); - Ok(Value::Nil) - }, -); - extern_function!(my_draw_rectangle [Value::Float(x), Value::Float(y), Value::Float(w), Value::Float(h)] -> Type::Void => { draw_rectangle(*x as f32, *y as f32, *w as f32, *h as f32, DARKPURPLE); @@ -64,18 +55,14 @@ async fn main() { ..Default::default() }); - let rt = tokio::runtime::Runtime::new().unwrap(); - let functions: Vec<(String, tihdy::RustFunction)> = vec![ ("log".to_string(), log), ("get_delta".to_string(), get_delta), ("key_down".to_string(), key_down), - ("next_frame".to_string(), my_next_frame), ("draw_rectangle".to_string(), my_draw_rectangle), ("clear".to_string(), clear), ]; - let _guard = rt.enter(); // so we can async { next_frame().await } let vm = tihdy::compile_file(Path::new("pong.tdy"), false, functions); if let Err(errs) = vm { for err in errs { -- cgit v1.2.1