Personal tools

SDL:Perl.pl

From OrganicDesign Wiki

Jump to: navigation, search
#!/usr/bin/perl
#
use warnings;
#use strict;
 
use SDL;
use SDL::App;
use SDL::Constants;
use SDL::Surface;
use SDL::Rect;
#use SDL::Video;
 
my $app = new SDL::App (
                -width => 1024,
                -height => 768,
                -depth => 24 );
 
$app->fullscreen(1); 
 
# a 1024x768 background image
my $background= SDL::Surface->new( -name => 'test-card.png' );
# a smaller image with alpha transparency
my $planet= SDL::Surface->new( -name => 'jupiter.png' );
 
 
my $frame_rect = SDL::Rect->new(
                -width  => 1024,
                -height => 768, 
                -x      => 0,
                -y      => 0,
                );
 
my $dest_rect = SDL::Rect->new(
                -width  => 1024,
                -height => 768, 
                -x      => 0,
                -y      => 0,
                );
 
 
 
	$background->blit( $frame_rect, $app, $dest_rect );
	$planet->blit( $frame_rect, $app, $dest_rect );
 
	$app->update( $frame_rect );
 
	sleep 5;

The GNU Project Debian Linux Ubuntu Linux Wikipedia online encycopedia MediaWiki