Skip to content

Commit

Permalink
Merge pull request #2 from boringcactus/patch-1
Browse files Browse the repository at this point in the history
tidy up function call example in README
  • Loading branch information
Jengamon authored Sep 22, 2020
2 parents 93b13d2 + 55cf85d commit fb79aec
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ class GameEngine {
"##).unwrap();
let handle = vm.make_call_handle(FunctionSignature::new_function("update", 1));
vm.execute(|vm| {
vm.ensure_slots(2);
vm.get_variable("main", "GameEngine", 0);
vm.set_slot_double(0, 0.016);
vm.set_slot_double(1, 0.016);
});
vm.call_handle(&handle);
```
Expand All @@ -64,8 +65,9 @@ class GameEngine {
}
"##).unwrap();
vm.execute(|vm| {
vm.ensure_slots(2);
vm.get_variable("main", "GameEngine", 0);
vm.set_slot_double(0, 0.016);
vm.set_slot_double(1, 0.016);
});
vm.call(FunctionSignature::new_function("update", 1));
```
Expand Down Expand Up @@ -130,4 +132,4 @@ fn main() {

// This should print "9".
}
```
```

0 comments on commit fb79aec

Please sign in to comment.