uodate
[sdlgit/SDL-Site.git] / pages / blog-0024.html-inc
index de898c4..f5d4032 100644 (file)
@@ -1,6 +1,26 @@
 <div class="blog">
 <h1 id="NAME">
-My milestones (itches) for gaming in Perl
+The beginnings of modular design for SDL Perl
 </h1>
 <div class="CONTENT">
-<div style="text-align: right;"><br /><blockquote><blockquote><i>As a young sprout in spring, </i><br /><i>the soil is moist,</i><br /><i>and the sun bright. </i><br /><i><br /></i><br /><i>But as fall comes,</i><br /><i>with fading leaves,</i><br /><i>my roots keep me standing.&nbsp;</i></blockquote></blockquote></div><br /><br /><br />As a new Perl developer I am able to contribute with <a href="http://github.com/kthakore/SDL_perl/commits/">great enthusiasm</a> due to the <a href="http://www.irc.perl.org/">great community</a> and the fancies of the language. However I know that these things will fade and I will need something else to take the place. Usually what has worked for me in the past was to set milestones. These will act as roots, keeping me interested in being involved. After all in words better than mines.<br /><blockquote><i>We all “scratch our own itches”. It’s why I started Linux, it’s why I started git, and it’s why I am still involved. --<a href="http://www.linux-mag.com/cache/7439/1.html">Linus</a><br /></i></blockquote><br />So here are my evolving milestones for Gaming in Perl:<br /><ul><li> Make Tetris,Pong, so on [soon-ish]<br /></li><ul><li>Hack it until its Perly (shows the power Perl can provide for games) </li></ul><li>Do game-a-thon [Starting January 2010]<br /></li><ul><li>Simply</li><ul><li> Get two random words (Warp + hole = portal)<br /></li><li> Make a small game</li><li>Every week for 52 weeks</li></ul></ul><li>Use the results from this to make some Perl specific tools [Parallel to game-a-thon]<br /></li><ul><li>SDL::Game&nbsp;</li></ul></ul>--signed YAPGH<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3102167581424744259-215619435826309735?l=yapgh.blogspot.com'/></div></div></div>
\ No newline at end of file
+<div style="text-align: right;"><i>“Do or do not... there is no try.”</i><br />
+</div><div style="text-align: right;"><i>--yoda </i><br />
+<br />
+</div><h1>The design before</h1><br />
+The bindings before were all in <a href="http://github.com/kthakore/SDL_perl/blob/master/src/SDL.xs">one huge XS file</a>. 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. <br />
+<br />
+<h1>The design we are aiming for</h1>Simple <a href="http://github.com/kthakore/SDL_perl/blob/master/src/Rect.xs">one XS</a> per Module. This would also simplify the Build code.<br />
+<br />
+<h2>First Step </h2><br />
+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 <a href="http://github.com/kthakore/SDL_perl/blob/master/src/Rect.xs#L16">is in XS</a> we have only unnamed parameters. <br />
+<br />
+<br />
+<h3>Before</h3><br />
+SDL::Rect-&gt;new( -x =&gt; 0, -y =&gt; 0, -width =&gt; 0, -height =&gt; 0);<br />
+<br />
+<h3>After</h3><br />
+SDL::Rect-&gt;new(0, 0, 0, 0);<br />
+<br />
+Ideally we would like both ways of constructing Rect.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3102167581424744259-6151839795039915111?l=yapgh.blogspot.com' alt='' /></div>
+<p><a href="http://feedads.g.doubleclick.net/~a/kLUEuAPtuInPChqB2WfChUn3YyI/0/da"><img src="http://feedads.g.doubleclick.net/~a/kLUEuAPtuInPChqB2WfChUn3YyI/0/di" border="0" ismap="true"></img></a><br/>
+<a href="http://feedads.g.doubleclick.net/~a/kLUEuAPtuInPChqB2WfChUn3YyI/1/da"><img src="http://feedads.g.doubleclick.net/~a/kLUEuAPtuInPChqB2WfChUn3YyI/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/YetAnotherPerlGameHackeryapgh/~4/uEzoBWRJEks" height="1" width="1"/></div></div>
\ No newline at end of file