X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pages%2Fblog-0012.html-inc;h=b1abc1d15ace99fb968ddcc0866bb1101ddb8cbf;hb=e785862422f3e827a242fc244bd57b23443887ce;hp=fe4b8d48d37cc0a4205e7c209051f61deb0a418b;hpb=cf23a5dab86667dca8475ee830e684c9944f115f;p=sdlgit%2FSDL-Site.git diff --git a/pages/blog-0012.html-inc b/pages/blog-0012.html-inc index fe4b8d4..b1abc1d 100644 --- a/pages/blog-0012.html-inc +++ b/pages/blog-0012.html-inc @@ -1,6 +1,23 @@

-The beginnings of modular design for SDL Perl +Huge World Maps in less then 100 lines

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

+Hello folks,
+
+Recently we have been working on making the Perl syntax sugar for SDL in the form of SDLx. So far we have got the SDLx::Surface and SDLx::Sprite (garu++) done. So the first thing we did was throw together a quick Zelda map walker. As you can see above.  The code is at http://gist.github.com/478440. The SDL code that this depends on will be SDL 2.503 soonish . We are in the process of cleaning up some more SDLx and Alien::SDL bugs. After that SDLx::App will be overhauled to make this sort of thing even easier. Finally living up to our goal of  'Simple Games Easy. Complex Games Possible.' 
+
+
+UPDATE: with some help, and newcomer jtpalmer's help we have added Link
+ 
+
+

+
+
+
+

+
+--caio yapgh
+


+

\ No newline at end of file