From: Kartik Thakore Date: Thu, 1 Jul 2010 18:09:53 +0000 (+0000) Subject: Update X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ca0a3441dd72000cbbbb4be484b18d0d305fdb29;p=sdlgit%2FSDL-Site.git Update --- diff --git a/pages/SDL-Cookbook-OpenGL.html-inc b/pages/SDL-Cookbook-OpenGL.html-inc new file mode 100644 index 0000000..11328ab --- /dev/null +++ b/pages/SDL-Cookbook-OpenGL.html-inc @@ -0,0 +1,174 @@ +
+ +

Index

+ +
+ + +

NAME

Top

+
+

SDL::Cookbook::OpenGL - Using SDL with OpenGL

+ +
+

CATEGORY

Top

+
+

Cookbook

+ +
+

DESCRIPTION

Top

+
+

As of release 2.5 SDL no longer maintains it's own bindings of openGL. Support for openGL has been moved over to a more mature implementation.

+

This implementation is the POGL project. OpenGL is faster and more complete; and works with SDL seemlessly.

+ +
+

EXAMPLE

+
+

Expanded from Floyd-ATC's OpenGL example.

+
+
+
+	use strict;
+	use warnings;
+	use SDL;
+	use SDLx::App;
+	use SDL::Mouse;
+	use SDL::Video;
+	use SDL::Events;
+	use SDL::Event;
+	use OpenGL qw(:all);
+
+	my ($SDLAPP, $WIDTH, $HEIGHT, $SDLEVENT);
+
+	$| = 1;
+	$WIDTH = 1024;
+	$HEIGHT = 768;
+	$SDLAPP = SDLx::App->new(-title => "Opengl App", -width => $WIDTH, -height => $HEIGHT, -gl => 1);
+	$SDLEVENT = SDL::Event->new;
+
+
+
+
+	glEnable(GL_DEPTH_TEST);
+	glMatrixMode(GL_PROJECTION);
+	glLoadIdentity;
+	gluPerspective(60, $WIDTH / $HEIGHT, 1, 1000);
+	glTranslatef(0, 0, -20);
+
+
+
+
+	while (1) {
+	  &handlepolls;
+	  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+	  glRotatef(.1, 1, 1, 1);
+	  &drawscene;
+	  $SDLAPP->sync;
+	}
+
+
+
+
+
+
+
+	sub drawscene {
+	  my ($color, $x, $y, $z);
+
+	  for (-2 .. 2) {
+	    glPushMatrix;
+	    glTranslatef($_ * 3, 0, 0);
+	    glColor3d(1, 0, 0);
+	    &draw_cube;
+	    glPopMatrix;
+	  }
+
+	  return "";
+	}
+
+
+
+
+
+
+
+
+
+
+
+
+
+	sub draw_cube {
+	  my (@indices, @vertices, $face, $vertex, $index, $coords);
+
+	  @indices = qw(4 5 6 7   1 2 6 5   0 1 5 4
+			0 3 2 1   0 4 7 3   2 3 7 6);
+	  @vertices = ([-1, -1, -1], [ 1, -1, -1],
+		       [ 1,  1, -1], [-1,  1, -1],
+		       [-1, -1,  1], [ 1, -1,  1],
+		       [ 1,  1,  1], [-1,  1,  1]);
+
+	  glBegin(GL_QUADS);
+
+	  foreach my $face (0..5) {
+	    foreach my $vertex (0..3) {
+	      $index  = $indices[4 * $face + $vertex];
+	      $coords = $vertices[$index];
+
+	      glVertex3d(@$coords);
+	    }
+	  }
+
+	  glEnd;
+
+	  return "";
+	}
+
+
+
+
+
+
+
+
+
+
+	sub handlepolls {
+	  my ($type, $key);
+
+	  SDL::Events::pump_events();
+
+	  while (SDL::Events::poll_event($SDLEVENT)) {
+	    $type = $SDLEVENT->type();
+	    $key = ($type == 2 or $type == 3) ? $SDLEVENT->key_sym : "";
+
+	    if ($type == 4) { printf("You moved the mouse! x=%s y=%s xrel=%s yrel=%s\n", $SDLEVENT->motion_x, $SDLEVENT->motion_y, $SDLEVENT->motion_xrel, $SDLEVENT->motion_yrel) }
+	    elsif ($type == 2) { print "You are pressing $key\n" }
+	    elsif ($type == 3) { print "You released $key\n" }
+	    elsif ($type == 12) { exit }
+	    else { print "TYPE $type UNKNOWN!\n" }
+
+	    if ($type == 2) {
+	      if ($key eq "q" or $key eq "escape") { exit }
+	    }
+	  }
+
+	  return "";
+	}
+
+
+ +
+

SEE ALSO

Top

