Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use strict;
- use warnings;
- use SDL::Event;
- use SDLx::App;
- my $app = SDLx::App->new(
- width => 640,
- height => 480,
- exit_on_quit => 1,
- );
- $app->add_show_handler(
- sub {
- $app->draw_ellipse_filled( [ 320, 240 ], 100, 75, 0x0000FFFF );
- $app->update();
- }
- );
- $app->add_event_handler(
- sub {
- my ($event) = @_;
- if ( $event->type == SDL_KEYUP && $event->key_sym == SDLK_RETURN ) {
- SDL::Video::save_BMP( $app, 'ellipse.bmp' );
- }
- }
- );
- $app->run();
Add Comment
Please, Sign In to add comment