load_bytecode('Protoobject.pbc'); load_bytecode('SDL/App.pir'); Protomaker.new_proto('SDL::App'); load_bytecode('SDL/Rect.pir'); Protomaker.new_proto('SDL::Rect'); load_bytecode('SDL/Color.pir'); Protomaker.new_proto('SDL::Color'); # create an SDL::App object my $app := SDL::App.new(); $app.init( :height(480), :width(640), :bpp(0), :flags(1) ); # fetch the SDL::Surface representing the main window my $main_screen := $app.surface(); # create an SDL::Rect object my $rect := SDL::Rect.new(); $rect.init( :height(100), :width(100), :x(270), :y(190) ); # create an SDL::Color object my $color := SDL::Color.new(); $color.init( :r(0), :g(0), :b(255) ); # draw the rectangle to the surface and update it $main_screen.fill_rect( $rect, $color ); $main_screen.update_rect( $rect ); # pause for people to see it sleep(2); # and that's it! $app.quit();