grondilu has asked for the wisdom of the Perl Monks concerning the following question:
Hi monks,
I was reading SDL::Manual, and after having followed instructions for installation (with cpan), I tried the first examples.
Creating a window works. I get a black window with this basic code:
use strict; use warnings; use SDL; use SDLx::App; my $app = SDLx::App->new(w => 400, h => 400); sleep(4);
But if I try to draw something, such as a line (as in the book):
use strict; use warnings; use SDL; use SDLx::App; my $app = SDLx::App->new(w => 400, h => 400, d => 32); $app->draw_line( [200, 20], [20, 200], [255, 255, 0, 255] ); $app->update(); sleep(4);
Then the screen stays totally black. No error message, no warning. I guess something is wrong with the installation of the library. Any idea on how I could fix that?
UPDATE: It seems that I can make things appear when I call $app->run();
It's not what is in the manual, though. And when I call this, I can't stop the processus anymore, not even with Ctrl-C :/
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Failing to use SDL
by rnewsham (Curate) on Jun 17, 2013 at 06:41 UTC | |
by grondilu (Friar) on Jun 17, 2013 at 07:06 UTC | |
Re: Failing to use SDL
by Anonymous Monk on Jun 17, 2013 at 06:08 UTC | |
by grondilu (Friar) on Jun 17, 2013 at 07:01 UTC |
Back to
Seekers of Perl Wisdom