… | |
… | |
2152 | debug sprintf "%3.2f", $fps if $ENV{CFPLUS_DEBUG} & 4; |
2152 | debug sprintf "%3.2f", $fps if $ENV{CFPLUS_DEBUG} & 4; |
2153 | |
2153 | |
2154 | $CFPlus::UI::ROOT->draw; |
2154 | $CFPlus::UI::ROOT->draw; |
2155 | |
2155 | |
2156 | $WANT_REFRESH = 0; |
2156 | $WANT_REFRESH = 0; |
2157 | $CAN_REFRESH = 0; |
2157 | $CAN_REFRESH = 0; |
2158 | $LAST_REFRESH = $NOW; |
2158 | $LAST_REFRESH = $NOW; |
2159 | |
2159 | |
2160 | CFPlus::SDL_GL_SwapBuffers; |
2160 | CFPlus::SDL_GL_SwapBuffers; |
2161 | } |
2161 | } |
2162 | |
2162 | |
… | |
… | |
2166 | ($SDL_CB{$_->{type}} || sub { warn "unhandled event $_->{type}" })->($_) |
2166 | ($SDL_CB{$_->{type}} || sub { warn "unhandled event $_->{type}" })->($_) |
2167 | for CFPlus::poll_events; |
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 | } |
2173 | |
2173 | |
2174 | if ($WANT_REFRESH) { |
2174 | if ($WANT_REFRESH) { |
2175 | force_refresh; |
2175 | force_refresh; |
2176 | } else { |
2176 | } else { |