Guest User

Untitled

a guest
Jan 21st, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.19 KB | None | 0 0
  1. use strict;
  2. use warnings;
  3. use SDL::Event;
  4. use SDLx::App;
  5.  
  6. my $app = SDLx::App->new(
  7. width => 640,
  8. height => 480,
  9. exit_on_quit => 1,
  10. );
  11.  
  12. $app->add_show_handler(
  13. sub {
  14. $app->draw_ellipse_filled( [ 320, 240 ], 100, 75, 0x0000FFFF );
  15. $app->update();
  16. }
  17. );
  18.  
  19. $app->add_event_handler(
  20. sub {
  21. my ($event) = @_;
  22.  
  23. if ( $event->type == SDL_KEYUP && $event->key_sym == SDLK_RETURN ) {
  24. SDL::Video::save_BMP( $app, 'ellipse.bmp' );
  25. }
  26. }
  27. );
  28.  
  29. $app->run();
Add Comment
Please, Sign In to add comment