#!/usr/bin/perl use strict; no warnings; use SDL; use SDL::Video; use SDL::Surface; use SDL::Rect; use constant WIDTH => 400; use constant HEIGHT => 300; SDL::init( SDL_INIT_VIDEO ); my $screen = SDL::Video::set_video_mode( WIDTH, HEIGHT, 32, SDL_SWSURFACE ); my $mcolor = SDL::Video::map_RGB($screen->format(), 255, 0, 0); SDL::Video::fill_rect($screen, SDL::Rect->new( WIDTH / 4, HEIGHT / 4, WIDTH / 2, HEIGHT / 2), $mcolor); SDL::Video::update_rect( $screen, 0, 0, WIDTH, HEIGHT ); sleep 10; SDL::quit();