So over the past week we have been working hard to release the next Alpha for SDL-2.3. In this release we have ported SDL_Image completely, fixed false negatives in our testing suite, improved conditional building. Also we have also started to migrate the very pretty SDL_GFX library. Here is the test for it, enjoy.
Sunday, December 6, 2009
SDL Alpha 2: A sneak preview
So over the past week we have been working hard to release the next Alpha for SDL-2.3. In this release we have ported SDL_Image completely, fixed false negatives in our testing suite, improved conditional building. Also we have also started to migrate the very pretty SDL_GFX library. Here is the test for it, enjoy.
Monday, November 30, 2009
Developer Release of SDL 2.3_1
The city of Rome was built,
with the first brick.
Alpha Release of new API
After a considerable amount of hacking and rewriting we have release the first development release of SDL perl on CPAN.Overview of 2.3_1
In this version our goal was to tackle the proper allocations and destruction of SDL resources. We have accomplished this for all SDL Core structures. Moreover we have also improved the test suite and documentation considerably. Please read the CHANGELOG for a more detailed look.Next steps
- Complete bindings for Image, Mixer, ... so on
- Come up with a method to provide threading in callbacks
- Maintain and improve SDL Core as results for CPANTS come in
--yapgh
Thursday, November 26, 2009
SDL Perl Documentation: Reviewers need
The written word,
survives;
the tests of Time,
the fires of Hades,
and wrath of Pluto.
Documentation
In an effort to learn from past versions of SDL Perl and improve. We have been writing lots of documentation for our users. Of course since this is the first time we have been providing documentation we need your help. Please review our docs, at sdl.perl.org and give us some feed back. Send us the feeback at sdl-devel@mail.org or join us at #sdl irc.perl.org
--yapgh
Sunday, November 15, 2009
Migrating Sol's Tutorial of SDL to SDL_Perl
Sol's Tutorials
When I was struggling with SDL C a while ago, someone recommended Sol's Tutorial to me. It had not only help me understand video in SDL, but I believe my code has improved using Sol's code style. I would like to pass these along to fellow SDL_Perl users too. So here is the Ch 02 code of Sol's Tutorial in SDL_Perl. It will be getting more and more Perly as our team hacks on it. There is more to come!
To use this code you need the new Redesigned SDL_Perl Library
Getting SDL Dependencies
Only If you are on Linux (debian/ubuntu) you need the following dependencies:
$ sudo apt-get install libsdl-net1.2-dev libsdl-mixer1.2-dev libsmpeg-dev libsdl1.2-dev libsdl-image1.2-dev libsdl-ttf2.0-dev
On Windows we recommend using Strawberry Perl. It comes with SDL-1.2.13 header files and libs included.
Both Windows and Linux needs to install Alien::SDL
$ cpan Alien::SDL** Add sudo to this for Linux
Getting Bleeding SDL
The bleeding SDL is on github. Click download on this site .
Extract it and cd into the folder run
$ cpan .** The dot is needed
** in Linux you may need to do sudo
Then you can run this script by doing
$ perl examples/sols/ch02.pl
Thursday, November 12, 2009
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
Wednesday, November 11, 2009
Hello Mouse? An Example of the New Event 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);
}
Monday, November 9, 2009
Development Update
Had an exam on the weekend so I am a bit late. Here is the progress so far.
- SDL::Video at 97%
- SDL::Events at 25%
- ~1000 tests cases passing on Windows and Linux
The major release maybe coming quicker than we thought. FROGGS++ for helping a lot out on this. However we need more testers!! Please contact us on #sdl and we will set you up with an account on Smolder.
[Edit] Please read http://sdlperl.ath.cx/projects/SDLPerl/wiki/Testing on how to get started in test!


