File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed
Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change 1- function loom .tick () end
1+ function loom .init ()
2+ loom .log .info (" Initialized lua" )
3+ end
4+
5+ function loom .tick ()
6+ loom .debugger ()
7+ end
28
39function loom .frame (dt ) end
10+
11+ function loom .shutdown () end
Original file line number Diff line number Diff line change @@ -10,6 +10,12 @@ use std::{fs::File, path::Path};
1010fn main ( ) -> LuaResult < ( ) > {
1111 let lua = init ( ) ;
1212 lua. load ( Path :: new ( "main.lua" ) ) . exec ( ) ?;
13+
14+ match lua. load ( "loom.init()" ) . exec ( ) {
15+ Ok ( ( ) ) => ( ) ,
16+ Err ( _) => ( ) ,
17+ } ;
18+
1319 game_loop (
1420 & 60.0 ,
1521 || match lua. load ( "loom.tick()" ) . exec ( ) {
@@ -21,6 +27,12 @@ fn main() -> LuaResult<()> {
2127 Err ( _) => ( ) ,
2228 } ,
2329 ) ;
30+
31+ match lua. load ( "loom.shutdown()" ) . exec ( ) {
32+ Ok ( ( ) ) => ( ) ,
33+ Err ( _) => ( ) ,
34+ } ;
35+
2436 Ok ( ( ) )
2537}
2638
You can’t perform that action at this time.
0 commit comments