… | |
… | |
2162 | |
2162 | |
2163 | my $refresh_watcher = Event->timer (after => 0, hard => 0, interval => 1 / $MAX_FPS, cb => sub { |
2163 | my $refresh_watcher = Event->timer (after => 0, hard => 0, interval => 1 / $MAX_FPS, cb => sub { |
2164 | $NOW = time; |
2164 | $NOW = time; |
2165 | |
2165 | |
2166 | ($SDL_CB{$_->{type}} || sub { warn "unhandled event $_->{type}" })->($_) |
2166 | ($SDL_CB{$_->{type}} || sub { warn "unhandled event $_->{type}" })->($_) |
2167 | for CFPlus::SDL_PollEvent; |
2167 | for CFPlus::poll_events; |
2168 | |
2168 | |
2169 | if (%animate_object) { |
2169 | if (%animate_object) { |
2170 | $_->animate ($LAST_REFRESH - $NOW) for values %animate_object; |
2170 | $_->animate ($LAST_REFRESH - $NOW) for values %animate_object; |
2171 | $WANT_REFRESH++; |
2171 | $WANT_REFRESH++; |
2172 | } |
2172 | } |