holli has asked for the wisdom of the Perl Monks concerning the following question:
i stumbled about the SDL::Library because i want to write a screensaver in perl. the docs are somewhat taciturn. so i decided to create a simple hello world. i assembled this:
use SDL::App; use SDL::Rect; use SDL::Event; use SDL::Constants; use SDL::Tool::Font; my $app = SDL::App->new ( -width => 640, -height => 480, -depth => 16, ); my $rect = SDL::Rect->new ( -height => 100, -width => 100, -x => 270, -y => 390, ); my $f = SDL::Tool::Font->new( -ttfont=>"Courier", ); my %actions = ( SDL_QUIT() => sub { exit(0); }, SDL_KEYDOWN() => sub { $f->print ($rect, 0, 0, "Key Pressed"); }, ); $app->loop(\%actions);
From what i´ve read this should work, but when i run it perl crashes. The exit code is -1073741819.
my os is winxp, perl is 5.8.6, SDL-library is 2.1
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Hello world using SDL::App
by jbrugger (Parson) on Dec 31, 2004 at 19:53 UTC | |
|
Re: Hello world using SDL::App
by jbrugger (Parson) on Jan 22, 2005 at 15:09 UTC |