/[VRac]/M6502/Screen.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /M6502/Screen.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 76 by dpavlin, Wed Aug 1 12:57:15 2007 UTC revision 96 by dpavlin, Thu Aug 2 13:58:26 2007 UTC
# Line 235  sub render_mem { Line 235  sub render_mem {
235          $app->sync;          $app->sync;
236  }  }
237    
238    =head2 loop
239    
240    Implement SDL event loop
241    
242    =cut
243    
244    sub loop {
245            my $self = shift;
246            my $event = SDL::Event->new();
247    
248            my $run_for = 2000;
249    
250            MAIN_LOOP:
251            while ( 1 ) {
252                    while ($event->poll) {
253                            my $type = $event->type();
254    
255                            last MAIN_LOOP if ($type == SDL_QUIT);
256                            last MAIN_LOOP if ($type == SDL_KEYDOWN && $event->key_name() eq 'escape');
257    
258                            if ($type == SDL_KEYDOWN) {
259                                    $run_for = $self->cli;
260                            }
261                    }
262                    M6502::exec($run_for);
263            }
264    }
265    
266  =head1 SEE ALSO  =head1 SEE ALSO
267    
268  L<Orao> is sample implementation using this module  L<Orao> is sample implementation using this module

Legend:
Removed from v.76  
changed lines
  Added in v.96

  ViewVC Help
Powered by ViewVC 1.1.26