+ +
\ No newline at end of file diff --git a/pages/SDL-Cookbook-PDL.html-inc b/pages/SDL-Cookbook-PDL.html-inc index 6344860..3186d12 100644 --- a/pages/SDL-Cookbook-PDL.html-inc +++ b/pages/SDL-Cookbook-PDL.html-inc @@ -6,30 +6,13 @@ -
  • Perl's SDL in a nutshell
  • -
  • SDL - power through simplicity
  • -
  • Example 1: Model of a 2-D Noninteracting Gas - -
  • -
  • What's in a Name? Pesky conflicts with main::in() - +
  • Creating a SDL Surface piddle +
    @@ -48,600 +31,79 @@ Some of the particles can drift off the screen. This is no good. What's causing

    Cookbook

    -

    Perl's SDL in a nutshell

    Top

    -
    -

    SDL stands for Simple DirectMedia Layer. It's a cross-platform library written in C that's meant to handle all of the low-level graphics and sound stuff. You can read more about SDL here: http://www.libsdl.org/. Because SDL is focused on game programming, it has a raw but clean feel to it. We will focus for now on using SDL to handle images for us. Handling sound may some day be the focus of another chapter.

    -

    We will be using Perl's SDL module, not SDL directly. Fortunately, Perl's SDL module has a small collection of very simple tutorials that perfectly introduce basic usage. You can find them here: http://sdl.perl.org/tutorials/. Another excellent and very substantial introduction can be found here: http://arstechnica.com/gaming/news/2006/02/games-perl.ars

    -

    SDL is not a Perl core module, so you'll need to install it before moving forward. Before moving on, go through some of the tutorials and play around with SDL a little bit. Continue on once you think you've got the hang of it.

    +

    Creating a SDL Surface piddle

    Top

    +
    +

    PDL's core type is a piddle. Once a piddle is provided to PDL it can go do a numerous amounts of things. Please see the example in 'examples/cookbook/pdl.pl' that came with this module.

    -

    SDL - power through simplicity

    Top

    -
    -

    One of the first questions you're bound to ask when you begin using SDL for your own work is, "How do I draw a line?" As it turns out, you don't! SDL's pixmap capabilities are just that - pixmap capabilities. If you want to draw a line, you'll have to do it manually.

    -

    For example, here is a very poorly implemented hack (read - don't do this at home) that will draw a simple sine-wave graph:

    -
    	#!/usr/bin/perl
    -	use warnings;
    -	use strict;
    -
    -	use SDL;
    -	use SDL::App;
    -	use SDL::Rect;
    -	use SDL::Color;
    -	use SDL::Video;
    -
    -	# User defined pen-nib size.
    -	my $nib_size = 3;
    -
    -	# Create the SDL App
    -	my $app = SDL::App->new(
    -		-width  => 640,
    -		-height => 480,
    -		-depth  => 16,
    -		-title  => "Hello, World!",
    -	);
    -
    -	# our nib will be white
    -	my $nib_color = SDL::Color->new(
    -			0xff, #r
    -			0xff, #b
    -			0xff, #g
    -		);
    -
    -	# and our nib will be represented by a rectangle
    -	# (Alternatively, you could use an image, which would allow
    -	# for pretty anti-aliasing if you created it in GIMP with
    -	# antialiasing)
    -	my $nib = SDL::Rect->new( 
    -	    0 , 0, #x, y
    -     	$nib_size, #w
    -		$nib_size, #h
    -	);
    -
    -	# now draw a sine wave (wthout covering up previously drawn rectangles)
    -	my $t = 0;
    -	my $t_step = 2**-4;
    -	for($t = 0; $t < 50; $t += $t_step) {
    -		$nib->x( $t * 8 );
    -		$nib->y( sin($t) * 80 + 240 );
    -
    -		SDL::Video::fill_rect($app, $nib, $nib_color );
    -	}
    -
    -	# Generally use the update command, but if you want to update the whole
    -	# surface, use flip
    -	SDL::Video::fill_rect($app,)
    -
    -	sleep 5;
    +

    Creating a simple piddle

    +
    +

    First lets get the right modules.

    +
      use PDL;
    +  use SDL::Rect;
    +  use SDL::Video;
    +  use SDL::Surface;
    +  use SDL::PixelFormat;
     
     
    -

    Wait a second, you say, this doesn't seem either powerful or simple! You're right, but that's not because SDL is a poor tool. Rather, this example targets SDL's weaknesses rather than its strenghts.

    -

    If you need to make a plot, use PLplot or PGPLOT. If you need to make something move, use SDL.

    - -
    -

    Example 1: Model of a 2-D Noninteracting Gas

    Top

    -
    -

    In this section we'll develop a fully working animation/simulation. We'll start with something quite simple for now and expand it as we go along. The goal of this example is for it to work, not to be well-designed. For a discussion of making your simulations well-designed, read below.

    -

    We will separate our program into two parts: the computational logic and the animation logic. Here's the introduction and the computational part:

    - -
    -

    Computational Logic

    -
    -
    -
    -
    -	#!/usr/bin/perl
    -	# A simple simulation
    -	use warnings;
    -	use strict;
    -	use PDL;
    -
    -	# Set up the system parameters, including random positions and velocities.
    -	my $d_t = 2**-3;
    -	my $side_length = 200;
    -	my $numb_of_atoms = 100;
    -	my $positions = random(2, $numb_of_atoms) * $side_length;
    -	my $velocities = random(2, $numb_of_atoms) * 6;
    -
    -	sub compute {
    -		$positions += $d_t * $velocities;
    -	}
    +

    Suppose you want a surface of size (200,400) and 32 bit (RGBA).

    +
       my ( $bytes_per_pixel, $width, $height ) = ( 4, 200, 400 );
     
     
    -

    If you've ever written a simulation, you'll probably object that we don't have any iteration over time. You're right, but it turns out that the timing works much better in SDL's event loop than in our computational logic. The purpose of the computational logic is to let us focus on encoding our systems dynamics without having to worry about the application logic. In this case, the computational logic simply updates the positions of the particles according to their velocities.

    - -
    -

    Animation Logic

    -
    -

    We next need to figure out how the application is actually going to run and display anything. We'll do this in two stages, the application intialization and the run loop.

    -

    Here's some initialization code to get started; put this below the code already supplied above:

    -
    	use SDL;
    -	use SDL::App;
    -	use SDL::Rect;
    -	use SDL::Color;
    -	use SDL::Video;
    -
    -	# Create the SDL App
    -	my $app = SDL::App->new( -width  => $side_length, -height => $side_length, 
    -					-title  => "Simple Simulation!", -depth  => 16, );
    -
    -	# white particles on a black background
    -	my $particle_color = SDL::Color->new( 0xff, 0xff, 0xff, );
    -	my $bg_color = SDL::Color->new( 0x00, 0x00, 0x00 );
    -
    -	# rectangles for the particles and the background
    -	my $particle = SDL::Rect->new( 0,0, 5, 5);
    -	my $bg = SDL::Rect->new( 0,0,$side_length, $side_length, );
    +

    Define the $width, $height and $bytes_per_pixel. Your $bytes_per_pixel is the number of bits (in this case 32) divided by 8 bits per byte. Therefore for our 32 bpp we have 4 Bpp;

    +
       my $piddle  = zeros( byte, $bytes_per_pixel, $width, $height );
     
     
    -

    Hopefully this is straightforward code. We pull in our library dependencies and then create a few objects with the necessary properties. Finally, we get to the actual application loop:

    -
    	# Run the simulation by (1) computing the updated positions, clearing the canvas, drawing the
    -	# new particles, updating the visual display, and pausing before continuing:
    -	for(my $t = 0; $t < 20; $t += $d_t) {
    -		compute();
    -
    -		# Clean the canvas
    -		SDL::Video::fill_rect($app, $bg, $bg_color);
    -		for(my $i = 0; $i < $numb_of_atoms; $i++) {
    -			$particle->x( $positions->at(0,$i) );
    -			$particle->y( $positions->at(1,$i) );
    -			SDL::Video::fill_rect($app, $particle, $particle_color );
    -		}
    -		SDL::Video::flip($app);
    -		$app->delay(10);
    -	}
    -
    -
    -

    When you run this code (combined with the code already supplied), you should get a bunch of particles slowly drifting down and to the right. Not all that interesting, but then again, we have a simulation up and working! Cool!.

    - -
    -

    Disappearing Particles! -Some of the particles can drift off the screen. This is no good. What's causing this problem?

    -
    -

    The root of the problem is that our computational code is, well, rather dumb, it doesn't check to see if the particle is about to go off the screen. So, we need to update our computational code to look like this:

    -
    	sub compute {
    -		$positions += $d_t * $velocities;
    -
    -		# Find all particles that are 'outside' the box, place them back in
    -		# box, and reverse their directions
    -		my ($bad_pos, $bad_vel)
    -			= where($positions, $velocities, $positions > $side_length);
    -		$bad_vel *= -1;
    -		$bad_pos .= 2 * $side_length - $bad_pos;
    -	}
    +

    Create a normal $piddle with zeros, byte format and the Bpp x width x height dimensions.

    +
       my $pointer = $piddle->get_dataref();
     
     
    -

    With this change to the code, you should get particles that 'bounce' when the reach the far edge. This is far from satisfactory, however, because the compute code is adjusting the particle's ''left'' edge, not its center, so the particles nearly go off the screen before they bounce. To fix this, we work with an effective side length instead:

    -
    	my $effective_length = $side_length - 5;
    -	sub compute {
    -		$positions += $d_t * $velocities;
    -
    -		# Find all particles that are 'outside' the box and push them back in the
    -		# opposite direction, reversing their directions, too.
    -		my ($bad_pos, $bad_vel)
    -			= where($positions, $velocities, $positions > $effective_length);
    -		$bad_vel *= -1;
    -		$bad_pos .= 2 * $effective_length - $bad_pos;
    -	}
    +

    Here is where we get the acutal data the piddle is pointing to. We will have SDL create a new surface from this function.

    +
       my $surface = SDL::Surface->new_from( $pointer, $width, $height, 32,
    +        $width * $bytes_per_pixel );
     
     
    -

    So far I've been carrying that explicit constant of 5 to represent the size of the particles. We should put that in a variable somewhere so that it's a bitcode> and put it near the top. Also, the velocities are rather silly - we don't have any negative velocities. Let's try using <code>grandom</code> instead. Now your variable initialization code should look something like this:

    -
    	# Set up the system parameters, including random positions and velocities.
    -	my $d_t = 2**-3;
    -	my $side_length = 200;
    -	my $particle_size = 5;
    -	my $numb_of_atoms = 100;
    -	my $positions = random(2, $numb_of_atoms) * $side_length;
    -	my $velocities = grandom(2, $numb_of_atoms) * 5;
    +

    Using the same dimensions we create the surface using new_form. The width * Bpp is the scanline (pitch) of the surface in bytes.

    +
       warn "Made surface of $width, $height and ". $surface->format->BytesPerPixel;
    +   return ( $piddle, $surface );
     
     
    +

    Finally make sure that the surface acutally has the correct dimensions we gave.

    +

    NOTE: $surface->format->BytesPerPixel must return 1,2,3,4. !!

    +

    Now you can blit and use the surface as needed; and do PDL operations as required.

    -
    -

    Disappearing Particles, take 2

    -
    -

    Unless you experience an unusual circumstance, all of the particles will quickly shrivel up and disappear! What's going on? It turns out we have a problem with our computational logic again, but we are also running into strange behavior from SDL. We'll take a look at SDL's weird behavior first.

    -

    Clearly the particle rectangle's size is not supposed to change, but somehow it does. To confince yourself of this, modify the <code>for</code> loop in the application loop so it looks more like this, which explicitly sets the particle size for every particle that's drawn:

    -
    	for(my $i = 0; $i < $numb_of_atoms; $i++) {
    -		$particle->x( $positions->at(0,$i) );
    -		$particle->y( $positions->at(1,$i) );
    -		$particle->h( $particle_size );
    -		$particle->w( $particle_size );
    -		SDL::Video::fill_rect($app, $particle, $particle_color );
    -	}
    -
    -
    -

    Now it's clear that although we still have particles flying off the screen up and to the left, they are no longer shriveling away. This strange behavior is due to SDL's response to a negative position for a rectangle - it just resizes the rectangle so that it only the portion of the rectangle that's in positive territory remains. The upshot is that you must always be careful about how you handle drawing positons.

    -

    Now that the particles are no longer disappearing, it's clear that we forgot to set up a physical boundary condition for our particles on the uppper and left edges. To fix that, we modify the compute function:

    -
    	sub compute {
    -		$positions += $d_t * $velocities;
     
    -		# Find all particles that are 'outside' the box and push them back in the
    -		# opposite direction, reversing their directions, too.
    -		my ($bad_pos, $bad_vel)
    -			= where($positions, $velocities, $positions > $effective_length);
    -		$bad_vel *= -1;
    -		$bad_pos .= 2 * $effective_length - $bad_pos;
     
    -		($bad_pos, $bad_vel) = where($positions, $velocities, $positions < 0);
    -		$bad_vel *= -1;
    -		$bad_pos *= -1;
    -	}
     
    -
    -

    You can also remove the explicit particle-sizing that we put in before, because it's no longer a problem.

    -

    And there you have it! We have a fully fledged simulation of noninteracting particles in a box!

    -

    What's in a Name? Pesky conflicts with main::in()

    Top

    -
    -

    If you've been running your simulations along with the demo, you'll almost certainly have noticed an error looking something like this:

    -
     Prototype mismatch: sub main::in (;@) vs none at ./sdlsandbox.pl line 36
    +

    Operating on the Surface safely

    +
    +

    To make sure SDL is in sync with the data. You must call SDL::Video::lock before doing PDL operations on the piddle.

    +
        SDL::Video::lock_surface($surface);
     
    -
    -

    This is the unfortunate consequence of both SDL and PDL exporting their <code>in</code> function to their enclosing namespace. The standard solution to this is to have modify one of your <code>use</code> lines so it looks like

    -
    	 use PDL qw( !in );
    +    $piddle ( :, 0 : rand(400), 0 : rand(200) ) .=   pdl( rand(225), rand(225), rand(255), 255 );
     
     
    -

    Unfortunately, PDL doesn't listen you what you say when it imports functions into the namespace. As far as I can tell, neither does SDL. The best way to fix this problem is to encapsulate one of the two pieces of code into its own package. We'll do that with the MyComputation package.

    - -
    -

    Solution 1: Explicit scoping using packages

    -
    -

    Tweak your code a bit so that you call use PDL; within the MyCompute package, and place all of the piddles within that package space:

    -
    	package MyCompute;
    -	use PDL;
    -	my $positions = random(2, $numb_of_atoms) * $side_length;
    -
    -	# ... and later
    -	package main;
    -	use SDL;
    -
    -	# ... and later, tweak the application loop
    -	for(my $t = 0; $t < 20; $t += $d_t) {
    -		MyCompute::compute();
    +

    After that you can unlock the surface to blit.

    +
        SDL::Video::unlock_surface($surface);
     
     
    -

    And now everything should run fine, without any more warnings!

    -

    Solution 2: Removing SDL's in or PDL's in from the symbol table

    -
    -

    Sometimes you have to mix your animation code with computational code, in which case the above solution doesn't solve your problem. If you find that you don't need to use one of PDL's or SDL's <code>in</code> function in your own code, go ahead and remove it from the main symbol table. You can always get back to it later by fully qualifying the function call. To remove SDL's <code>in</code> function, use code like this:

    -
    	# use SDL, but remove SDL's in function before loading PDL
    -	use SDL;
    -	BEGIN {
    -		delete $main::{in};
    -	}
    -	use PDL;
    +

    Error due to BPP at blitting

    +
    +

    When blitting the new surface check for the return value to see if there has been a problem.

    +
        my $b = SDL::Video::blit_surface(
    +        $surface,  SDL::Rect->new( 0, 0, $surface->w, $surface->h ),
    +        $app, SDL::Rect->new(  ( $app->w - $surface->w ) / 2, ( $app->h - $surface->h ) / 2, $app->w, $app->h )
    +       );
     
    -
    -

    If you would rather have SDL's in function in your main symbol table, reverse the placement of <code>use SDcode and <code>use PDcode in the previous example:

    -
    	# use PDL, but remove its 'in' function before loading SDL
    -	use PDL;
    -	BEGIN {
    -		delete $main::{in};
    -	}
    -	use SDL;
    +    die "Could not blit: " . SDL::get_error() if ( $b == -1 );
     
     
    - -
    -

    Making the simulation interactive

    Top

    -
    -

    As the closing portion of this chapter, we'll consider how to make the simulation interactive. SDL captures keyboard and mouse behavior, so putting this into our simulator is straightforward.

    - -
    -

    Present state of the code

    -
    -

    Before moving into getting user interaction, I first want to be sure we're working with the same code. In particular, I've made a couple of important modifications so that this code is slightly different from what we were working with above. I'll point out those differences as we come to them. Here's the program as it stands, from top to bottom:

    -
    	#!/usr/bin/perl
    -	# A simple simulation
    -	use warnings;
    -	use strict;
    -
    -	## Global Variables ##
    -
    -	# Set up the system parameters, including random positions and velocities.
    -	my $d_t = 2**-3;
    -	my $side_length = 200;
    -	my $particle_size = 5;
    -	my $numb_of_atoms = 100;
    -
    -	## Computational Stuff ##
    -
    -	package MyCompute;
    -	use PDL;
    -	my $positions = random(2, $numb_of_atoms) * $side_length;
    -	my $velocities = grandom(2, $numb_of_atoms) * 6;
    -	my $effective_length;
    -
    -	sub compute {
    -		my $effective_length = $side_length - $particle_size;
    -
    -		# update the a real simulation, this is the interesting part
    -		$positions += $d_t * $velocities;
    -
    -		# Check boundary conditions.  Find all particles that are 'outside' the box,
    -		# place them back in the box, and reverse their directions
    -		my ($bad_pos, $bad_vel)
    -			= where($positions, $velocities, $positions > $effective_length);
    -		$bad_vel *= -1;
    -		$bad_pos .= 2 * $effective_length - $bad_pos;
    -
    -		($bad_pos, $bad_vel) = where($positions, $velocities, $positions < 0);
    -		$bad_vel *= -1;
    -		$bad_pos *= -1;
    -	}
    -
    -
    -
    -
    -	## Animation Code ##
    -
    -	package main;
    -
    -	use SDL;
    -	use SDL::App;
    -	use SDL::Rect;
    -	use SDL::Color;
    -	use SDL::Video;
    -
    -	# Create the SDL App
    -	my $app = SDL::App->new( -width  => $side_length, -height => $side_length, 
    -				-title  => "Simple Simulation!", -depth  => 16, );
    -
    -	# white particles on a black background
    -	my $particle_color = SDL::Color->new( 0xff, 0xff, 0xff, );
    -	my $bg_color = SDL::Color->new( 0x00, 0x00, 0x00 );
    -
    -	# rectangles for the particles and the background
    -	my $particle = SDL::Rect->new( 0,0, 5, 5);
    -	my $bg = SDL::Rect->new( 0,0,$side_length, $side_length, );
    -
    -	# Run the simulation
    -	for(my $t = 0; $t < 20; $t += $d_t) {
    -		MyCompute::compute();
    -
    -		# Clean the canvas
    -		SDL::Video::fill_rect($app, $bg, $bg_color);
    -		for(my $i = 0; $i < $numb_of_atoms; $i++) {
    -			$particle->x( $positions->at(0,$i) );
    -			$particle->y( $positions->at(1,$i) );
    -			SDL::Video::fill_rect($app, $particle, $particle_color );
    -		}
    -		SDL::Video::flip($app);
    -		$app->delay(10);
    -	}
    -
    -
    -

    So there it is, top to bottom, in about 75 lines.

    - -
    -

    Listening to Events

    -
    -

    To respond to user interactions, we have to listen to user events using an SDL::Event object. So first, add this line with our other use statements:

    -
     use SDL::Event; 
    -	use SDL::Events; 
    -
    -
    -

    and then be sure to create an event object amongst the animation initialization code:

    -
     my $event = SDL::Event->new;
    -
    -
    -

    Finally, we need to update the application loop so that it examines and responds to events. Replace the current application loop with this code:

    -
    	# Run the simulation
    -	while(1) {
    -		MyCompute::compute();
    -
    -		# Clean the canvas
    -		SDL::Video::fill_rect($app, $bg, $bg_color);
    -		for(my $i = 0; $i < $numb_of_atoms; $i++) {
    -			$particle->x( $positions->at(0,$i) );
    -			$particle->y( $positions->at(1,$i) );
    -			SDL::Video::fill_rect($app, $particle, $particle_col10);
    -
    -		while(SDL::Events::poll_event($event) ) {
    -			if($event->type() ==  SDL_QUIT) {
    -				exit;
    -			}
    -		}
    -	}
    -
    -
    -

    Now the animator will run indefinitely, until you explicitly tell it to close. (You may have noticed before that the application would not close even if you told it to close. Now we've fixed that.)

    - -
    -

    Responding to events

    -
    -

    When SDL gets a mouse response or a keyboard key press, it tells you with an event. The naive way to process these event is with a series of if statements. Don't do that.

    -

    Instead, create a dispatch table, which is nothing more than a hash whose values are the subroutines you want to have run when an event happens. Replace the application loop with the following code:

    -
    	# event dispatch table
    -	my $keyname_dispatch_table = {
    -		'up'	=> \&incr_particle_size,	# up key makes particles larger
    -		'down'	=> \&decr_particle_size,	# down key makes particles smaller
    -		'space'	=> sub { $d_t = -$d_t	},	# space-bar reverses time
    -		'.'	=> sub { $d_t *= 1.1	},	# right-angle-bracket fast-forwards
    -		','	=> sub { $d_t /= 1.1	},	# left-angle-bracket slows down
    -		'q'	=> sub { exit;		},	# q exits
    -	};
    -
    -	sub incr_particle_size {
    -		$particle_size++;
    -		$particle->h($particle_size);
    -		$particle->w($particle_size);
    -	}
    -
    -	sub decr_particle_size {
    -		$particle_size-- if $particle_size > 1;
    -		$particle->h($particle_size);
    -		$particle->w($particle_size);
    -	}
    -
    -
    -
    -
    -	# Run the simulation
    -	while(1) {
    -		MyCompute::compute();
    -
    -		# Clean the canvas
    -		SDL::Video::fill_rect($app, $bg, $bg_color);
    -		for(my $i = 0; $i < $numb_of_atoms; $i++) {
    -			$particle->x( $positions->at(0,$i) );
    -			$particle->y( $positions->at(1,$i) );
    -			SDL::Video::fill_rect($app, $particle, $particle_color );
    -		}
    -		SDL::Video::flip($app);
    -		$app->delay(10);
    -
    -		while(SDL::Events::poll_event($event) ) {
    -			if($event->type() ==  SDL_QUIT) {
    -				exit;
    -			} elsif($event->type() ==  SDL_QUIT) {
    -				if(exists $keyname_dispatch_table->{$event->keysym_name()}) {
    -					$keyname_dispatch_table->{$event->keysym_name()}->();
    -				}
    -			}
    -		}
    -	}
    -
    -
    -

    Dispatch tables allow for powerful methods of abstracting your program logic. Now adding a new event handler is as easy as updating the dispatch table!

    -

    As written, you can now increase or decrease the particle size using the up and down arrow keys, you can increase ory using the right or left angle-brackets, you can reverse time using the space bar, or you can quit by pressing q.

    - -
    -

    Final State of the Code

    -
    -

    Just so that you've got a complete working example, here is the final state of the code, clocking in at a mere 115 lines:

    -
    	#!/usr/bin/perl
    -	# A simple simulation
    -	use warnings;
    -	use strict;
    -
    -	## Global Variables ##
    -
    -	# Set up the system parameters, including random positions and velocities.
    -	my $d_t = 2**-3;
    -	my $side_length = 200;
    -	my $particle_size = 5;
    -	my $numb_of_atoms = 100;
    -
    -	## Computational Stuff ##
    -
    -	package MyCompute;
    -	use PDL;
    -	my $positions = random(2, $numb_of_atoms) * $side_length;
    -	my $velocities = grandom(2, $numb_of_atoms) * 6;
    -	my $effective_length;
    -
    -	sub compute {
    -		my $effective_length = $side_length - $particle_size;
    -
    -		# update the positions.  For a real simulation, this is the interesting part
    -		$positions += $d_t * $velocities;
    -
    -		# Check boundary conditions.  Find all particles that are 'outside' the box,
    -		# place them back in the box, and reverse their directions
    -		my ($bad_pos, $bad_vel)
    -			= where($positions, $velocities, $positions > $effective_length);
    -		$bad_vel *= -1;
    -		$bad_pos .= 2 * $effective_length - $bad_pos;
    -
    -		($bad_pos, $bad_vel) = where($positions, $velocities, $positions < 0);
    -		$bad_vel *= -1;
    -		$bad_pos *= -1;
    -	}
    -
    -
    -
    -
    -	## Animation Code ##
    -
    -	package main;
    -
    -	use SDL;
    -	use SDL::App;
    -	use SDL::Rect;
    -	use SDL::Color;
    -	use SDL::Video;
    -	use SDL::Event;  
    -	use SDL::Events; 
    -
    -	# Create the SDL App
    -	my $app = SDL::App->new( -width  => $side_length, -height => $side_length, 
    -				-title  => "Simple Simulation!", -depth  => 16, );
    -
    -	# white particles on a black background
    -	my $particle_color = SDL::Color->new( 0xff, 0xff, 0xff, );
    -	my $bg_color = SDL::Color->new( 0x00, 0x00, 0x00 );
    -
    -	# rectangles for the particles and the background
    -	my $particle = SDL::Rect->new( 0,0, 5, 5);
    -	my $bg = SDL::Rect->new( 0,0,$side_length, $side_length, );
    -
    -	# event listener
    -	my $event = SDL::Event->new();
    -
    -	# event dispatch table
    -	my $keyname_dispatch_table = {
    -		'up'	=> \&incr_particle_size,	# up key makes particles large
    -		'down'	=> \&decr_particle_size,	# up key makes particles large
    -		'space'	=> sub { $d_t = -$d_t	},	
    -		'.'	=> sub { $d_t *= 1.1	},	# right-arrow fast-forwards
    -		','	=> sub { $d_t /= 1.1	},	# left-arrow slows down
    -		'q'	=> sub { exit;		},	# q exits
    -	};
    -
    -	sub incr_particle_size {
    -		$particle_size++;
    -		$particle->h($particle_size);
    -		$particle->w($particle_size);
    -	}
    -
    -	sub decr_particle_size {
    -		$particle_size-- if $particle_size > 1;
    -		$particle->h($particle_size);
    -		$particle->w($particle_size);
    -	}
    -
    -
    -
    -
    -	# Run the simulation
    -	while(1) {
    -		MyCompute::compute();
    -
    -		# Clean the canvas
    -		SDL::Video::fill_rect($app, $bg, $bg_color);
    -		for(my $i = 0; $i < $numb_of_atoms; $i++) {
    -			$particle->x( $positions->at(0,$i) );
    -			$particle->y( $positions->at(1,$i) );
    -			SDL::Video::fill_rect($app, $particle, $particle_color );
    -		}
    -		SDL::Video::flip($app);
    -		$app->delay(10);
    -
    -		while(SDL::Events::poll_event($event) ) {
    -			if($event->type() ==  SDL_QUIT) {
    -				exit;
    -			} elsif($event->type() ==  SDL_QUIT) {
    -				if(exists $keyname_dispatch_table->{$event->keysym_name()}) {
    -					$keyname_dispatch_table->{$event->keysym_name()}->();
    -				}
    -			}
    -		}
    -	}
    -
    -
    -

    Next, if you want to model interactions among particles, you could write code in the compute function to handle that for you. If you wanted to use little balls instead of the boxes we've used here, you could create your own images and use an SDL::Surface to load the image. You can't resize an image using SDL, but then you'd probably be working with real interactions anyway, like a Coulomb force, in which case you'd really be adjusting the interaction strength, not the particle size.

    - -
    -

    Directions for future work

    Top

    -
    -

    I have a couple of ideas for future work combining PDL and SDL.

    -
    -
    PLplot driver thingy that creates plots that can be blitted onto an app. This way, having a graph plotting along side your simulation would be straightforward. -=item Write a function to convert SDL::Surface to a collection of rgba piddles. We might even be able to convince the piddle to work directly with the memory allocated for the SDL::Survace object for super-fast PDL-based image manipulations. As an added bonus, you'd be able to slice and dice!
    -
    +

    If the error message is 'Blit combination not supported' that means that the BPP is incorrect or incosistent with the dimensions. +After that a simple update_rect will so your new surface on the screen.

    \ No newline at end of file diff --git a/pages/SDL-Cookbook.html-inc b/pages/SDL-Cookbook.html-inc index 409930d..6582a86 100644 --- a/pages/SDL-Cookbook.html-inc +++ b/pages/SDL-Cookbook.html-inc @@ -4,7 +4,8 @@

    First Steps

    +

    PDL with SDL

    +
    +

    Attaching a PDL piddle object to SDL. SDL::Cookbook::PDL

    diff --git a/pages/SDL-GFX-Primitives.html-inc b/pages/SDL-GFX-Primitives.html-inc index fb0a56d..bee6fd4 100644 --- a/pages/SDL-GFX-Primitives.html-inc +++ b/pages/SDL-GFX-Primitives.html-inc @@ -55,7 +55,7 @@

    DESCRIPTION

    Top

    All functions take an SDL::Surface object as first parameter. This can be a new surface that will be blittet afterwads, can be an surface -obtained by SDL::Video::set_video_mode or can be an SDL::App.

    +obtained by SDL::Video::set_video_mode or can be an SDLx::App.

    The color values for the _color functions are 0xRRGGBBAA (32bit), even if the surface uses e. g. 8bit colors.

    diff --git a/pages/SDL-OpenGL.html-inc b/pages/SDL-OpenGL.html-inc deleted file mode 100644 index 1f46ad5..0000000 --- a/pages/SDL-OpenGL.html-inc +++ /dev/null @@ -1,92 +0,0 @@ -
    - -

    Index

    - -
    - - - - - - - - - -

    NAME

    Top

    -
    -

    SDL::OpenGL - a perl extension

    - -
    -

    CATEGORY

    Top

    -
    -

    TODO

    - -
    -

    DESCRIPTION

    Top

    -
    -

    SDL::OpenGL is a perl module which when used by your application -exports the gl* and glu* functions into your application's primary namespace. -Most of the functions described in the OpenGL 1.3 specification are currently -supported in this fashion. As the implementation of the OpenGL bindings that -comes with SDL_perl is largely type agnositic, there is no need to decline -the function names in the fashion that is done in the C API. For example, -glVertex3d is simply glVertex, and perl just does the right thing with regards -to types.

    - -
    -

    CAVEATS

    Top

    -
    -

    The following methods work different in Perl than in C:

    -
    -
    glCallLists
    -
    -
            glCallLists(@array_of_numbers);
    -
    -
    -

    Unlike the C function, which get's passed a count, a type and a list of -numbers, the Perl equivalent only takes a list of numbers.

    -

    Note that this is slow, since it needs to allocate memory and construct a -list of numbers from the given scalars. For a faster version see -glCallListsString.

    -
    -
    -

    The following methods exist in addition to the normal OpenGL specification:

    -
    -
    glCallListsString
    -
    -
            glCallListsString($string);
    -
    -
    -

    Works like glCallLists(), except that it needs only one parameter, a scalar -holding a string. The string is interpreted as a set of bytes, and each of -these will be passed to glCallLists as GL_BYTE. This is faster than -glCallLists, so you might want to pack your data like this:

    -
            my $lists = pack("C", @array_of_numbers);
    -
    -
    -

    And later use it like this:

    -
            glCallListsString($lists);
    -
    -
    -
    -
    - -
    -

    AUTHOR

    Top

    -
    -

    David J. Goehrig

    - -
    -

    SEE ALSO

    Top

    - -
    \ No newline at end of file diff --git a/pages/SDL-Tutorial-Animation.html-inc b/pages/SDL-Tutorial-Animation.html-inc index de815d6..9971729 100644 --- a/pages/SDL-Tutorial-Animation.html-inc +++ b/pages/SDL-Tutorial-Animation.html-inc @@ -59,7 +59,7 @@ frame and saving and restoring the background for every object drawn.

    Since you have to draw the screen in the right order once to start with it's pretty easy to make this into a loop and redraw things in the right order for -every frame. Given a SDL::App object $app, a SDL::Rect $rect, and +every frame. Given a SDLx::App object $app, a SDL::Rect $rect, and a SDL::Color $color, you only have to create a new SDL::Rect $bg, representing the whole of the background surface and a new SDL::Color $bg_color, representing the background color. You can write a diff --git a/pages/SDL-Tutorial-LunarLander.html-inc b/pages/SDL-Tutorial-LunarLander.html-inc index 94199f4..c0cbd5f 100644 --- a/pages/SDL-Tutorial-LunarLander.html-inc +++ b/pages/SDL-Tutorial-LunarLander.html-inc @@ -301,7 +301,7 @@ this tutorial; Save these images in a subdirectory called "images": use SDL; #needed to get all constants use SDL::Video; - use SDL::App; + use SDLx::App; use SDL::Surface; use SDL::Rect; use SDL::Image; @@ -313,14 +313,14 @@ this tutorial; Save these images in a subdirectory called "images":

    -

    Second step: initialize SDL::App:

    +

    Second step: initialize SDLx::App:

     
     
     
     
     
    -    my $app = SDL::App->new(
    +    my $app = SDLx::App->new(
             -title  => "Lunar Lander",
             -width  => 800,
             -height => 600,
    diff --git a/pages/SDL-Tutorial.html-inc b/pages/SDL-Tutorial.html-inc
    index d996720..5b8e725 100644
    --- a/pages/SDL-Tutorial.html-inc
    +++ b/pages/SDL-Tutorial.html-inc
    @@ -53,7 +53,7 @@ though.  Here's how to get up and running as quickly as possible.

    Surfaces

    All graphics in SDL live on a surface. You'll need at least one. That's what -SDL::App provides.

    +SDLx::App provides.

    Of course, before you can get a surface, you need to initialize your video mode. SDL gives you several options, including whether to run in a window or take over the full screen, the size of the window, the bit depth of your @@ -63,11 +63,11 @@ something really simple.

    Initialization

    -

    SDL::App makes it easy to initialize video and create a surface. Here's how to +

    SDLx::App makes it easy to initialize video and create a surface. Here's how to ask for a windowed surface with 640x480x16 resolution:

    -
    	use SDL::App;
    +
    	use SDLx::App;
     
    -	my $app = SDL::App->new(
    +	my $app = SDLx::App->new(
     		-width  => 640,
     		-height => 480,
     		-depth  => 16,
    @@ -77,9 +77,9 @@ ask for a windowed surface with 640x480x16 resolution:

    You can get more creative, especially if you use the -title and -icon attributes in a windowed application. Here's how to set the window title of the application to My SDL Program:

    -
    	use SDL::App;
    +
    	use SDLx::App;
     
    -	my $app = SDL::App->new(
    +	my $app = SDLx::App->new(
     		-height => 640,
     		-width  => 480,
     		-depth  => 16,
    diff --git a/pages/SDL-App.html-inc b/pages/SDLx-App.html-inc
    similarity index 75%
    rename from pages/SDL-App.html-inc
    rename to pages/SDLx-App.html-inc
    index 10356be..23e5cd3 100644
    --- a/pages/SDL-App.html-inc
    +++ b/pages/SDLx-App.html-inc
    @@ -29,7 +29,7 @@
     
     

    NAME

    Top

    -

    SDL::App - a SDL perl extension

    +

    SDLx::App - a SDL perl extension

    CATEGORY

    Top

    @@ -40,11 +40,11 @@

    SYNOPSIS

    Top

        use SDL;
    -    use SDL::App; 
    +    use SDLx::App; 
         use SDL::Event;
         use SDL::Events; 
     
    -    my $app = SDL::App->new( 
    +    my $app = SDLx::App->new( 
             -title  => 'Application Title',
             -width  => 640,
             -height => 480,
    @@ -64,12 +64,12 @@
         }
     
     
    -

    An alternative to the manual Event processing is the SDL::App::loop .

    +

    An alternative to the manual Event processing is the SDLx::App::loop .

    DESCRIPTION

    Top

    -

    SDL::App controls the root window of the of your SDL based application. +

    SDLx::App controls the root window of the of your SDL based application. It extends the SDL::Surface class, and provides an interface to the window manager oriented functions.

    @@ -80,9 +80,9 @@ manager oriented functions.

    new

    -

    SDL::App::new initializes the SDL, creates a new screen, +

    SDLx::App::new initializes the SDL, creates a new screen, and initializes some of the window manager properties. -SDL::App::new takes a series of named parameters:

    +SDLx::App::new takes a series of named parameters:

    • -title
    • -icon_title
    • @@ -98,7 +98,7 @@ and initializes some of the window manager properties.

    title

    -

    SDL::App::title takes 0, 1, or 2 arguments. It returns the current +

    SDLx::App::title takes 0, 1, or 2 arguments. It returns the current application window title. If one parameter is passed, both the window title and icon title will be set to its value. If two parameters are passed the window title will be set to the first, and the icon title @@ -107,39 +107,39 @@ to the second.

    delay

    -

    SDL::App::delay takes 1 argument, and will sleep the application for +

    SDLx::App::delay takes 1 argument, and will sleep the application for that many ms.

    ticks

    -

    SDL::App::ticks returns the number of ms since the application began.

    +

    SDLx::App::ticks returns the number of ms since the application began.

    error

    -

    SDL::App::error returns the last error message set by the SDL.

    +

    SDLx::App::error returns the last error message set by the SDL.

    resize

    -

    SDL::App::resize takes a new height and width of the application +

    SDLx::App::resize takes a new height and width of the application if the application was originally created with the -resizable option.

    fullscreen

    -

    SDL::App::fullscreen toggles the application in and out of fullscreen mode.

    +

    SDLx::App::fullscreen toggles the application in and out of fullscreen mode.

    iconify

    -

    SDL::App::iconify iconifies the applicaiton window.

    +

    SDLx::App::iconify iconifies the applicaiton window.

    grab_input

    -

    SDL::App::grab_input can be used to change the input focus behavior of +

    SDLx::App::grab_input can be used to change the input focus behavior of the application. It takes one argument, which should be one of the following:

    * @@ -153,12 +153,12 @@ SDL_GRAB_OFF

    loop

    -

    SDL::App::loop is a simple event loop method which takes a reference to a hash +

    SDLx::App::loop is a simple event loop method which takes a reference to a hash of event handler subroutines. The keys of the hash must be SDL event types such as SDL_QUIT(), SDL_KEYDOWN(), and the like. The event method recieves as its parameter the event object used in the loop.

    Example:

    -
        my $app = SDL::App->new(
    +
        my $app = SDLx::App->new(
             -title  => "test.app", 
             -width  => 800, 
             -height => 600, 
    @@ -177,14 +177,14 @@ the event object used in the loop.

    sync

    -

    SDL::App::sync encapsulates the various methods of syncronizing the screen with the -current video buffer. SDL::App::sync will do a fullscreen update, using the double buffer +

    SDLx::App::sync encapsulates the various methods of syncronizing the screen with the +current video buffer. SDLx::App::sync will do a fullscreen update, using the double buffer or OpenGL buffer if applicable. This is prefered to calling flip on the application window.

    attribute ( attr, [value] )

    -

    SDL::App::attribute allows one to set and get GL attributes. By passing a value +

    SDLx::App::attribute allows one to set and get GL attributes. By passing a value in addition to the attribute selector, the value will be set. SDL:::App::attribute always returns the current value of the given attribute, or croaks on failure.

    diff --git a/pages/blog-0000.html-inc b/pages/blog-0000.html-inc index ccb4504..88a7aa6 100644 --- a/pages/blog-0000.html-inc +++ b/pages/blog-0000.html-inc @@ -1,2 +1,2 @@

    Articles

    -
    Getting people to use SDL Perl: Docs, API, and Distribution
    Friday, 07 May 2010
    Tags: [API] [Design] [Docs] [Perl] [SDL]
    The road so far
    Things have been busy but fruitful. Our two core modules are getting to be a bit more stable. Alien::SDL 1.405 is behaving well. This foundational stability will start to show results in SDL too I believe. Most excitingly the main developer of frozen-bubble is reviewing our Games::FrozenBubble port to CPAN. All good and well, but to keep this project going we need to improve.
    Getting people to use SDL Perl
    After a long chat with a new SDL user on #sdl today, I realize we still have some way to go. Currently it seems we are lacking in a few areas. We can definitely use some feedback and help in these areas.
    Tutorials/Documentation

    We have more docs now on http://sdl.perl.org but they suck
    What type of tutorials do you think will be good for beginners?
    A project start to finish?
    Individual tutorials for various topics?
    What needs to go in SDL::CookBook?

    API sweetness
    SDL Perl depends on distinct C libraries
    This makes naming conventions, data formats different the SDL:: namespaces
    How do people design this stuff?
    We are hackers and we just go do stuff but I think this needs some prior thought
    Any takers?

    Distribution
    If SDL scripts can be packaged up simply for game developers to distribute their games it will be a big plus
    One way is a Wx::Perl::Packer clone
    Another is a CPAN/Steam clone that game devs can upload games too and people can point and click download games? 
    If anyone wants to help in these areas please talk to us on sdl-devel@perl.org. 


    [more]


    Games::FrozenBubble: It is a start!
    Monday, 12 April 2010
    Tags: [Frozen Bubble] [Perl] [SDL]
    We released a playable (client) frozen bubble on CPAN . There is more work to be done but it is a great start! It currently works on Windows and Linux.



    [more]


    Release SDL 2.4: Frozen-Bubble begins to go to CPAN
    Tuesday, 06 April 2010
    Tags: [Frozen Bubble] [Perl] [SDL]

    SDL 2.4 is released!
    After 8 months of work this picture begins to sum it up:
    [more]


    A summer of possibilities (SDL_perl and GSOC 2010 )
    Tuesday, 30 March 2010
    Tags: [GSOC] [Perl] [SDL]
    GSOC 2010
    As many of the readers must know The Perl Foundation has been accepted for the GSOC 2010 program. There are several SDL_perl mentors involved in it too. Right now we are accepting student applications.
    Process to Apply
    [more]


    SDL Perl Showcase
    Friday, 12 March 2010
    Tags: [EyeCandy] [Perl] [SDL Perl] [Showcase]

    SDL_Mixer and Effects

    [more]


    Eye Candy
    Wednesday, 24 February 2010
    Tags: [SDL Perl EyeCandy]

    clang
    With each imperfect hit
    [more]



    Quick Game for Toronto Perl Mongers
    Thursday, 11 February 2010
    Tags: [Game] [SDL] [TPM]

    Beep ... Boop

    [more]


    SDL_perl 2.3_5 is out!
    Monday, 01 February 2010
    Tags: [Releases] [SDL]
    We keep on rolling,
    rolling,
    waiting on the world to turn.
    [more]


    Threaded XS callback finally gets solved.
    Wednesday, 06 January 2010
    Tags: [Perl] [SDL] [Updates] [XS]

    Dragged down from the lofty isles,
    into the guts and gore of the monster,
    [more]


    SDL Alpha 2: A sneak preview
    Sunday, 06 December 2009
    Tags: [Perl] [Releases] [SDL]
    Pretty or Ugly,
    Code is Code
    New or Old,
    [more]


    Developer Release of SDL 2.3_1
    Monday, 30 November 2009
    Tags: [Perl] [Releases] [SDL]

    The city of Rome was built,
    with the first brick.
    [more]


    SDL Perl Documentation: Reviewers need
    Thursday, 26 November 2009
    Tags: [Docs] [Perl] [SDL]

    The written word,
    survives;
    [more]


    Migrating Sol's Tutorial of SDL to SDL_Perl
    Sunday, 15 November 2009
    Tags: [Example] [Perl] [SDL]
    If I have seen further it is only by standing on the shoulders of giants. --Newton


    [more]


    Once in a while .... (set_event_filter)
    Friday, 13 November 2009
    Tags: [Perl] [SDL] [XS]

    Once in a while
    Things just work!
    [more]


    Hello Mouse? An Example of the New Event Code
    Wednesday, 11 November 2009
    Tags: [Perl] [SDL] [Sneak Preview]
    Any code that is not marketed is dead code
    --mst

    [more]


    Development Update
    Monday, 09 November 2009
    Tags: [Perl] [SDL] [Updates]
    Short and Sweet

    Had an exam on the weekend so I am a bit late. Here is the progress so far.
    [more]


    Development Update
    Monday, 02 November 2009
    Tags: [Perl] [SDL] [Updates]

    A stoic stone will sit idle,
    but will some effort,
    [more]


    The Future and Beyond!
    Saturday, 24 October 2009
    Tags: [Design] [SDL] [Updates] [games]
    I do not think about awesomeness...
    I just am awesomeness
    n.n
    [more]


    The beginnings of modular design for SDL Perl
    Sunday, 11 October 2009
    Tags: [Design] [SDL] [Updates]
    “Do or do not... there is no try.”
    --yoda
    The design before
    [more]


    Why and How Frozen Bubble is going to CPAN
    Friday, 02 October 2009
    Tags: [Frozen Bubble] [Perl] [SDL]
    A single drop,
    causes the ocean to swell

    [more]


    HackFest: Results
    Monday, 28 September 2009
    Tags: [HackFest] [Perl] [SDL]
    The beautiful sunset,
    is no match for,
    the ugly sunrise
    [more]


    Updates, Falling Block Game, and Hack Fest
    Wednesday, 23 September 2009
    Tags: [Docs] [Perl] [SDL]
    Silent but active,
    Small but deadly.

    [more]


    Thanks nothingmuch, and updates
    Friday, 18 September 2009
    Tags: [Design] [Perl] [SDL] [Tutorial]
    struggle,
    live,
    cease,
    [more]


    Design of SDL::Rect
    Saturday, 12 September 2009
    Tags: [Design] [Perl] [SDL]

    you say things,
    I hear,
    [more]


    +
    SDL RC 2.5 decides to play with PDL
    Tuesday, 29 June 2010
    Tags: [PDL] [Perl] [SDL]
    PDL provides great number crunching capabilities to Perl and SDL provides game-developer quality real-time bitmapping and sound.
    You can use PDL and SDL together to create real-time,
    responsive animations and simulations.
    [more]


    Providing direct memory access to SDL_Surface's pixels
    Wednesday, 23 June 2010
    Tags: [Pack] [Perl] [SDL] [Surface] [XS]
    In an attempt to make pixel access easier on SDL_Surface pixels. I have started work on SDLx::Surface . So far I have only start on the 32 bpp surfaces.
    The general idea is to make Pointer Values (PV) of each pixel in the surface and place them into a 2D matrix. First I make pointer values like this:
    SV * get_pixel32 ( SDL_Surface * surface , int x , int y )
    [more]


    SDLpp.pl: Packaging SDL Scripts Alpha
    Friday, 14 May 2010
    Tags: [Packaging] [Perl] [SDL]
    After a lot of patches and head scratching I have an alpha version of SDLpp.pl . The purpose of SDLpp.pl is to allow SDL perl developers to package their game for end users.
    Here is the shooter.pl packaged up:

    [more]


    Getting people to use SDL Perl: Docs, API, and Distribution
    Friday, 07 May 2010
    Tags: [API] [Design] [Docs] [Perl] [SDL]
    The road so far
    Things have been busy but fruitful. Our two core modules are getting to be a bit more stable. Alien::SDL 1.405 is behaving well. This foundational stability will start to show results in SDL too I believe. Most excitingly the main developer of frozen-bubble is reviewing our Games::FrozenBubble port to CPAN. All good and well, but to keep this project going we need to improve.
    Getting people to use SDL Perl
    After a long chat with a new SDL user on #sdl today, I realize we still have some way to go. Currently it seems we are lacking in a few areas. We can definitely use some feedback and help in these areas.
    Tutorials/Documentation

    We have more docs now on http://sdl.perl.org but they suck
    What type of tutorials do you think will be good for beginners?
    A project start to finish?
    Individual tutorials for various topics?
    What needs to go in SDL::CookBook?

    API sweetness
    SDL Perl depends on distinct C libraries
    This makes naming conventions, data formats different the SDL:: namespaces
    How do people design this stuff?
    We are hackers and we just go do stuff but I think this needs some prior thought
    Any takers?

    Distribution
    If SDL scripts can be packaged up simply for game developers to distribute their games it will be a big plus
    One way is a Wx::Perl::Packer clone
    Another is a CPAN/Steam clone that game devs can upload games too and people can point and click download games? 
    If anyone wants to help in these areas please talk to us on sdl-devel@perl.org. 


    [more]


    Games::FrozenBubble: It is a start!
    Monday, 12 April 2010
    Tags: [Frozen Bubble] [Perl] [SDL]
    We released a playable (client) frozen bubble on CPAN . There is more work to be done but it is a great start! It currently works on Windows and Linux.



    [more]


    Release SDL 2.4: Frozen-Bubble begins to go to CPAN
    Tuesday, 06 April 2010
    Tags: [Frozen Bubble] [Perl] [SDL]

    SDL 2.4 is released!
    After 8 months of work this picture begins to sum it up:
    [more]


    A summer of possibilities (SDL_perl and GSOC 2010 )
    Tuesday, 30 March 2010
    Tags: [GSOC] [Perl] [SDL]
    GSOC 2010
    As many of the readers must know The Perl Foundation has been accepted for the GSOC 2010 program. There are several SDL_perl mentors involved in it too. Right now we are accepting student applications.
    Process to Apply
    [more]


    SDL Perl Showcase
    Friday, 12 March 2010
    Tags: [EyeCandy] [Perl] [SDL Perl] [Showcase]

    SDL_Mixer and Effects

    [more]


    Eye Candy
    Wednesday, 24 February 2010
    Tags: [SDL Perl EyeCandy]

    clang
    With each imperfect hit
    [more]



    Quick Game for Toronto Perl Mongers
    Thursday, 11 February 2010
    Tags: [Game] [SDL] [TPM]

    Beep ... Boop

    [more]


    SDL_perl 2.3_5 is out!
    Monday, 01 February 2010
    Tags: [Releases] [SDL]
    We keep on rolling,
    rolling,
    waiting on the world to turn.
    [more]


    Threaded XS callback finally gets solved.
    Wednesday, 06 January 2010
    Tags: [Perl] [SDL] [Updates] [XS]

    Dragged down from the lofty isles,
    into the guts and gore of the monster,
    [more]


    SDL Alpha 2: A sneak preview
    Sunday, 06 December 2009
    Tags: [Perl] [Releases] [SDL]
    Pretty or Ugly,
    Code is Code
    New or Old,
    [more]


    Developer Release of SDL 2.3_1
    Monday, 30 November 2009
    Tags: [Perl] [Releases] [SDL]

    The city of Rome was built,
    with the first brick.
    [more]


    SDL Perl Documentation: Reviewers need
    Thursday, 26 November 2009
    Tags: [Docs] [Perl] [SDL]

    The written word,
    survives;
    [more]


    Migrating Sol's Tutorial of SDL to SDL_Perl
    Sunday, 15 November 2009
    Tags: [Example] [Perl] [SDL]
    If I have seen further it is only by standing on the shoulders of giants. --Newton


    [more]


    Once in a while .... (set_event_filter)
    Friday, 13 November 2009
    Tags: [Perl] [SDL] [XS]

    Once in a while
    Things just work!
    [more]


    Hello Mouse? An Example of the New Event Code
    Wednesday, 11 November 2009
    Tags: [Perl] [SDL] [Sneak Preview]
    Any code that is not marketed is dead code
    --mst

    [more]


    Development Update
    Monday, 09 November 2009
    Tags: [Perl] [SDL] [Updates]
    Short and Sweet

    Had an exam on the weekend so I am a bit late. Here is the progress so far.
    [more]


    Development Update
    Monday, 02 November 2009
    Tags: [Perl] [SDL] [Updates]

    A stoic stone will sit idle,
    but will some effort,
    [more]


    The Future and Beyond!
    Saturday, 24 October 2009
    Tags: [Design] [SDL] [Updates] [games]
    I do not think about awesomeness...
    I just am awesomeness
    n.n
    [more]


    The beginnings of modular design for SDL Perl
    Sunday, 11 October 2009
    Tags: [Design] [SDL] [Updates]
    “Do or do not... there is no try.”
    --yoda
    The design before
    [more]


    Why and How Frozen Bubble is going to CPAN
    Friday, 02 October 2009
    Tags: [Frozen Bubble] [Perl] [SDL]
    A single drop,
    causes the ocean to swell

    [more]


    HackFest: Results
    Monday, 28 September 2009
    Tags: [HackFest] [Perl] [SDL]
    The beautiful sunset,
    is no match for,
    the ugly sunrise
    [more]


    diff --git a/pages/blog-0001.html-inc b/pages/blog-0001.html-inc index 2bd84fc..706ea53 100644 --- a/pages/blog-0001.html-inc +++ b/pages/blog-0001.html-inc @@ -1,40 +1,77 @@

    -Getting people to use SDL Perl: Docs, API, and Distribution +SDL RC 2.5 decides to play with PDL

    -

    The road so far


    -Things have been busy but fruitful. Our two core modules are getting to be a bit more stable. Alien::SDL 1.405 is behaving well. This foundational stability will start to show results in SDL too I believe. Most excitingly the main developer of frozen-bubble is reviewing our Games::FrozenBubble port to CPAN. All good and well, but to keep this project going we need to improve.
    -
    -

    Getting people to use SDL Perl


    -After a long chat with a new SDL user on #sdl today, I realize we still have some way to go. Currently it seems we are lacking in a few areas. We can definitely use some feedback and help in these areas.
    -
    -
    • Tutorials/Documentation
      -
    • - -
      • We have more docs now on http://sdl.perl.org but they suck
      • -
      • What type of tutorials do you think will be good for beginners?
      • - -
        • A project start to finish?
        • -
        • Individual tutorials for various topics?
        • -
        • What needs to go in SDL::CookBook?
        • -
      -
    • API sweetness
    • - -
      • SDL Perl depends on distinct C libraries
      • - -
        • This makes naming conventions, data formats different the SDL:: namespaces
        • -
        • How do people design this stuff?
        • - -
          • We are hackers and we just go do stuff but I think this needs some prior thought
          • -
          • Any takers?
          • -
      -
    • Distribution
    • - -
      • If SDL scripts can be packaged up simply for game developers to distribute their games it will be a big plus
      • - -
        • One way is a Wx::Perl::Packer clone
        • -
        • Another is a CPAN/Steam clone that game devs can upload games too and people can point and click download games? 
        • -
    If anyone wants to help in these areas please talk to us on sdl-devel@perl.org. 
    -


    -

    \ No newline at end of file +PDL provides great number crunching capabilities to Perl and SDL provides game-developer quality real-time bitmapping and sound.
    +You can use PDL and SDL together to create real-time,
    +responsive animations and simulations.
    +In this section we will go through the pleasures and pitfalls of working with both powerhouse libraries.
    -- David Mertnes
    +
    +
    +

    Creating a SDL Surface piddle


    +PDL's core type is a piddle.
    +Once a piddle is provided to PDL it can go do a numerous amounts of things.
    +Please see the example in 'examples/cookbook/pdl.pl' in github.
    +
    +

    Creating a simple piddle


    +First lets get the right modules.
    +
    +
      use PDL;
    +  use SDL::Rect;
    +  use SDL::Video;
    +  use SDL::Surface;
    +  use SDL::PixelFormat;
    +

    +Suppose you want a surface of size (200,400) and 32 bit (RGBA).
    +
    +
    my ( $bytes_per_pixel, $width, $height ) = ( 4, 200, 400 );
    +

    +Define the $width, $height and $bytes_per_pixel. Your $bytes_per_pixel is the number of bits (in this case 32) divided by 8 bits per byte. Therefore for our 32 bpp we have 4 Bpp;
    +
    +
    my $piddle  = zeros( byte, $bytes_per_pixel, $width, $height );
    +

    +Create a normal $piddle with zeros, byte format and the Bpp x width x height dimensions.
    +
    +
    my $pointer = $piddle->get_dataref();
    +

    +Here is where we get the acutal data the piddle is pointing to. We will have SDL create a new surface from this function.
    +
    +
    my $surface = SDL::Surface->new_from( $pointer, $width, $height, 32,
    +        $width * $bytes_per_pixel );
    +

    +Using the same dimensions we create the surface using SDL::Surface->new_form(). The $width * $Bpp is the scanline (pitch) of the surface in bytes.
    +
    +
    warn "Made surface of $width, $height and ". $surface->format->BytesPerPixel;
    +   return ( $piddle, $surface );
    +

    +Finally make sure that the surface acutally has the correct dimensions we gave.
    +
    +NOTE: $surface->format->BytesPerPixel must return 1,2,3,4. !!
    +
    +Now you can blit and use the surface as needed; and do PDL operations as required.
    +
    +

    Operating on the Surface safely


    +To make sure SDL is in sync with the data. You must call SDL::Video::lock before doing PDL operations on the piddle.
    +
    +
    SDL::Video::lock_surface($surface);
    + 
    +    $piddle ( :, 0 : rand(400), 0 : rand(200) ) .=   pdl( rand(225), rand(225), rand(255), 255 );
    +

    +After that you can unlock the surface to blit.
    +
    +
    SDL::Video::unlock_surface($surface);
    +

    +

    Errors due to BPP at blitting


    +When blitting the new surface check for the return value to see if there has been a problem.
    +
    +
    my $b = SDL::Video::blit_surface(
    +        $surface,  SDL::Rect->new( 0, 0, $surface->w, $surface->h ),
    +        $app, SDL::Rect->new(  ( $app->w - $surface->w ) / 2, ( $app->h - $surface->h ) / 2, $app->w, $app->h )
    +       );
    + 
    +    die "Could not blit: " . SDL::get_error() if ( $b == -1 );
    +

    +If the error message is 'Blit combination not supported' that means that the BPP is incorrect or incosistent with the dimensions. After that a simple update_rect will so your new surface on the screen. +


    +

    \ No newline at end of file diff --git a/pages/blog-0002.html-inc b/pages/blog-0002.html-inc index ef14036..2e202e7 100644 --- a/pages/blog-0002.html-inc +++ b/pages/blog-0002.html-inc @@ -1,10 +1,81 @@

    -Games::FrozenBubble: It is a start! +Providing direct memory access to SDL_Surface's pixels

    -We released a playable (client) frozen bubble on CPAN. There is more work to be done but it is a great start! It currently works on Windows and Linux.
    +

    In an attempt to make pixel access easier on SDL_Surface pixels. I have started work on SDLx::Surface. So far I have only start on the 32 bpp surfaces.


    +

    The general idea is to make Pointer Values (PV) of each pixel in the surface and place them into a 2D matrix. First I make pointer values like this:


    +
    SV * get_pixel32 (SDL_Surface *surface, int x, int y)
    +{
    + //Convert the pixels to 32 bit 
    + Uint32 *pixels = (Uint32 *)surface->pixels; 
    +
    + //Get the requested pixel  
    + Uint32* u_ptr =  pixels + ( y * surface->w ) + x ; 
    +
    +        SV* sv = newSVpv("a",1); //Make a temp SV* value on the go
    +        SvCUR_set(sv, sizeof(Uint32)); //Specify the new CUR length
    + SvLEN_set(sv, sizeof(Uint32)); //Specify the LEN length
    +        SvPV_set(sv,(char*)u_ptr); // set the actual pixel's pointer as the memory space to use
    +
    + return sv; //make a modifiable reference using u_ptr's place as the memory :)
    +
    +}
    +

    +

    Next I loop through all the pixels and put them in a 2D array format, shown below:

    AV * construct_p_matrix ( SDL_Surface *surface )
    +{
    +    AV * matrix = newAV();
    +     int i, j;
    +     for(  i =0 ; i < surface->w; i++)
    +      {
    +        AV * matrix_row = newAV();
    +        for( j =0 ; j < surface->h; j++)
    +        {
    +           av_push(matrix_row, get_pixel32(surface, i,j) );
    +        }
    +        av_push(matrix, newRV_noinc((SV*) matrix_row) );
    +      }
    +
    + return matrix;
    +}
    +

    +

    You can see the complete here.


    +

    In Perl I can do a get access on this pixel using:



    -
    -


    -

    \ No newline at end of file +
    my $surf32_matrix = SDLx::Surface::pixel_array($screen_surface);
    +   print unpack 'b*', $surf32_matrix->[0][0]; # pixel value at x = 0 and y =0
    +#OUTPUT:
    +# 11111111000000000000000000000000
    +

    +

    The structure of the PV is using Devel::Peek is :


    +
    print Dump $surf32_matrix->[0][0];
    +#OUTPUT:
    +#SV = PV(0xed0dbc) at 0xeb5344
    +#  REFCNT = 1
    +#  FLAGS = (POK,pPOK)
    +#  PV = 0x9e04ac "\0\0\377\0"
    +#  CUR = 4
    +#  LEN = 4
    +

    +

    The problem is in setting the value of this pointer value. I have tried the following things with no success:


    +
    if ( SDL::Video::MUSTLOCK($screen_surface) ) {
    +    return if ( SDL::Video::lock_surface($screen_surface) < 0 ); #required for pixel operations
    +}
    +
    +#USING pack
    +
    +my $green = pack 'b*', '11111111000000000000000000000000';
    +substr( $surf32_matrix->[0][0], 0, 8 * 4, $green); #no change
    +#substr( $surf32_matrix->[0][0], 0, 8 * 4, 0xFF000000); segfault
    +substr( ${$surf32_matrix->[0][0]}, 0, 8 * 4, 0xFF000000); #no change
    +#$surf32_matrix->[0][0] = $green; SEGFAULT's cannot write to memory
    +${$surf32_matrix->[0][0]} = $green; #no change
    +
    +
    +SDL::Video::unlock_surface($screen_surface)
    +  if ( SDL::Video::MUSTLOCK($screen_surface) );
    +

    +

    You can see an example here.


    +

    Any help will be greatly appreciated.

    +


    +

    \ No newline at end of file diff --git a/pages/blog-0003.html-inc b/pages/blog-0003.html-inc index 3bbdb8b..5cffcd0 100644 --- a/pages/blog-0003.html-inc +++ b/pages/blog-0003.html-inc @@ -1,15 +1,18 @@

    -Release SDL 2.4: Frozen-Bubble begins to go to CPAN +SDLpp.pl: Packaging SDL Scripts Alpha

    -
    -SDL 2.4 is released!

    +After a lot of patches and head scratching I have an alpha version of SDLpp.pl. The purpose of SDLpp.pl is to allow SDL perl developers to package their game for end users.

    -After 8 months of work this picture begins to sum it up:
    +Here is the shooter.pl packaged up:
    +
    +
    1. win32/64
    2. +
    3. Linux 5.88
    4. +
    5. Linux 5.10
    6. +

    +We are looking into testing this on a Mac Build server.

    -

    -

    If you cannot wait then grab SDL 2.4 and Alien::SDL 1.2 (pick PANGO support) from CPAN and grab the toolchain branch from the repo. Disclaimer the branch will be volatile for a bit.


    ---yapgh -


    -

    \ No newline at end of file +Caio +


    +

    \ No newline at end of file diff --git a/pages/blog-0004.html-inc b/pages/blog-0004.html-inc index 6e3de57..2bd84fc 100644 --- a/pages/blog-0004.html-inc +++ b/pages/blog-0004.html-inc @@ -1,21 +1,40 @@

    -A summer of possibilities (SDL_perl and GSOC 2010 ) +Getting people to use SDL Perl: Docs, API, and Distribution

    -

    GSOC 2010


    -

    As many of the readers must know The Perl Foundation has been accepted for the GSOC 2010 program. There are several SDL_perl mentors involved in it too. Right now we are accepting student applications.


    +

    The road so far


    +Things have been busy but fruitful. Our two core modules are getting to be a bit more stable. Alien::SDL 1.405 is behaving well. This foundational stability will start to show results in SDL too I believe. Most excitingly the main developer of frozen-bubble is reviewing our Games::FrozenBubble port to CPAN. All good and well, but to keep this project going we need to improve.

    -Process to Apply
    -
    • Sign in as a student here http://socghop.appspot.com/
    • -
    • Submit a proposal before April 5th
    • -
    • Usually it helps to discuss the idea with us on irc (#sdl irc.perl.org)
    • -

    +

    Getting people to use SDL Perl


    +After a long chat with a new SDL user on #sdl today, I realize we still have some way to go. Currently it seems we are lacking in a few areas. We can definitely use some feedback and help in these areas.

    -

    Ideas


    -

    Here are some ideas for SDL perl but we happily accepted student ideas.
    - Make a student wiki page on this site of your ideas! We look forward to helping you guys with your ideas :)


    -
    ---yapgh -


    -

    \ No newline at end of file +
    If anyone wants to help in these areas please talk to us on sdl-devel@perl.org. 
    +


    +

    \ No newline at end of file diff --git a/pages/blog-0005.html-inc b/pages/blog-0005.html-inc index 8978342..ef14036 100644 --- a/pages/blog-0005.html-inc +++ b/pages/blog-0005.html-inc @@ -1,36 +1,10 @@

    -SDL Perl Showcase +Games::FrozenBubble: It is a start!

    -
    -SDL_Mixer and Effects

    +We released a playable (client) frozen bubble on CPAN. There is more work to be done but it is a great start! It currently works on Windows and Linux.

    -

    -This demo shows the new work we have finished for SDL_Mixer support in SDL_perl . (FROGGS++)
    -
    -
    -
    •  Plays ogg files in local directory
    • -
    •  Uses threads and SDL_Mixer effects to extract realtime stereo stream data
    • -
    •  Visulizes stream data as an oscilloscope
    • -

    -
    -Get it at: playlist.pl, you need some .ogg files to play in the same directory. Use the down key to go through them.
    -
    -
    -SDL_TTF support

    -
    -
    -

    -
    -This shows the current work on SDL_TTF support. UTF8 and Uncicode are supported.
    -
    -See the t/ttf.t test in github SDL_perl.
    -
    -
    -
    -Spinner (Destiny Swirl) Arcade Game

    -

    -
    And finally as a proof of concept we have been working a simple arcade game to test our bugs, and scope out our high level bindings. You can get it at the Spinner repo. This wiki page will help you set up for your platforms. 
    -


    -

    \ No newline at end of file +
    +


    +

    \ No newline at end of file diff --git a/pages/blog-0006.html-inc b/pages/blog-0006.html-inc index 7f9c593..3bbdb8b 100644 --- a/pages/blog-0006.html-inc +++ b/pages/blog-0006.html-inc @@ -1,25 +1,15 @@

    -Eye Candy +Release SDL 2.4: Frozen-Bubble begins to go to CPAN

    -
    -clang
    -With each imperfect hit
    -a legendary blade forms
    -

    +
    +SDL 2.4 is released!


    +After 8 months of work this picture begins to sum it up:

    -In prep for the TPM meeting we have been working hard to release a new version of SDL Perl and Alien::SDL. After a lot of feed back from testers (Mike Stok, Stuart Watt, and Chas Owens), we where able to get a working version on 64bit and Mac. The releases will be out tomorrow but here
    -is some eye candy to tide you guys over.
    -
    -
    -This is shooter.pl finally working in MacOSX and 64 bit.
    -
    -

    -
    -k23z_ mentioned I should get some more SDL_perl videos out to attract some devs. So here goes.
    -
    -Walking Guy from SDLPerl on Vimeo. -


    -

    \ No newline at end of file +

    +

    If you cannot wait then grab SDL 2.4 and Alien::SDL 1.2 (pick PANGO support) from CPAN and grab the toolchain branch from the repo. Disclaimer the branch will be volatile for a bit.


    +--yapgh +


    +

    \ No newline at end of file diff --git a/pages/blog-0007.html-inc b/pages/blog-0007.html-inc index 1945937..6e3de57 100644 --- a/pages/blog-0007.html-inc +++ b/pages/blog-0007.html-inc @@ -1,38 +1,21 @@

    -New build system! Needs testing! +A summer of possibilities (SDL_perl and GSOC 2010 )

    -
    -
    -
    -
    -
    Rome was not built,
    -in one day,
     feature creep,
    -existed back then too.
    -
    -

    -
    kmx++ recently worked on a brand new Build system for Alien::SDL and SDL_perl. We have managed to test it in Windows and Linux environments. We would still appreciate testing on all environments. However none of us have a shiny Mac to try this on. So if you have a Mac please consider testing the following:

    -
    • Download Alien::SDL 
    • - -
      • install it
      • -
      • select build by source
      • -
      -
    • Download SDL::perl
    • - -
      • Extract it
      • -
      • perl Build.PL
      • -
      • perl Build
      • -
      • See if Bundling works ( Maybe Brian's article may help )
      • -
    Thank you very much!
    +

    GSOC 2010


    +

    As many of the readers must know The Perl Foundation has been accepted for the GSOC 2010 program. There are several SDL_perl mentors involved in it too. Right now we are accepting student applications.



    -EDIT: 
    - After some  reports back we have found out that SDL_gfx needs 
    -
    -

    -http://cblfs.cross-lfs.org/index.php/SDL_gfx#64Bit
    -
    -

    -We are working to get this done.

    -


    -

    \ No newline at end of file +Process to Apply
    +
    +
    +

    Ideas


    +

    Here are some ideas for SDL perl but we happily accepted student ideas.
    + Make a student wiki page on this site of your ideas! We look forward to helping you guys with your ideas :)


    +
    +--yapgh +


    +

    \ No newline at end of file diff --git a/pages/blog-0008.html-inc b/pages/blog-0008.html-inc index bdf8c94..8978342 100644 --- a/pages/blog-0008.html-inc +++ b/pages/blog-0008.html-inc @@ -1,31 +1,36 @@

    -Quick Game for Toronto Perl Mongers +SDL Perl Showcase

    -
    -
    Beep ... Boop
    -

    +
    +SDL_Mixer and Effects


    -So I am preparing a presentation of the new SDL perl for February's Toronto Perl Mongers meeting. What better way to so off SDL perl then with a game?
    +

    +This demo shows the new work we have finished for SDL_Mixer support in SDL_perl . (FROGGS++)

    -I started hacking a small point an click game a few days back. I really didn't have a idea in mind, but I did have a goal. I wanted to make a game that shows the basics of a game in SDL. Drawing to screen, game loops, physics and so on. I think I have accomplished it so far.

    -Take a look at it here. Download that and call it[Shooter.pl]. To win click the balls.
    +
    •  Plays ogg files in local directory
    • +
    •  Uses threads and SDL_Mixer effects to extract realtime stereo stream data
    • +
    •  Visulizes stream data as an oscilloscope
    • +


    -To play this game you need the following:
    +Get it at: playlist.pl, you need some .ogg files to play in the same directory. Use the down key to go through them.

    -
    • Only for Linux) sudo apt-get install libsdl-dev libsdl_gfx-dev
    • -
    • cpan Alien::SDL
    • -
    • Click Download Source http://github.com/kthakore/SDL_perl/tree/redesign
    • -
    • Extract it
    • -
    • perl Build.PL; perl Build; perl Build install
    • -
    • perl Shooter.pl
    • -

    -I will put up binaries soon-ish.
    +
    +SDL_TTF support

    +
    +
    +

    +
    +This shows the current work on SDL_TTF support. UTF8 and Uncicode are supported.
    +
    +See the t/ttf.t test in github SDL_perl.

    -It is a playable (albeit hard) game right now. All 7 seven levels of it. The purpose of the game is simple click the balls to win. Sounds easy but it isn't. You also get a time in milliseconds after each level. Share your scores on here! I will leave it up to you guys to be honest.

    -I do have to tidy it up and right documentation for it. This way I will be able to present it clearly to my fellow mongers. I am also still looking for ideas to make this a more polished game. FROGGS recommend I make it a classic NES duck hunt game. I thought since I am using gravity I could do a UFO game out of it where you shoot the UFOs. I am open to your ideas. -


    -

    \ No newline at end of file +
    +Spinner (Destiny Swirl) Arcade Game

    +

    +
    And finally as a proof of concept we have been working a simple arcade game to test our bugs, and scope out our high level bindings. You can get it at the Spinner repo. This wiki page will help you set up for your platforms. 
    +


    +

    \ No newline at end of file diff --git a/pages/blog-0009.html-inc b/pages/blog-0009.html-inc index 1cfd8ae..7f9c593 100644 --- a/pages/blog-0009.html-inc +++ b/pages/blog-0009.html-inc @@ -1,14 +1,25 @@

    -SDL_perl 2.3_5 is out! +Eye Candy

    -
    We keep on rolling,
    -rolling,
    -waiting on the world to turn.

    -

    -So a new alpha is out on CPAN, after a bit of a break. We are trying to pick up our speed again. Hopefully we can get back to the weekly updates. This week I am going to try to get Mixer and TTF bindings test, redesigned and doc'd. Hopefully soon we can start working on Frozen Bubble, as things are starting to come together. This alpha release has finally given us a good implementation of SDL Timers. Also Daniel Ruoso has also started a series blog posts of making games with SDL Perl. Hopefully this can get more people in SDL, cause we can sure use the help!
    -
    -More to come --yapgh -


    -

    \ No newline at end of file +
    +clang
    +With each imperfect hit
    +a legendary blade forms
    +

    +
    +
    +In prep for the TPM meeting we have been working hard to release a new version of SDL Perl and Alien::SDL. After a lot of feed back from testers (Mike Stok, Stuart Watt, and Chas Owens), we where able to get a working version on 64bit and Mac. The releases will be out tomorrow but here
    +is some eye candy to tide you guys over.
    +
    +
    +This is shooter.pl finally working in MacOSX and 64 bit.
    +
    +

    +
    +k23z_ mentioned I should get some more SDL_perl videos out to attract some devs. So here goes.
    +
    +Walking Guy from SDLPerl on Vimeo. +


    +

    \ No newline at end of file diff --git a/pages/blog-0010.html-inc b/pages/blog-0010.html-inc index 64faf76..1945937 100644 --- a/pages/blog-0010.html-inc +++ b/pages/blog-0010.html-inc @@ -1,23 +1,38 @@

    -Threaded XS callback finally gets solved. +New build system! Needs testing!

    -

    -Dragged down from the lofty isles,
    -into the guts and gore of the monster,
    -a welcoming cringe in the gut approaches.
    -

    -

    +
    +
    +
    +
    +
    Rome was not built,
    +in one day,
     feature creep,
    +existed back then too.
    +
    +

    +
    kmx++ recently worked on a brand new Build system for Alien::SDL and SDL_perl. We have managed to test it in Windows and Linux environments. We would still appreciate testing on all environments. However none of us have a shiny Mac to try this on. So if you have a Mac please consider testing the following:

    +
    • Download Alien::SDL 
    • + +
      • install it
      • +
      • select build by source
      • +
      +
    • Download SDL::perl
    • + +
      • Extract it
      • +
      • perl Build.PL
      • +
      • perl Build
      • +
      • See if Bundling works ( Maybe Brian's article may help )
      • +
    Thank you very much!

    -So I was planning staying silent until an exam I had was done. But new developers on IRC (j_king, felix and ruoso) pull me back in. Which is a good thing ... I suppose ... because we finally have threaded callbacks for timer and audiospec to work. ruoso++ for this major contribution. If you remember this was the problem we were having.
    -
    -The new callbacks capability in audiospec allow you to procedurally generate sound now. If you would like a simple example take a look at t/core_audiospec.t. However a more fun example may be ruoso++'s tecla (a game for toddlers). Myself and Garu think it is a work of art but that is only because we are toddlers.
    -
    -On a side note some tickets on RT have also received some love ( after 3 or 4 years ... but nonetheless). TonyC++ sorry for the long time in response.
    -
    -More information on the CHANGELOG.
    -
    -Also a shout out to FROGGS for his new SON!!!. Congrats buddy! -


    -

    \ No newline at end of file +EDIT: 
    + After some  reports back we have found out that SDL_gfx needs 
    +
    +

    +http://cblfs.cross-lfs.org/index.php/SDL_gfx#64Bit
    +
    +

    +We are working to get this done.
    +


    +

    \ No newline at end of file diff --git a/pages/blog-0011.html-inc b/pages/blog-0011.html-inc index 21daaf4..bdf8c94 100644 --- a/pages/blog-0011.html-inc +++ b/pages/blog-0011.html-inc @@ -1,18 +1,31 @@

    -SDL Alpha 2: A sneak preview +Quick Game for Toronto Perl Mongers

    -
    Pretty or Ugly,
    -
    Code is Code
    -
    New or Old,
    -
    Code is Code
    -
    Fast or Slow
    -
    Code is Code 
    -

    -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.
    +
    +
    Beep ... Boop
    +


    -

    -
    -


    -

    \ No newline at end of file +So I am preparing a presentation of the new SDL perl for February's Toronto Perl Mongers meeting. What better way to so off SDL perl then with a game?
    +
    +I started hacking a small point an click game a few days back. I really didn't have a idea in mind, but I did have a goal. I wanted to make a game that shows the basics of a game in SDL. Drawing to screen, game loops, physics and so on. I think I have accomplished it so far.
    +
    +Take a look at it here. Download that and call it[Shooter.pl]. To win click the balls.
    +
    +To play this game you need the following:
    +
    +
    +I will put up binaries soon-ish.
    +
    +It is a playable (albeit hard) game right now. All 7 seven levels of it. The purpose of the game is simple click the balls to win. Sounds easy but it isn't. You also get a time in milliseconds after each level. Share your scores on here! I will leave it up to you guys to be honest.
    +
    +I do have to tidy it up and right documentation for it. This way I will be able to present it clearly to my fellow mongers. I am also still looking for ideas to make this a more polished game. FROGGS recommend I make it a classic NES duck hunt game. I thought since I am using gravity I could do a UFO game out of it where you shoot the UFOs. I am open to your ideas. +


    +

    \ No newline at end of file diff --git a/pages/blog-0012.html-inc b/pages/blog-0012.html-inc index c3b4a76..1cfd8ae 100644 --- a/pages/blog-0012.html-inc +++ b/pages/blog-0012.html-inc @@ -1,22 +1,14 @@

    -Developer Release of SDL 2.3_1 +SDL_perl 2.3_5 is out!

    -

    -The city of Rome was built,
    -with the first brick.
    -

    +
    We keep on rolling,
    +rolling,
    +waiting on the world to turn.


    -

    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.
    +So a new alpha is out on CPAN, after a bit of a break. We are trying to pick up our speed again. Hopefully we can get back to the weekly updates. This week I am going to try to get Mixer and TTF bindings test, redesigned and doc'd. Hopefully soon we can start working on Frozen Bubble, as things are starting to come together. This alpha release has finally given us a good implementation of SDL Timers. Also Daniel Ruoso has also started a series blog posts of making games with SDL Perl. Hopefully this can get more people in SDL, cause we can sure use the help!

    -

    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 -


    -

    \ No newline at end of file +More to come --yapgh +


    +

    \ No newline at end of file diff --git a/pages/blog-0013.html-inc b/pages/blog-0013.html-inc index ab2aa11..64faf76 100644 --- a/pages/blog-0013.html-inc +++ b/pages/blog-0013.html-inc @@ -1,17 +1,23 @@

    -SDL Perl Documentation: Reviewers need +Threaded XS callback finally gets solved.


    -The written word,
    -survives;
    -the tests of Time,
    -the fires of Hades,
    -and wrath of Pluto.
    +Dragged down from the lofty isles,
    +into the guts and gore of the monster,
    +a welcoming cringe in the gut approaches.


    -

    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 -


    -

    \ No newline at end of file +
    +So I was planning staying silent until an exam I had was done. But new developers on IRC (j_king, felix and ruoso) pull me back in. Which is a good thing ... I suppose ... because we finally have threaded callbacks for timer and audiospec to work. ruoso++ for this major contribution. If you remember this was the problem we were having.
    +
    +The new callbacks capability in audiospec allow you to procedurally generate sound now. If you would like a simple example take a look at t/core_audiospec.t. However a more fun example may be ruoso++'s tecla (a game for toddlers). Myself and Garu think it is a work of art but that is only because we are toddlers.
    +
    +On a side note some tickets on RT have also received some love ( after 3 or 4 years ... but nonetheless). TonyC++ sorry for the long time in response.
    +
    +More information on the CHANGELOG.
    +
    +Also a shout out to FROGGS for his new SON!!!. Congrats buddy! +


    +

    \ No newline at end of file diff --git a/pages/blog-0014.html-inc b/pages/blog-0014.html-inc index 84a740f..21daaf4 100644 --- a/pages/blog-0014.html-inc +++ b/pages/blog-0014.html-inc @@ -1,35 +1,18 @@

    -Migrating Sol's Tutorial of SDL to SDL_Perl +SDL Alpha 2: A sneak preview

    -
    If I have seen further it is only by standing on the shoulders of giants. --Newton
    +
    Pretty or Ugly,
    +
    Code is Code
    +
    New or Old,
    +
    Code is Code
    +
    Fast or Slow
    +
    Code is Code 

    -

    -

    -

    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
    +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.

    -
    $ perl examples/sols/ch02.pl 
    -


    -

    \ No newline at end of file +

    +
    +


    +

    \ No newline at end of file diff --git a/pages/blog-0015.html-inc b/pages/blog-0015.html-inc index 0de3c83..c3b4a76 100644 --- a/pages/blog-0015.html-inc +++ b/pages/blog-0015.html-inc @@ -1,59 +1,22 @@

    -Once in a while .... (set_event_filter) +Developer Release of SDL 2.3_1

    -

    -Once in a while
    -Things just work!
    +

    +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.

    -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
    +

    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.

    -
     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 +
    +

    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 +


    +

    \ No newline at end of file diff --git a/pages/blog-0016.html-inc b/pages/blog-0016.html-inc index e65be37..ab2aa11 100644 --- a/pages/blog-0016.html-inc +++ b/pages/blog-0016.html-inc @@ -1,36 +1,17 @@

    -Hello Mouse? An Example of the New Event Code +SDL Perl Documentation: Reviewers need

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

    +

    +The written word,
    +survives;
    +the tests of Time,
    +the fires of Hades,
    +and wrath of Pluto.
    +


    -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 +

    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 +


    +

    \ No newline at end of file diff --git a/pages/blog-0017.html-inc b/pages/blog-0017.html-inc index 5c755ef..84a740f 100644 --- a/pages/blog-0017.html-inc +++ b/pages/blog-0017.html-inc @@ -1,19 +1,35 @@

    -Development Update +Migrating Sol's Tutorial of SDL to SDL_Perl

    -
    Short and Sweet
    +
    If I have seen further it is only by standing on the shoulders of giants. --Newton

    -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
    • -

    -SDL Smoke tests
    +

    +

    +

    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

    -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.
    +Then you can run this script by doing

    -[Edit] Please read http://sdlperl.ath.cx/projects/SDLPerl/wiki/Testing on how to get started in test! -


    -

    \ No newline at end of file +
    $ perl examples/sols/ch02.pl 
    +


    +

    \ No newline at end of file diff --git a/pages/blog-0018.html-inc b/pages/blog-0018.html-inc index e9ae7e4..0de3c83 100644 --- a/pages/blog-0018.html-inc +++ b/pages/blog-0018.html-inc @@ -1,29 +1,59 @@

    -Development Update +Once in a while .... (set_event_filter)

    -

    -A stoic stone will sit idle,
    -but will some effort,
    -A rolling rock will run!
    +

    +Once in a while
    +Things just work!


    -In the past week the SDL Perl team has been busy! This is what we have accomplished

    -
    -

    Commitment to Testing!

    In an effort to focus on continuing our focus on testing we have setup a Smolder site for the SDL redesign process. Currently we have two platforms (linux, windows32) regularly tested on here. If there are more people following the redesign process and would like to share their test results; contact us at sdl-devel@perl.org and we will provide access to you.
    -
    -

    SDL::Video

    For the core development most of the focus has been on redesigning around the Video category of the SDL perl API. As of now we are 50% done. 19 functions out of 38 functions have been implemented and tested.
    -
    -
    -

    Site Redesign + Migration

    On the end of the spectrum, Froggs has been hard at work on the graphical design of the site. More over with mst's help we will soon be migrating to http://sdl.perl.org.
    -
    -
    -
    -

    Documentation

    Moreover this week we have seen an increase effort from magnet on the SDL docs. Kudos!
    -
    -
    -

    SWIG Experimentation

    Finally Katrina has begun looking into SWIG as alternative for SDL in the future. -


    -

    \ No newline at end of file +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 diff --git a/pages/blog-0019.html-inc b/pages/blog-0019.html-inc index be4934e..e65be37 100644 --- a/pages/blog-0019.html-inc +++ b/pages/blog-0019.html-inc @@ -1,26 +1,36 @@

    -The Future and Beyond! +Hello Mouse? An Example of the New Event Code

    -
    I do not think about awesomeness...
    -I just am awesomeness
    -n.n
    ---KatrinaTheLamia

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


    -

    Updates

    Since the last post SDL Perl has seen an increase of interest to both use and contribute to SDL Perl. Before I dig into the updates, I would like to acknowledge them.
    -

    Core Development

    Acme (Leon Brocard): Has started to work on the Redesign Effort with me. The help is much appreciated! Enjoy your vacation.
    +You need the new code from the redesign branch to use this .

    -

    Website and Windows Testing

    FROGGS (Tobias Leich): Came in as a new user to SDL Perl. And after breaking the redesigned SDL Perl in as many ways possible he has decided to help out on the new site.
    -
    -
    -

    Last Legacy Release


    -Ok! Now this weekend hopefully we will release our last legacy release, after this we move on! This release will focus on showing of SDL + Perl possibilities.
    -

    Pong + SDL::Game::Rect

    garu has been working on making SDL object extensions that provide a more perly way to use and play with the SDL bindings. To demonstrate the benefits of this SDL::Tutorial::Pong is done and being polished up. SDL::Game::Rect is a peek in to the design and vision we have for SDL down the road.
    -

    Design

    The design we have settled on for future release for SDL Perl can be broken in to two layers, SDL::* and SDL::Game::*. Previously the SDL Perl library tried to provide C bindings and provide Perl Idiomatic access. This was messy in regards to the single responsibility principle (do one thing and do it well).
    -
    -We have decided to separate these two focuses into the two name spaces SDL::* and SDL::Game::*. SDL::* will provide straight access to SDL's C API, nothing less and nothing more. SDL::Game::* will extend and make pretty unicorns for Perl.
    -
    -This design has already begin to pay of. One major benefit been in the XS readability. Moreover since structs are treated as objects, Perl manages their destruction, and deliver less memory leaks. -


    -

    \ No newline at end of file +
    #!/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 diff --git a/pages/blog-0020.html-inc b/pages/blog-0020.html-inc index f5d4032..5c755ef 100644 --- a/pages/blog-0020.html-inc +++ b/pages/blog-0020.html-inc @@ -1,26 +1,19 @@

    -The beginnings of modular design for SDL Perl +Development Update

    -
    “Do or do not... there is no try.”
    -
    --yoda
    +
    Short and Sweet
    +

    +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
    • +

    +SDL Smoke tests

    -

    The design before


    -The bindings before were all in one huge XS file. This was then exported into the SDL module. This means that the XS file has to handle with macros if any component (e.x SDL_Mixer) is not compiled. Moreover having ever binding in one XS file prevents use to treat C structs as object with only one point of free and malloc. This would be BEGIN and DESTROY in Perl. Also the monolithic design introduces a lot of bugs because we have to use free and malloc all over the place. Lastly SDL monolithic design has the constructor for all structs in both Perl and in XS.
    +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.

    -

    The design we are aiming for

    Simple one XS per Module. This would also simplify the Build code.
    -
    -

    First Step


    -We have began with SDL Rect. It is in github master branch now. We are in the progress of making it back compatible. Originally SDL::Rect took named variables as parameters for new(). Now since the constructor is in XS we have only unnamed parameters.
    -
    -
    -

    Before


    -SDL::Rect->new( -x => 0, -y => 0, -width => 0, -height => 0);
    -
    -

    After


    -SDL::Rect->new(0, 0, 0, 0);
    -
    -Ideally we would like both ways of constructing Rect. -


    -

    \ No newline at end of file +[Edit] Please read http://sdlperl.ath.cx/projects/SDLPerl/wiki/Testing on how to get started in test! +


    +

    \ No newline at end of file diff --git a/pages/blog-0021.html-inc b/pages/blog-0021.html-inc index bafe6a1..e9ae7e4 100644 --- a/pages/blog-0021.html-inc +++ b/pages/blog-0021.html-inc @@ -1,34 +1,29 @@

    -Why and How Frozen Bubble is going to CPAN +Development Update

    -
    A single drop,
    -
    causes the ocean to swell
    -

    -
    So 5 weeks ago, SDL Perl was broken. It had been for several years. After the last release SDL Perl works ... somewhat. The quick releases that you have seen have been work-arounds, fixes and refactoring. This is not bad for a few weeks of work but, there is a point where code smell and technical debt is too huge to fix with out redesigning. This is that point.
    -

    -
    Since the redesigning will take time and effort it will be good to have a leg up. This leg up is Frozen Bubble 2.20. Frozen Bubble employs a lot of C and Perl hacks to cover up for SDL Perl's lacking. This will help in a sense fast forward the code status to 2008. Since Frozen Bubble is helping us out, we can go one step forward and help it out!
    -

    -
    So Alias (Adam Kennedy) and I have started work on making Frozen Bubble CPAN accessible. Frozen Bubble is a well know game and making it cross-platform will bring lots of attention and hopefully contributions to SDL Perl.
    -

    -
    In Alias's earlier post about this he mentioned about making a splash and some other stuff. I will talk about how and where we will be accomplishing this task.
    -

    -
    First we will be tracking Frozen Bubble on the new SDL Perl Trac website. This site will be similar to Padre's Trac site. As a bonus for people looking to help out in SDL Perl I have separated tasks by perceived difficulty. This will help to breakdown harder task too.
    -

    -
    For example for Frozen Bubble the two major bumps we have run into so far are:
    -

    -
    Migrating the SDL Perl workarounds: Ticket #3
    -
    Making the Build System Portable: Ticket #7
    -

    -
    The first one will be difficult as it involves XS. So I will break it down into easier tasks with specific instruction which can then hopefully be picked up by interested contributers. The second one there is sort of a forte of Adam so I will leave it up to him. This is the process I am proposing make hard tickets, break them down.
    -

    -
    This will generate a lot of easy tickets that will hopefully be synchronized.  If you are interested in this please give me a shout on #sdl irc.perl.org or the mailing list at sdl-devel@perl.org and I will get you registered.
    -

    -
    --yapgh
    -

    -

    -

    -
    -


    -

    \ No newline at end of file +

    +A stoic stone will sit idle,
    +but will some effort,
    +A rolling rock will run!
    +

    +

    +In the past week the SDL Perl team has been busy! This is what we have accomplished
    +
    +
    +

    Commitment to Testing!

    In an effort to focus on continuing our focus on testing we have setup a Smolder site for the SDL redesign process. Currently we have two platforms (linux, windows32) regularly tested on here. If there are more people following the redesign process and would like to share their test results; contact us at sdl-devel@perl.org and we will provide access to you.
    +
    +

    SDL::Video

    For the core development most of the focus has been on redesigning around the Video category of the SDL perl API. As of now we are 50% done. 19 functions out of 38 functions have been implemented and tested.
    +
    +
    +

    Site Redesign + Migration

    On the end of the spectrum, Froggs has been hard at work on the graphical design of the site. More over with mst's help we will soon be migrating to http://sdl.perl.org.
    +
    +
    +
    +

    Documentation

    Moreover this week we have seen an increase effort from magnet on the SDL docs. Kudos!
    +
    +
    +

    SWIG Experimentation

    Finally Katrina has begun looking into SWIG as alternative for SDL in the future. +


    +

    \ No newline at end of file diff --git a/pages/blog-0022.html-inc b/pages/blog-0022.html-inc index f91dff1..be4934e 100644 --- a/pages/blog-0022.html-inc +++ b/pages/blog-0022.html-inc @@ -1,28 +1,26 @@

    -HackFest: Results +The Future and Beyond!

    -
    The beautiful sunset,
    -
    is no match for,
    -
    the ugly sunrise
    -

    -

    Results

    On Sunday we had a hackfest on #sdl irc.perl.org. This is what we got done.
    -
    -

    +
    I do not think about awesomeness...
    +I just am awesomeness
    +n.n
    +--KatrinaTheLamia


    +

    Updates

    Since the last post SDL Perl has seen an increase of interest to both use and contribute to SDL Perl. Before I dig into the updates, I would like to acknowledge them.
    +

    Core Development

    Acme (Leon Brocard): Has started to work on the Redesign Effort with me. The help is much appreciated! Enjoy your vacation.
    +
    +

    Website and Windows Testing

    FROGGS (Tobias Leich): Came in as a new user to SDL Perl. And after breaking the redesigned SDL Perl in as many ways possible he has decided to help out on the new site.
    +

    -
    1. MacOSX build is working again. It's still rough but Tetris works on it now. dngor++
    2. -
    3. SDL::Tutorial::Tetris is on CPAN as v0.15. nferraz++
    4. -
    5. SDL Perl docs are a little better now. magnet++
    6. -
    7. Finally experimental Rect and Game::Rect are behaving. There is still more work needed in Game::Rect. Moreover there are more tests on the experimental release. garu++
    8. -
    9. Also POGL is working experimentally with SDL.
      -
    10. -
    Hopefully I can get the first three results into the next release soon. The next release 2.2.3 will go up as a developmental release first. Also the experimental branch is going up as version 2_4.
    +

    Last Legacy Release


    +Ok! Now this weekend hopefully we will release our last legacy release, after this we move on! This release will focus on showing of SDL + Perl possibilities.
    +

    Pong + SDL::Game::Rect

    garu has been working on making SDL object extensions that provide a more perly way to use and play with the SDL bindings. To demonstrate the benefits of this SDL::Tutorial::Pong is done and being polished up. SDL::Game::Rect is a peek in to the design and vision we have for SDL down the road.
    +

    Design

    The design we have settled on for future release for SDL Perl can be broken in to two layers, SDL::* and SDL::Game::*. Previously the SDL Perl library tried to provide C bindings and provide Perl Idiomatic access. This was messy in regards to the single responsibility principle (do one thing and do it well).

    -

    Developers

    All developers please tell me what to put you guys want to be put down as on the
    -in the Docs for the SDL Perl Team section.
    +We have decided to separate these two focuses into the two name spaces SDL::* and SDL::Game::*. SDL::* will provide straight access to SDL's C API, nothing less and nothing more. SDL::Game::* will extend and make pretty unicorns for Perl.

    ---yapgh -


    -

    \ No newline at end of file +This design has already begin to pay of. One major benefit been in the XS readability. Moreover since structs are treated as objects, Perl manages their destruction, and deliver less memory leaks. +


    +

    \ No newline at end of file diff --git a/pages/blog-0023.html-inc b/pages/blog-0023.html-inc index 2c25bd4..f5d4032 100644 --- a/pages/blog-0023.html-inc +++ b/pages/blog-0023.html-inc @@ -1,25 +1,26 @@

    -Updates, Falling Block Game, and Hack Fest +The beginnings of modular design for SDL Perl

    -
    Silent but active,
    -Small but deadly.
    -

    -

    +
    “Do or do not... there is no try.”
    +
    --yoda

    -

    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.
    +

    The design before


    +The bindings before were all in one huge XS file. This was then exported into the SDL module. This means that the XS file has to handle with macros if any component (e.x SDL_Mixer) is not compiled. Moreover having ever binding in one XS file prevents use to treat C structs as object with only one point of free and malloc. This would be BEGIN and DESTROY in Perl. Also the monolithic design introduces a lot of bugs because we have to use free and malloc all over the place. Lastly SDL monolithic design has the constructor for all structs in both Perl and in XS.

    +

    The design we are aiming for

    Simple one XS per Module. This would also simplify the Build code.

    +

    First Step


    +We have began with SDL Rect. It is in github master branch now. We are in the progress of making it back compatible. Originally SDL::Rect took named variables as parameters for new(). Now since the constructor is in XS we have only unnamed parameters.

    -

    -

    -


    +

    Before


    +SDL::Rect->new( -x => 0, -y => 0, -width => 0, -height => 0);

    +

    After


    +SDL::Rect->new(0, 0, 0, 0);

    -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 +Ideally we would like both ways of constructing Rect. +


    +

    \ No newline at end of file diff --git a/pages/blog-0024.html-inc b/pages/blog-0024.html-inc index 98b8226..bafe6a1 100644 --- a/pages/blog-0024.html-inc +++ b/pages/blog-0024.html-inc @@ -1,28 +1,34 @@

    -Thanks nothingmuch, and updates +Why and How Frozen Bubble is going to CPAN

    -
    struggle,
    -
    live,
    -
    cease,
    -
    die
    -

    -
    After a struggling with XS and opaque C structs in the experimental SDL::Rect for a long time. Nothingmuch comes along and solves my problem with this beautiful module XS::Object::Magic. So I will start moving my ugly XS to Magic Land.
    -
    -SDL Perl Tutorials
    -
    -This past week I have been working on the sorry state of SDL Perl tutorials. Currently I am working on a Tetris Clone. I am hoping to have it done by next Thrusday for TPM meeting. This tutorial is a mix of several tutorials I found online. Another Lunar Lander tutorial has been submitted by Nelson Ferraz.
    -
    -If anyone has any really good tutorials for game development (regardless of language) or even request of tutorials. Send it my way I will look into them.
    -
    -New SDL Perl site
    -
    -Also we have begin work on a new site. It is still needs work. New Site.
    -
    ---yapgh
    -
    -
    -
    -


    -

    \ No newline at end of file +
    A single drop,
    +
    causes the ocean to swell
    +

    +
    So 5 weeks ago, SDL Perl was broken. It had been for several years. After the last release SDL Perl works ... somewhat. The quick releases that you have seen have been work-arounds, fixes and refactoring. This is not bad for a few weeks of work but, there is a point where code smell and technical debt is too huge to fix with out redesigning. This is that point.
    +

    +
    Since the redesigning will take time and effort it will be good to have a leg up. This leg up is Frozen Bubble 2.20. Frozen Bubble employs a lot of C and Perl hacks to cover up for SDL Perl's lacking. This will help in a sense fast forward the code status to 2008. Since Frozen Bubble is helping us out, we can go one step forward and help it out!
    +

    +
    So Alias (Adam Kennedy) and I have started work on making Frozen Bubble CPAN accessible. Frozen Bubble is a well know game and making it cross-platform will bring lots of attention and hopefully contributions to SDL Perl.
    +

    +
    In Alias's earlier post about this he mentioned about making a splash and some other stuff. I will talk about how and where we will be accomplishing this task.
    +

    +
    First we will be tracking Frozen Bubble on the new SDL Perl Trac website. This site will be similar to Padre's Trac site. As a bonus for people looking to help out in SDL Perl I have separated tasks by perceived difficulty. This will help to breakdown harder task too.
    +

    +
    For example for Frozen Bubble the two major bumps we have run into so far are:
    +

    +
    Migrating the SDL Perl workarounds: Ticket #3
    +
    Making the Build System Portable: Ticket #7
    +

    +
    The first one will be difficult as it involves XS. So I will break it down into easier tasks with specific instruction which can then hopefully be picked up by interested contributers. The second one there is sort of a forte of Adam so I will leave it up to him. This is the process I am proposing make hard tickets, break them down.
    +

    +
    This will generate a lot of easy tickets that will hopefully be synchronized.  If you are interested in this please give me a shout on #sdl irc.perl.org or the mailing list at sdl-devel@perl.org and I will get you registered.
    +

    +
    --yapgh
    +

    +

    +

    +
    +


    +

    \ No newline at end of file diff --git a/pages/blog-0025.html-inc b/pages/blog-0025.html-inc index 06aca75..f91dff1 100644 --- a/pages/blog-0025.html-inc +++ b/pages/blog-0025.html-inc @@ -1,40 +1,28 @@

    -Design of SDL::Rect +HackFest: Results

    -

    -you say things,
    -I hear,
    -but don't listen,
    -
    -you show things,
    -I see,
    -but don't understand,
    -
    -you write things,
    -I read,
    -but don't know.
    -

    -Lately we have been working on cleaning up the XS name spaces of SDL perl. After some bumps and falls we came up with a separated Rect module. Rect is one of the most simple C struct as shown below.
    -
    -
    -
    -Using the awesome perlobject.map as a reference I was able to create a blessed perl object in XS. So now SDL::Rect->new(...) gave us a blessed reference ready to go. And as an icing it would destroy itself properly no matter where it was used. But once I brought it into our existing code base, garu pointed out the extending it was a little bit of a mess. So far to extend Rect we have to something like below. Any comment or advice would be much appreciated.
    -
    -
    -
    -
    -
    -Have at it I am a big boy. You can grab the code like this.
    -Only If you don't already have a local git repo:
    -
    -
    mkdir SDL
    -cd SDL
    -git init .

    -Then do this or skip to this if you already have a local git repo
    -
    git pull git://github.com/kthakore/SDL_perl.git experimental
    -


    -

    \ No newline at end of file +
    The beautiful sunset,
    +
    is no match for,
    +
    the ugly sunrise
    +

    +

    Results

    On Sunday we had a hackfest on #sdl irc.perl.org. This is what we got done.
    +
    +

    +

    +
    +
    1. MacOSX build is working again. It's still rough but Tetris works on it now. dngor++
    2. +
    3. SDL::Tutorial::Tetris is on CPAN as v0.15. nferraz++
    4. +
    5. SDL Perl docs are a little better now. magnet++
    6. +
    7. Finally experimental Rect and Game::Rect are behaving. There is still more work needed in Game::Rect. Moreover there are more tests on the experimental release. garu++
    8. +
    9. Also POGL is working experimentally with SDL.
      +
    10. +
    Hopefully I can get the first three results into the next release soon. The next release 2.2.3 will go up as a developmental release first. Also the experimental branch is going up as version 2_4.
    +
    +

    Developers

    All developers please tell me what to put you guys want to be put down as on the
    +in the Docs for the SDL Perl Team section.
    +
    +--yapgh +


    +

    \ No newline at end of file diff --git a/pages/documentation.html-inc b/pages/documentation.html-inc index 0eefce8..082b192 100644 --- a/pages/documentation.html-inc +++ b/pages/documentation.html-inc @@ -1,2 +1,2 @@
    -

    Documentation (latest development branch)

    Core
    thumbSDL- Simple DirectMedia Layer for Perl
    thumbSDL::Credits- Authors and contributors of the SDL Perl project
    thumbSDL::Time- An SDL Perl extension for managing timers
    Audio
    thumbSDL::Audio- SDL Bindings for Audio
    Structure
    thumbSDL::AudioCVT- Audio Conversion Structure
    thumbSDL::AudioSpec- SDL Bindings for structure SDL::AudioSpec
    CDROM
    thumbSDL::CDROM- SDL Bindings for the CDROM device
    Structure
    thumbSDL::CD- SDL Bindings for structure SDL_CD
    thumbSDL::CDTrack- SDL Bindings for structure SDL_CDTrack
    Events
    thumbSDL::Events- Bindings to the Events Category in SDL API
    Structure
    thumbSDL::Event- General event structure
    Joystick
    thumbSDL::Joystick- SDL Bindings for the Joystick device
    Mouse
    thumbSDL::Mouse- SDL Bindings for the Mouse device
    Structure
    thumbSDL::Cursor- Mouse cursor structure
    Structure
    thumbSDL::Version- SDL Bindings for structure SDL_Version
    Video
    thumbSDL::Video- Bindings to the video category in SDL API
    Structure
    thumbSDL::Color- Format independent color description
    thumbSDL::Overlay- YUV Video overlay
    thumbSDL::Palette- Color palette for 8-bit pixel formats
    thumbSDL::PixelFormat- Stores surface format information
    thumbSDL::Rect- Defines a rectangular area
    thumbSDL::Surface- Graphic surface structure.
    thumbSDL::VideoInfo- Video Target Information

    Cookbook
    thumbSDL::Cookbook
    thumbSDL::Cookbook::PDL

    Extension
    thumbSDL::App- a SDL perl extension

    GFX
    thumbSDL::GFX::Framerate- framerate calculating functions
    thumbSDL::GFX::Primitives- basic drawing functions
    Structure
    thumbSDL::GFX::FPSManager- data structure used by SDL::GFX::Framerate

    Image
    thumbSDL::Image- Bindings for the SDL_Image library

    Mixer
    thumbSDL::Mixer- Sound and music functions
    thumbSDL::Mixer::Channels- SDL::Mixer channel functions and bindings
    thumbSDL::Mixer::Effects- sound effect functions
    thumbSDL::Mixer::Groups- Audio channel group functions
    thumbSDL::Mixer::Music- functions for music
    thumbSDL::Mixer::Samples- functions for loading sound samples
    Structure
    thumbSDL::Mixer::MixChunk- SDL Bindings for structure SDL_MixChunk
    thumbSDL::Mixer::MixMusic- SDL Bindings for structure SDL_MixMusic

    Pango
    thumbSDL::Pango- Text rendering engine
    Structure
    thumbSDL::Pango::Context- Context object for SDL::Pango

    TODO
    thumbSDL::MPEG- a SDL perl extension
    thumbSDL::OpenGL- a perl extension
    thumbSDL::SMPEG- a SDL perl extension
    MultiThread
    thumbSDL::MultiThread- Bindings to the MultiThread category in SDL API
    Structure
    thumbSDL::RWOps- SDL Bindings to SDL_RWOPs
    GFX
    thumbSDL::GFX::BlitFunc- blitting functions
    thumbSDL::GFX::ImageFilter- image filtering functions
    thumbSDL::GFX::Rotozoom- rotation and zooming functions for surfaces

    TTF
    thumbSDL::TTF- True Type Font functions (libfreetype)
    Structure
    thumbSDL::TTF::Font- Font object type for SDL_ttf

    Tutorials
    thumbSDL::Tutorial- introduction to Perl SDL
    thumbSDL::Tutorial::Animation
    thumbSDL::Tutorial::LunarLander- a small tutorial on Perl SDL
    +

    Documentation (latest development branch)

    Core
    thumbSDL- Simple DirectMedia Layer for Perl
    thumbSDL::Credits- Authors and contributors of the SDL Perl project
    thumbSDL::Time- An SDL Perl extension for managing timers
    Audio
    thumbSDL::Audio- SDL Bindings for Audio
    Structure
    thumbSDL::AudioCVT- Audio Conversion Structure
    thumbSDL::AudioSpec- SDL Bindings for structure SDL::AudioSpec
    CDROM
    thumbSDL::CDROM- SDL Bindings for the CDROM device
    Structure
    thumbSDL::CD- SDL Bindings for structure SDL_CD
    thumbSDL::CDTrack- SDL Bindings for structure SDL_CDTrack
    Events
    thumbSDL::Events- Bindings to the Events Category in SDL API
    Structure
    thumbSDL::Event- General event structure
    Joystick
    thumbSDL::Joystick- SDL Bindings for the Joystick device
    Mouse
    thumbSDL::Mouse- SDL Bindings for the Mouse device
    Structure
    thumbSDL::Cursor- Mouse cursor structure
    Structure
    thumbSDL::Version- SDL Bindings for structure SDL_Version
    Video
    thumbSDL::Video- Bindings to the video category in SDL API
    Structure
    thumbSDL::Color- Format independent color description
    thumbSDL::Overlay- YUV Video overlay
    thumbSDL::Palette- Color palette for 8-bit pixel formats
    thumbSDL::PixelFormat- Stores surface format information
    thumbSDL::Rect- Defines a rectangular area
    thumbSDL::Surface- Graphic surface structure.
    thumbSDL::VideoInfo- Video Target Information

    Cookbook
    thumbSDL::Cookbook
    thumbSDL::Cookbook::OpenGL- Using SDL with OpenGL
    thumbSDL::Cookbook::PDL

    Extension
    thumbSDLx::App- a SDL perl extension

    GFX
    thumbSDL::GFX::Framerate- framerate calculating functions
    thumbSDL::GFX::Primitives- basic drawing functions
    Structure
    thumbSDL::GFX::FPSManager- data structure used by SDL::GFX::Framerate

    Image
    thumbSDL::Image- Bindings for the SDL_Image library

    Mixer
    thumbSDL::Mixer- Sound and music functions
    thumbSDL::Mixer::Channels- SDL::Mixer channel functions and bindings
    thumbSDL::Mixer::Effects- sound effect functions
    thumbSDL::Mixer::Groups- Audio channel group functions
    thumbSDL::Mixer::Music- functions for music
    thumbSDL::Mixer::Samples- functions for loading sound samples
    Structure
    thumbSDL::Mixer::MixChunk- SDL Bindings for structure SDL_MixChunk
    thumbSDL::Mixer::MixMusic- SDL Bindings for structure SDL_MixMusic

    Pango
    thumbSDL::Pango- Text rendering engine
    Structure
    thumbSDL::Pango::Context- Context object for SDL::Pango

    TODO
    thumbSDL::MPEG- a SDL perl extension
    thumbSDL::SMPEG- a SDL perl extension
    MultiThread
    thumbSDL::MultiThread- Bindings to the MultiThread category in SDL API
    Structure
    thumbSDL::RWOps- SDL Bindings to SDL_RWOPs
    GFX
    thumbSDL::GFX::BlitFunc- blitting functions
    thumbSDL::GFX::ImageFilter- image filtering functions
    thumbSDL::GFX::Rotozoom- rotation and zooming functions for surfaces

    TTF
    thumbSDL::TTF- True Type Font functions (libfreetype)
    Structure
    thumbSDL::TTF::Font- Font object type for SDL_ttf

    Tutorials
    thumbSDL::Tutorial- introduction to Perl SDL
    thumbSDL::Tutorial::Animation
    thumbSDL::Tutorial::LunarLander- a small tutorial on Perl SDL
    diff --git a/pages/index.html-inc b/pages/index.html-inc index 4196de8..57cc98f 100644 --- a/pages/index.html-inc +++ b/pages/index.html-inc @@ -11,7 +11,7 @@
  • Latest News -