SDL::App::FPS

SDL::App::FPS is a framework for event-driven SDL games/applications.
Download

SDL::App::FPS Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Tels
  • Publisher web site:
  • http://search.cpan.org/~tels/

SDL::App::FPS Tags


SDL::App::FPS Description

SDL::App::FPS is a framework for event-driven SDL games/applications. SDL::App::FPS is a framework for event-driven SDL games/applications.SYNOPSISSubclass SDL::App::FPS and override some methods: package SDL::App::MyFPS; use strict; use SDL::App::FPS; use SDL; use base qw/SDL::App::FPS/; # override the method draw_frame with something to draw sub draw_frame { my ($self,$current_time,$lastframe_time,$current_fps) = @_; ... } # override post_init_handler and add some event handlers sub post_init_handler { my ($self} = shift; my $self->add_event_handler(SDL_KEYDOWN, SDLK_q, sub { my $self = shift; $self->quit(); } ); # or easier for often-used events (note quoted 'SDLK_f'!) $self->watch_event( fullscreen => 'SDLK_f', pause => 'p', quit => 'SDLK_q', ); # You can also specify the key/mousebutton bindings for these events # in the config file like "bind_event_fullscreen = f" }Then write a small script using SDL::App::MyFPS like this: #!/usr/bin/perl -w use strict; use SDL::App::MyFPS; # fill in here default options if you like my $options = { }; # create a new application including window # automatically uses a config file or the command line: my $app = SDL::App::MyFPS->new( $options ); # run the application, will exit when done $app->main_loop();That's all! Requirements: · Perl


SDL::App::FPS Related Software