PageRenderTime 8ms CodeModel.GetById 1ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/examples/cookbook/1.pl

http://github.com/PerlGameDev/SDL
Perl | 27 lines | 18 code | 9 blank | 0 comment | 4 complexity | 6b1bc46b7d20d46c96da9688c36590fb MD5 | raw file
 1use strict;
 2use warnings;
 3
 4use SDL;
 5use SDL::Rect;
 6use SDL::Event;
 7use SDL::Video;
 8use SDL::Events;
 9use SDL::Surface;
10
11SDL::init(SDL_INIT_VIDEO);
12
13my $display = SDL::Video::set_video_mode( 320, 320, 32, SDL_SWSURFACE );
14
15my $quit = 0;
16while ( !$quit ) {
17	my $event = SDL::Event->new();
18
19	SDL::Events::pump_events();
20
21	while ( SDL::Events::poll_event($event) ) {
22
23		$quit = 1 if ( $event->type == SDL_QUIT );
24
25	}
26
27}