#!/usr/bin/perl #Tut bei Mausbewegung einzelne Pixel färben use strict; use warnings; use SDL; use SDL::App; use SDL::Color; my $app = new SDL::App ( -title => 'einzelne Pixel faerbender Test', -width => 640, -height => 480, -depth => 32, ); my %actions = ( SDL_QUIT() => sub { exit(0); }, SDL_MOUSEMOTION() => \&keydown, ); $app->loop(\%actions); sub keydown { my $farbe = SDL::Color->new( -r => int(rand(255)), -g => int(rand(255)), -b => int(rand(255)), ); $app->pixel(int(rand(640)), int(rand(480)), $farbe); }