From: Tobias Leich Date: Fri, 13 Nov 2009 18:21:01 +0000 (+0100) Subject: index page X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=49ebb445de00e08c89e5b0d4aa261f6948f59daa;p=sdlgit%2FSDL-Site.git index page --- diff --git a/pages/index.html-inc b/pages/index.html-inc index e7261d5..d279c1f 100644 --- a/pages/index.html-inc +++ b/pages/index.html-inc @@ -1,6 +1,172 @@ -
-

-Once in a while .... (set_event_filter) -

-
-

Once in a while
Things just work!



So I have been hacking for a while on SDL::Events::set_event_filter. The code below is an example usage. The magic behind this is here

 1 #!/usr/bin/perl -w
2
use strict;
3 use warnings;
4 use SDL v2.3; #Require the redesign branch
5
use SDL::Video;
6 use SDL::Event;
7 use SDL::Events;
8
9 SDL::init(SDL_INIT_VIDEO);
10 my $display = SDL::Video::set_video_mode(640,480,32, SDL_SWSURFACE );
11 my $event = SDL::Event->new();
12
13 #This filters out all ActiveEvents
14
my $filter = sub {
15 my ($e, $type) = ($_[0], $_[0]->type);
16 if($type == SDL_ACTIVEEVENT){ return 0 }
17 elsif($type == SDL_MOUSEBUTTONDOWN && $e->button_button == 1){ return 0 }
18 else { return 1; }
19 };
20
21 SDL::Events::set_event_filter($filter);
22
23 while(1)
24 {
25
26 SDL::Events::pump_events();
27 if(SDL::Events::poll_event($event))
28 {
29
30 if( $event->type == SDL_ACTIVEEVENT)
31 {
32 print "Hello Mouse!!!\n" if ($event->active_gain && ($event->active_state == SDL_APPMOUSEFOCUS) );
33 print "Bye Mouse!!!\n" if (!$event->active_gain && ($event->active_state == SDL_APPMOUSEFOCUS) );
34 }
35 if( $event->type == SDL_MOUSEBUTTONDOWN)
36 {
37 my ($x, $y, $but ) = ($event->button_x, $event->button_y, $event->button_button);
38 warn "$but CLICK!!! at $x and $y \n";
39 }
40
41 last if($event->type == SDL_QUIT);
42 }
43 }
44 SDL::quit()
 
 
Tinker with $filter and look at perldoc lib/SDL/pods/Event.pod. 
 
Have fun,
--yapgh
\ No newline at end of file +
+ + + +

Simple DirectMedia Library Bindings for Perl

+ +

Welcome to the new SDL Perl pages, +graciously hosted by Perl.org.

+ +

Latest News

+ +

28 August 2009 SDL_Perl is at v2.3

+ +

The master branch is stable at v2.3 . +This release is disable for windows for now. +This version provides a lot of critical bugfixes from the previous release on cpan. +Read the CHANGELOG.

+ +

Work is being done on v2.4 to add major over haul for memleaks. +The bleeding edge code is available from http://github.com/kthakore/SDL_Perl/. +The experimental branch is where the v2.4 will be developed.

+ +

Also http://frozen-bubble.org/ is being migrated to CPAN as Games::FrozenBubble. +This is being tracked on our new tracker http://sdlperl.ath.cx/projects/SDLPerl/. +We have opened a ticket for ithttp://sdlperl.ath.cx/projects/SDLPerl/ticket/2.

+ +

Also the https://rt.cpan.org/Dist/Display.html?Queue=SDL_perl is active again. +We are cleaning up bugs and responding to reporters. +See http://search.cpan.org/~kthakore/SDL_Perl-v2.2.2/lib/SDL.pm. +Please report any strange behavior to the bug tracker. +--Kartik

+ +

Tutorials Online!

+ +

Updated and Working coming soon!!!

+ +

Of course, +if you grab a snapshot and install it, +not only can you report successes (and probably a few bugs), +but you can play with the demo program for each tutorial! +It's very fun.

+ +

Articles

+ +

Developing games with Perl and SDL on Ars Technica written by Andy Bakun http://arstechnica.com/gaming/news/2006/02/games-perl.ars

+ +

Note this is old.

+ +

A Little History

+ +

Why are these pages new? +In October, +David Göhrig, +the creator and maintainer of SDL Perl, +announced that he was quitting his job, +selling all his stuff, +and going backpacking in Europe for a few months. +That left SDL Perl without a maintainer or a home. +But SDL Perl is back and running with Kartik and David's help.

+ +

Future Plans

+ +

We're working on polishing the latest code available to make the v2.5 release. +Here is the roadmap so far. + +http://wiki.github.com/cthulhuology/SDLPerl

+ +

Hopefully, +Perl will soon be a wonderful language in which to write media applications -- including games.

+ +

Mailing list

+ +

Subscribe to the development list by sending an e-mail to sdl-devel-subscribe@perl.org. +Subscribe to the source code changes list by sending an e-mail to sdl-changes-subscribe@perl.org.

+ +

The archives of the mailing list is here http://www.nntp.perl.org/group/perl.sdl.devel/.

+ +

IRC

+ +

The IRC channel used by the SDL Perl people is #sdl on irc.perl.org. +If you have an IRC client use this link: irc://irc.perl.org/%23sdl If you don't have an IRC client you can use the Mibbit web based IRC client by clicking here: http://widget.mibbit.com/?server=irc.perl.org&channel=%23sdl

+ +

Our IRC channel is logged here

+ +

http://irclog.perlgeek.de/sdl/today

+ +

Applications

+ +

App-Fotagger is an application to add tags to images. +It was the first attempt of Thomas Klausner at SDL and it can be improved a lot: http://search.cpan.org/dist/App-Fotagger

+ +

Games

+ +

The original Frozen Bubble http://www.frozen-bubble.org/ is probably the most well known application written in SDL Perl.

+ +

Thomas Klausner has started a Space Invaders clone in SDL Perl. +You can find the code on Github http://github.com/domm/Game-PerlInvaders.

+ +

Kartik Thakore has started a falling block game

+ +

You can find the code on Github http://github.com/kthakore/TetrisPL.

+ +

Related Links

+ +
+ +
http://www.libsdl.org/
+ +
+

The SDL Homepage

+ +
http://wiki.github.com/kthakore/SDL_perl/dependencies
+ +
+

Where to find SDL dependencies

+ +
http://yapgh.blogspot.com
+ +
+

Updated info from maintainer. +=back

+
+
+ + + +
+