X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pages%2Fblog-0005.html-inc;h=f5164b6c4aa8a15edc4eb2b79002cc7281a228ce;hb=1d5d4d44a3acf89f7820195b5016f4ebc4489250;hp=83a05ba23c0e352fd270773c2f64bbc88ba2ff59;hpb=50ebf4949c9eed8f2d3fb629f12d11e95ec4e938;p=sdlgit%2FSDL-Site.git diff --git a/pages/blog-0005.html-inc b/pages/blog-0005.html-inc index 83a05ba..f5164b6 100644 --- a/pages/blog-0005.html-inc +++ b/pages/blog-0005.html-inc @@ -1,6 +1,12 @@

-Hello Mouse? An Example of the New Event Code +Introducing SDLx::Controller::Object, with our good friend Mario!

-
Any code that is not marketed is dead code
--mst


You need the new code from the redesign branch to use this .

#!/usr/bin/env perl

use SDL;
use SDL::Events;
use SDL::Event;
use SDL::Video;

SDL::init(SDL_INIT_VIDEO);

my $display = SDL::Video::set_video_mode(640,480,32, SDL_SWSURFACE );
my $event = SDL::Event->new();

while(1)
{
SDL::Events::pump_events();

if(SDL::Events::poll_event($event) && $event->type == SDL_ACTIVEEVENT)
{
print "Hello Mouse!!!\n" if ($event->active_gain && ($event->active_state == SDL_APPMOUSEFOCUS) );
print "Bye Mouse!!!\n" if (!$event->active_gain && ($event->active_state == SDL_APPMOUSEFOCUS) );
}

exit if($event->type == SDL_QUIT);
}
\ No newline at end of file + Hi Folks
+
+This past week I have been working on making interfacing physics with SDL rendering a lot easier. The idea was to provide the user a callback to describe the acceleration of their object in the X, Y axis and Rotation. Using this idea I have completed a preliminary work for SDLx::Controller::Object. The demo below shows an example that was made with it. The SDLx* code is available at http://github.com/kthakore/SDL_perl and demo code is available at http://github.com/kthakore/scroller.
+
+
Mario Demo using SDL Perl from SDLPerl on Vimeo.
+


+

\ No newline at end of file