main-loop.nv
@@ -1,3 +1,23 @@ | |||
1 | + | |_| Ports for reading and writing events | |
2 | + | |#port, on start polling, needs, @start polling| | |
3 | + | |#port, on poll input, needs, @poll input| | |
4 | + | , @event keypressed | |
5 | + | , @event keyreleased | |
6 | + | , @event mousemoved | |
7 | + | , @event mouse pressed | |
8 | + | , @no events left | |
9 | + | ||
10 | + | |#port, on quit love, needs, @quit love| | |
11 | + | @exit code | |
12 | + | ||
13 | + | |#port, on step timer, needs, @step timer| | |
14 | + | ||
15 | + | |#port, on clear screen, needs, @clear screen| | |
16 | + | ||
17 | + | |#port, on present, needs, @present| | |
18 | + | ||
19 | + | |#port, on sleep, needs, @sleep, takes, @sleep| | |
20 | + | ||
1 | 21 | |_| The main application loop | |
2 | 22 | |run main loop| | |
3 | 23 | , start polling inputs |
main-loop.nv(文件已创建)
@@ -0,0 +1,39 @@ | |||
1 | + | |_| The main application loop | |
2 | + | |run main loop| | |
3 | + | , start polling inputs | |
4 | + | , poll input | |
5 | + | , handle input | |
6 | + | , run current frame | |
7 | + | ||
8 | + | |start polling inputs| | |
9 | + | , @start polling | |
10 | + | ||
11 | + | |poll input| | |
12 | + | , @poll input | |
13 | + | ||
14 | + | |handle input, @no events left| | |
15 | + | ||
16 | + | |handle input| | |
17 | + | , handling input | |
18 | + | , poll input | |
19 | + | , handle input | |
20 | + | ||
21 | + | |run current frame, @event quit| | |
22 | + | , @quit love | |
23 | + | ||
24 | + | |run current frame| | |
25 | + | , step timer | |
26 | + | , clear the screen | |
27 | + | , update scene state | |
28 | + | , draw scene | |
29 | + | , present current frame | |
30 | + | , sleep for 1ms | |
31 | + | , next cycle | |
32 | + | ||
33 | + | | step timer | @step timer | |
34 | + | | clear the screen | @clear screen | |
35 | + | | update scene state | updating scene | |
36 | + | | draw scene | drawing scene | |
37 | + | | present current frame | @present | |
38 | + | | sleep for 1ms | @sleep | |
39 | + | | next cycle | run main loop |
上一页
下一页