X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pages%2Fblog-0005.html-inc;h=a69f1fc6a4cffd3c930442914f225f1fc4036078;hb=8d3f70f2a099e5c99545142b8dcb2368ab3f9b1f;hp=8c28eca94b46751695aef8b7f72582a2a6b8c279;hpb=8ba276b2c6076af85d8b6bed232287d48ce943e4;p=sdlgit%2FSDL-Site.git diff --git a/pages/blog-0005.html-inc b/pages/blog-0005.html-inc index 8c28eca..a69f1fc 100644 --- a/pages/blog-0005.html-inc +++ b/pages/blog-0005.html-inc @@ -1,6 +1,6 @@

-The beginnings of modular design for SDL Perl +The Future and Beyond!

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

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);

Ideally we would like both ways of constructing Rect.
\ No newline at end of file +
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.


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