X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pages%2Fblog-0010.html-inc;h=e65be37dd7211e92b433042690e9c72fb1ba4899;hb=55bbf7a209993f4172fd7e6555dda0947b844089;hp=3914b4b1e8ae3f549bc78ea4ee1ee1c6bad804eb;hpb=6e0d970b5047980a17d230b86d5c27c49213d18c;p=sdlgit%2FSDL-Site.git diff --git a/pages/blog-0010.html-inc b/pages/blog-0010.html-inc index 3914b4b..e65be37 100644 --- a/pages/blog-0010.html-inc +++ b/pages/blog-0010.html-inc @@ -1,6 +1,36 @@

-Updates, Falling Block Game, and Hack Fest +Hello Mouse? An Example of the New Event Code

-
Silent but active,
Small but deadly.



Updates

Ok so my blog posts have gone down a bit due to me using my fingers for coding. We have started to get some updates to SDL docs so that good. Also some of the tutorials are shaping up. This is what I have been hacking this past week.









You can grab the code. Note you will have to install deps yourself. Read the README file. It is not a tutorial yet, because it was hacked together in ~50 hours. But it playable now. During building this I found out that MacOSX (and Snow Leopard) has died again.

Hackfest

So with dngor's help this sunday (27/09/09) we will have a hackfest to fix MacOSX support. Anyone with a MacOSX and wants to help is welcome on #sdl irc.perl.org. We will also try to fix up a lot of docs and the tutorial for a early next week release. Also if we can we will migrate to the new site.
\ No newline at end of file +
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