<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>gljakal.com - blog</title>
	<atom:link href="http://www.gljakal.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gljakal.com/blog</link>
	<description></description>
	<lastBuildDate>Mon, 16 Aug 2010 09:58:25 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Screenshot update</title>
		<link>http://www.gljakal.com/blog/2010/08/16/screenshot-update/</link>
		<comments>http://www.gljakal.com/blog/2010/08/16/screenshot-update/#comments</comments>
		<pubDate>Mon, 16 Aug 2010 09:58:25 +0000</pubDate>
		<dc:creator>glJakaL</dc:creator>
				<category><![CDATA[game]]></category>
		<category><![CDATA[screenshots]]></category>

		<guid isPermaLink="false">http://www.gljakal.com/blog/2010/08/16/screenshot-update/</guid>
		<description><![CDATA[Progress! Here is a screenshot of the game with some decent (but still very WIP) graphics:
 
And here is the same level inside the editor:


  addthis_url    = 'http%3A%2F%2Fwww.gljakal.com%2Fblog%2F2010%2F08%2F16%2Fscreenshot-update%2F';
  addthis_title  = 'Screenshot+update';
  addthis_pub    = 'gljakal';

]]></description>
			<content:encoded><![CDATA[<p>Progress! Here is a screenshot of the game with some decent (but still very WIP) graphics:</p>
<p><a href="http://www.gljakal.com/blog/wp-content/uploads/2010/08/image.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="Game Screenshot" border="0" alt="Game Screenshot" src="http://www.gljakal.com/blog/wp-content/uploads/2010/08/image_thumb.png" width="400" height="300" /></a> </p>
<p>And here is the same level inside the editor:</p>
<p><a href="http://www.gljakal.com/blog/wp-content/uploads/2010/08/image1.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.gljakal.com/blog/wp-content/uploads/2010/08/image_thumb1.png" width="400" height="240" /></a></p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fwww.gljakal.com%2Fblog%2F2010%2F08%2F16%2Fscreenshot-update%2F';
  addthis_title  = 'Screenshot+update';
  addthis_pub    = 'gljakal';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://www.gljakal.com/blog/2010/08/16/screenshot-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Parallax effect</title>
		<link>http://www.gljakal.com/blog/2010/03/21/parallax-effect/</link>
		<comments>http://www.gljakal.com/blog/2010/03/21/parallax-effect/#comments</comments>
		<pubDate>Sun, 21 Mar 2010 14:49:54 +0000</pubDate>
		<dc:creator>glJakaL</dc:creator>
				<category><![CDATA[game]]></category>

		<guid isPermaLink="false">http://www.gljakal.com/blog/2010/03/21/parallax-effect/</guid>
		<description><![CDATA[Progress! Here is a video showing parallax scrolling in the game:





  addthis_url    = 'http%3A%2F%2Fwww.gljakal.com%2Fblog%2F2010%2F03%2F21%2Fparallax-effect%2F';
  addthis_title  = 'Parallax+effect';
  addthis_pub    = 'gljakal';

]]></description>
			<content:encoded><![CDATA[<p>Progress! Here is a video showing parallax scrolling in the game:</p>
</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:02528f5e-4f1f-45ee-adb1-f5fd089f80a2" class="wlWriterEditableSmartContent">
<div><object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/KZF8n0opmW8&amp;hl=en"></param><embed src="http://www.youtube.com/v/KZF8n0opmW8&amp;hl=en" type="application/x-shockwave-flash" width="425" height="355"></embed></object></div>
</div>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fwww.gljakal.com%2Fblog%2F2010%2F03%2F21%2Fparallax-effect%2F';
  addthis_title  = 'Parallax+effect';
  addthis_pub    = 'gljakal';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://www.gljakal.com/blog/2010/03/21/parallax-effect/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Game progress recap</title>
		<link>http://www.gljakal.com/blog/2010/01/02/game-progress-recap/</link>
		<comments>http://www.gljakal.com/blog/2010/01/02/game-progress-recap/#comments</comments>
		<pubDate>Sat, 02 Jan 2010 22:46:29 +0000</pubDate>
		<dc:creator>glJakaL</dc:creator>
				<category><![CDATA[game]]></category>
		<category><![CDATA[screenshots]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://www.gljakal.com/blog/2010/01/02/game-progress-recap/</guid>
		<description><![CDATA[I’ve been blog-lazy about the game, so here is a small recap of what’s been going on on my screen lately:
Milestone #0 was getting something on the screen:
 
Milestone #1: level loading, animated coins and traps, movable objects 
 
Milestone #2: rotating platforms, engines and vehicles:
&#160; 
Milestone #3 is buttons and triggers. Since a single [...]]]></description>
			<content:encoded><![CDATA[<p>I’ve been blog-lazy about the game, so here is a small recap of what’s been going on on my screen lately:</p>
<p><strong>Milestone #0</strong> was getting something on the screen:</p>
<p><img src="http://www.gljakal.com/blog/wp-content/uploads/2009/08/pastedpic-01212009-132627.png" /> </p>
<p><strong>Milestone #1:</strong> level loading, animated coins and traps, movable objects </p>
<p><a href="http://www.gljakal.com/blog/wp-content/uploads/2010/01/wip_20090703.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="wip_20090703" border="0" alt="wip_20090703" src="http://www.gljakal.com/blog/wp-content/uploads/2010/01/wip_20090703_thumb.png" width="370" height="288" /></a> <a href="http://www.gljakal.com/blog/wp-content/uploads/2010/01/wip_20090714_2.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="The strange platforms on the left actually let you jump higher!" border="0" alt="The strange platforms on the left actually let you jump higher!" src="http://www.gljakal.com/blog/wp-content/uploads/2010/01/wip_20090714_2_thumb.png" width="370" height="250" /></a></p>
<p><strong>Milestone #2:</strong> rotating platforms, engines and vehicles:</p>
<p><a href="http://www.gljakal.com/blog/wp-content/uploads/2010/01/wip_20090805.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="wip_20090805" border="0" alt="wip_20090805" src="http://www.gljakal.com/blog/wp-content/uploads/2010/01/wip_20090805_thumb.png" width="370" height="288" /></a>&#160;<a href="http://www.gljakal.com/blog/wp-content/uploads/2010/01/wip_20100102.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="wip_20100102" border="0" alt="wip_20100102" src="http://www.gljakal.com/blog/wp-content/uploads/2010/01/wip_20100102_thumb.png" width="370" height="278" /></a> </p>
<p><strong>Milestone #3</strong> is buttons and triggers. Since a single picture wouldn’t explain how they work well enough, what about a short video? I also added a small vehicles demonstration at the end because, well, they are just cool <img src='http://www.gljakal.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:250984dc-fd10-4e3d-802a-cb7aa32e65f3" class="wlWriterEditableSmartContent">
<div><object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/pXmdbjcQ-z8&amp;hl=en"></param><embed src="http://www.youtube.com/v/pXmdbjcQ-z8&amp;hl=en" type="application/x-shockwave-flash" width="425" height="355"></embed></object></div>
</div>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fwww.gljakal.com%2Fblog%2F2010%2F01%2F02%2Fgame-progress-recap%2F';
  addthis_title  = 'Game+progress+recap';
  addthis_pub    = 'gljakal';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://www.gljakal.com/blog/2010/01/02/game-progress-recap/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Resolving CSS imports with CssCombine</title>
		<link>http://www.gljakal.com/blog/2010/01/01/resolving-css-imports-with-csscombine/</link>
		<comments>http://www.gljakal.com/blog/2010/01/01/resolving-css-imports-with-csscombine/#comments</comments>
		<pubDate>Fri, 01 Jan 2010 21:30:59 +0000</pubDate>
		<dc:creator>glJakaL</dc:creator>
				<category><![CDATA[Tips and tricks]]></category>
		<category><![CDATA[web design]]></category>
		<category><![CDATA[combine]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[import]]></category>
		<category><![CDATA[minify]]></category>

		<guid isPermaLink="false">http://www.gljakal.com/blog/2010/01/01/resolving-css-imports-with-csscombine/</guid>
		<description><![CDATA[When designing websites, I usually write multiple stylesheets for multiple parts of the website. For example, for gljakal.com I had 5 different stylesheets: 

header.css for the header/logo area, 
content.css for the content area, 
sidebar.css for the sidebar, 
footer.css for the footer 
and finally theme.css, that includes the style for all the above:


@import url(&#34;header.css&#34;);
@import url(&#34;sidebars.css&#34;);
@import url(&#34;content.css&#34;);
@import [...]]]></description>
			<content:encoded><![CDATA[<p>When designing websites, I usually write multiple stylesheets for multiple parts of the website. For example, for gljakal.com I had 5 different stylesheets: </p>
<ol>
<li>header.css for the header/logo area, </li>
<li>content.css for the content area, </li>
<li>sidebar.css for the sidebar, </li>
<li>footer.css for the footer </li>
<li>and finally theme.css, that includes the style for all the above:
<pre class="csharpcode">

@import url(<span class="str">&quot;header.css&quot;</span>);
@import url(<span class="str">&quot;sidebars.css&quot;</span>);
@import url(<span class="str">&quot;content.css&quot;</span>);
@import url(<span class="str">&quot;footer.css&quot;</span>);
</pre>
</li>
</ol>
<p>On more complex projects, I usually have even more stylesheets. One thing I am usually constant about however is having a generic theme.css or style.css that includes the other files. This is convenient because in my HTML pages I just have to link only one stylesheet file.</p>
<p>This technique works really well when testing the website on my local machine, however in production it has the downside of generating multiple requests on the client.</p>
<p>To address this problem, I wrote a small command-line program that would follow <code>@import</code> instructions and merge the imported files in the main one. It’s called <a href="http://www.gljakal.com/others/CssCombine.zip">CssCombine</a>.</p>
<p>The code (in c#) is merely 48 lines long:</p>
<pre class="csharpcode">

<span class="kwrd">using</span> System;
<span class="kwrd">using</span> System.Collections.Generic;
<span class="kwrd">using</span> System.Text;
<span class="kwrd">using</span> System.Text.RegularExpressions;

<span class="kwrd">namespace</span> CssCombine
{
    <span class="kwrd">class</span> Program
    {
        <span class="kwrd">static</span> <span class="kwrd">void</span> Combine(<span class="kwrd">string</span> parFileName, StringBuilder parOutput)
        {
            <span class="kwrd">string</span>[] lines = System.IO.File.ReadAllLines(parFileName);
            <span class="kwrd">foreach</span> (<span class="kwrd">string</span> s <span class="kwrd">in</span> lines)
            {
                <span class="kwrd">if</span> (s.Trim() != <span class="str">&quot;&quot;</span>)
                {
                    Regex rgx = <span class="kwrd">new</span> Regex(<span class="str">@&quot;@import\s+url\s*\((.*)\);&quot;</span>, RegexOptions.IgnoreCase | RegexOptions.CultureInvariant);
                    <span class="kwrd">string</span>[] sx = rgx.Split(s);
                    <span class="kwrd">if</span> (sx.Length &gt; 1)
                    {
                        <span class="kwrd">string</span> sFile = sx[1].Replace(<span class="str">&quot;\&quot;&quot;</span>, <span class="str">&quot;&quot;</span>).Replace(<span class="str">&quot;'&quot;</span>, <span class="str">&quot;&quot;</span>);
                        sFile = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(parFileName), sFile);
                        Combine(sFile, parOutput);
                    }
                    <span class="kwrd">else</span>
                    {
                        parOutput.AppendLine(s.Trim());
                    }
                }
            }
        }

        <span class="kwrd">static</span> <span class="kwrd">void</span> Main(<span class="kwrd">string</span>[] args)
        {
            <span class="kwrd">if</span> (args.Length != 2)
            {
                Console.WriteLine(<span class="str">&quot;Usage: CssCombine [input.css] [output.css]&quot;</span>);
            }
            <span class="kwrd">else</span>
            {
                <span class="kwrd">string</span> input = args[0];
                <span class="kwrd">string</span> output = args[1];
                StringBuilder sbOutput = <span class="kwrd">new</span> StringBuilder();
                Combine(input, sbOutput);
                System.IO.File.WriteAllText(output, sbOutput.ToString());
            }
        }
    }
}
</pre>
<p>Or you can <a href="http://www.gljakal.com/others/CssCombine.zip">download the compiled program here</a>.</p>
<p>Another optimization would be to minify the resulting file. I use Yahoo’s <a href="http://yuilibrary.com/projects/yuicompressor/wiki">YUI Compressor</a> for that.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fwww.gljakal.com%2Fblog%2F2010%2F01%2F01%2Fresolving-css-imports-with-csscombine%2F';
  addthis_title  = 'Resolving+CSS+imports+with+CssCombine';
  addthis_pub    = 'gljakal';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://www.gljakal.com/blog/2010/01/01/resolving-css-imports-with-csscombine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New software: gljakal&#8217;s WAYD</title>
		<link>http://www.gljakal.com/blog/2009/11/29/new-software-gljakals-wayd/</link>
		<comments>http://www.gljakal.com/blog/2009/11/29/new-software-gljakals-wayd/#comments</comments>
		<pubDate>Sun, 29 Nov 2009 11:24:50 +0000</pubDate>
		<dc:creator>glJakaL</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[gljakal software]]></category>
		<category><![CDATA[time tracking]]></category>
		<category><![CDATA[WAYD]]></category>

		<guid isPermaLink="false">http://www.gljakal.com/blog/?p=76</guid>
		<description><![CDATA[gljakal’s WAYD is the new software that helps you keep track of the time you spend in front of your computer. It does so in two ways:

The first is by keeping track of what programs you use
The second is by downright asking you! Every set amount of time, a full-screen window will pop up asking: “What are you doing?” You can then type in your answer or choose one of the latest answers you gave it.
]]></description>
			<content:encoded><![CDATA[<h5>“<em>What are you doing?</em>”</h5>
<p><a href="http://www.gljakal.com/wayd">gljakal’s WAYD</a> is the new software that helps you keep track of the time you spend in front of your computer. It does so in two ways: </p>
<ol>
<li>the first is by keeping track of <strong>what programs you use</strong> </li>
<li>The second is by downright <strong>asking you</strong>! Every set amount of time, a full-screen window will pop up asking: “What are you doing?” You can then type in your answer or choose one of the latest answers you gave it. </li>
</ol>
<p><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="WAYD screenshot" border="0" alt="WAYD screenshot" src="http://www.gljakal.com/blog/wp-content/uploads/2009/11/wayd_02.png" width="400" height="300" /></p>
<p>When you are ready to review your workdays, <a title="What Are You Doing?" href="http://www.gljakal.com/wayd">WAYD</a>’s log viewer can show you your answers or the programs you were using in the specified time period. The log can also be exported to CSV files that you can open with Microsoft Excel® or OpenOffice Calc.</p>
<p>I think that <a href="http://www.gljakal.com/wayd">WAYD</a> can be really useful to <strong>professionals </strong>and <strong>freelancers </strong>that need to keep an eye on their time. For example, it can be especially useful when you need to determine how much time you worked for a customer last month or last week.    <br />It also requires <strong>no discipline</strong> or effort on your part: instead of compiling a <em>daily review</em> of your work and storing it in some excel file somewhere in your documents folder, you are forced to report what you are working on every set amount of time (by default it’s every 30 minutes).</p>
<p>So, what are you waiting for? <a href="http://www.gljakal.com/wayd">Head over to the download page</a> to start tracking your time!</p>
<h5><em>On the technical side…</em></h5>
<p>Instead of the usual combination of c#/.net framework, I used C++ and the <a href="http://qt.nokia.com/">Qt Framework</a> to develop WAYD. I also used <a href="http://qt.nokia.com/products/developer-tools">Qt Creator</a> as a development environment.</p>
<p>I chose Qt because it has two very important features: first, it’s a multiplatform toolkit, meaning that I could easily port WAYD to MAC and Linux. Second, I can package the Qt library files directly with my application, so users don’t have to install them separately. This wasn’t the case with Clock (that required the VB6 library files) or ToDo (that required users to download and install the .net framework v1.1). One added benefit is that writing WAYD in C++ instead of C# lowered its memory footprint consistently.</p>
<p>I have to say that working with Qt and Qt Creator was a very pleasant experience.    <br />The Qt framework has classes for almost everything, from window management (obviously) to database to date/time formatting.    <br />Qt Creator is a well-thought and easy to use IDE. I’m used to Visual Studio and I had no difficulty at all with it.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fwww.gljakal.com%2Fblog%2F2009%2F11%2F29%2Fnew-software-gljakals-wayd%2F';
  addthis_title  = 'New+software%3A+gljakal%26rsquo%3Bs+WAYD';
  addthis_pub    = 'gljakal';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://www.gljakal.com/blog/2009/11/29/new-software-gljakals-wayd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tales of a level editor</title>
		<link>http://www.gljakal.com/blog/2009/11/14/tales-of-a-level-editor/</link>
		<comments>http://www.gljakal.com/blog/2009/11/14/tales-of-a-level-editor/#comments</comments>
		<pubDate>Sat, 14 Nov 2009 17:27:55 +0000</pubDate>
		<dc:creator>glJakaL</dc:creator>
				<category><![CDATA[game]]></category>

		<guid isPermaLink="false">http://www.gljakal.com/blog/2009/11/14/tales-of-a-level-editor/</guid>
		<description><![CDATA[While having lua scripts as level files is very flexible and “hackable”, it’s really difficult to “see” the level just by looking at a series of instructions. 
At first, I used Inkscape, the open source vector drawing program, to create my levels.     It seemed like a perfectly good idea: Just like [...]]]></description>
			<content:encoded><![CDATA[<p>While having lua scripts as level files is very flexible and “hackable”, it’s really difficult to “see” the level just by looking at a series of instructions. </p>
<p>At first, I used <a href="http://www.inkscape.org/">Inkscape</a>, the open source vector drawing program, to create my levels.     <br />It seemed like a perfectly good idea: Just like my game engine, Inkscape uses shapes to define the drawing. Also, since SVG files are basically XML files, any XML loader can be used to read the content of the drawing and extrapolate a game level script. </p>
<p>The real benefit was, however, that I didn’t need to write a level editor, but just a simple program that converts .svg files in lua scripts. I estimated that writing a converter instead of a level editor would save me a lot of time.</p>
<p>I estimated wrong <img src='http://www.gljakal.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>The problems I had with this approach were many, but here are the best ones:</p>
<ol>
<li>I found it really difficult to come up with a series of consistent rules for setting shape properties. I started putting different object types in different layers, so the unmovable shapes would be in a layer named “unmovable”, the movable ones would be in the “movable” layer, the powerups in another one, the traps in yet another layer. </li>
<li>It’s almost impossible to align everything correctly in Inkscape </li>
<li>Inkscape doesn’t save the shape rotation in the SVG file, but only the transformation matrix. </li>
</ol>
<p>In the end, frustrated by my poor choice, I decided to finally <strong>write a level editor</strong>.     <br />It took me just a couple of evenings to create a decent c# application that does exactly what I want:</p>
<p><a href="http://www.gljakal.com/blog/wp-content/uploads/2009/11/editor_20090703.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Level editor screenshot" border="0" alt="Level editor screenshot" src="http://www.gljakal.com/blog/wp-content/uploads/2009/11/editor_20090703_thumb.png" width="386" height="288" /></a> </p>
<p>One of the best features is the ability to import the bitmap files I create as mockups and transform them in levels:</p>
<p><a href="http://www.gljakal.com/blog/wp-content/uploads/2009/11/lv_data1_5x.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="level data mockup" border="0" alt="level data mockup" src="http://www.gljakal.com/blog/wp-content/uploads/2009/11/lv_data1_5x_thumb.png" width="113" height="45" /></a></p>
</p>
<p>(click the picture for a 5x enlarged version) </p>
<p>I have to say that c#/.net 3.5 is a wonderful combination for creating applications quickly!</p>
<p><strong>Lesson learned:</strong> Sometimes it is better to create (and eat) <a href="http://en.wikipedia.org/wiki/Eating_one's_own_dog_food">your own dogfood</a> <img src='http://www.gljakal.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fwww.gljakal.com%2Fblog%2F2009%2F11%2F14%2Ftales-of-a-level-editor%2F';
  addthis_title  = 'Tales+of+a+level+editor';
  addthis_pub    = 'gljakal';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://www.gljakal.com/blog/2009/11/14/tales-of-a-level-editor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Font rendering and the joys of C++</title>
		<link>http://www.gljakal.com/blog/2009/10/21/font-rendering-and-the-joys-of-c/</link>
		<comments>http://www.gljakal.com/blog/2009/10/21/font-rendering-and-the-joys-of-c/#comments</comments>
		<pubDate>Wed, 21 Oct 2009 17:30:01 +0000</pubDate>
		<dc:creator>glJakaL</dc:creator>
				<category><![CDATA[game]]></category>

		<guid isPermaLink="false">http://www.gljakal.com/blog/2009/10/21/font-rendering-and-the-joys-of-c/</guid>
		<description><![CDATA[At the moment, all the menu text in the game is stored in separated images – one for every menu item. For example, this is the “New Game” button:

Of course, storing each menu item as a separate picture is not very efficient, so I decided to add text rendering capability to the game.
My first choice [...]]]></description>
			<content:encoded><![CDATA[<p>At the moment, all the menu text in the game is stored in separated images – one for every menu item. For example, this is the “New Game” button:</p>
<p><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="menu-newgame" border="0" alt="menu-newgame" src="http://www.gljakal.com/blog/wp-content/uploads/2009/10/menunewgame.png" width="256" height="64" /></p>
<p>Of course, storing each menu item as a separate picture is not very efficient, so I decided to add text rendering capability to the game.</p>
<p>My first choice was the <a href="http://oglft.sourceforge.net/">OGLFT</a> library. It’s a really easy to use and complete OpenGL text rendering library based on <a href="http://www.freetype.org/">FreeType</a>. I quickly added it to the project, and it worked perfectly, until I closed the application and got a nice “Access violation” exception <img src='http://www.gljakal.com/blog/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  </p>
<p>After hours of tinkering, I finally found out that the error was related to the FreeType library. For some mysterious reason, just trying to open a font file with FreeType caused the erroneous behavior.</p>
<p>So, since I couldn’t use FreeType, I decided to create a text rendering class myself, based on the font texture approach.</p>
<p>In order to create suitable font maps, I modified <a href="http://www.gljakal.com/irrfontmaker/index.php">Irrlicht Font Maker</a> to create non-irrlicht-specific font maps. I also added a couple of options and the ability to export the control points as custom text&#160; or in a handy binary format:</p>
<p><a href="http://www.gljakal.com/blog/wp-content/uploads/2009/10/ifm_sshot_0.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="New Options in Irrlicht Font Maker" border="0" alt="New Options in Irrlicht Font Maker" src="http://www.gljakal.com/blog/wp-content/uploads/2009/10/ifm_sshot_0_thumb.png" width="226" height="159" /></a> <a href="http://www.gljakal.com/blog/wp-content/uploads/2009/10/ifm_sshot_1.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Text export" border="0" alt="Text export" src="http://www.gljakal.com/blog/wp-content/uploads/2009/10/ifm_sshot_1_thumb.png" width="200" height="159" /></a></p>
<p>But that’s only the first part of the story: once ready, I took my new text rendering class for a test drive and, with much surprise, I discovered that the program triggered the same exception it did before! <strong>OH MY!</strong></p>
<p>After an hour or so of debugging, I finally found out the root cause of the problem: a single call to <code>fopen</code> to read the font control points was enough to send the program to C++ hell.</p>
<p>I have since replaced all the standard C file IO functions (<code>fopen</code>, <code>fread</code>, …) with the modern C++ equivalent (<code>fstream</code>) and now the program ends with no errors.</p>
<p>In the end, I’m happy with the new font rendering method, as it gave me a chance to clean up and improve Irrlicht Font Maker, however once again I feel like I misplaced my foot in the minefield that is programming in C++ <img src='http://www.gljakal.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fwww.gljakal.com%2Fblog%2F2009%2F10%2F21%2Ffont-rendering-and-the-joys-of-c%2F';
  addthis_title  = 'Font+rendering+and+the+joys+of+C%2B%2B';
  addthis_pub    = 'gljakal';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://www.gljakal.com/blog/2009/10/21/font-rendering-and-the-joys-of-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting rid of the Naming container in ASP.Net 2.0 &#8211; update</title>
		<link>http://www.gljakal.com/blog/2009/10/06/getting-rid-of-the-naming-container-in-asp-net-2-0-update/</link>
		<comments>http://www.gljakal.com/blog/2009/10/06/getting-rid-of-the-naming-container-in-asp-net-2-0-update/#comments</comments>
		<pubDate>Tue, 06 Oct 2009 17:33:44 +0000</pubDate>
		<dc:creator>glJakaL</dc:creator>
				<category><![CDATA[Tips and tricks]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://www.gljakal.com/blog/?p=59</guid>
		<description><![CDATA[In my previous article, Getting rid of the Naming Container in asp.net 2.0, I explained a method to override the extended naming functionality provided by ASP.net in order to create client-side controls with better IDs.
I was however informed in the comments that by overriding the NamingContainer property the control loses the ability to read its [...]]]></description>
			<content:encoded><![CDATA[<p>In my previous article, <a href="http://www.gljakal.com/blog/2007/09/12/getting-rid-of-the-naming-container-in-aspnet-20/">Getting rid of the Naming Container in asp.net 2.0</a>, I explained a method to override the extended naming functionality provided by ASP.net in order to create client-side controls with better IDs.</p>
<p>I was however informed in the comments that by overriding the NamingContainer property the control loses the ability to read its value from the PostBack data.</p>
<p>Since the controls I developed were not meant to to be used in a postback scenario, this wasn’t a big problem for me.</p>
<p>Fast-forward a couple of years and here I am, wondering why post back does not work in one of my projects <img src='http://www.gljakal.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Anyway, I looked at the link provided by Alex, where <a href="http://www.west-wind.com/WebLog/ShowPost.aspx?id=4605">Rick Strahl talks about overriding the <code>ClientId</code> and the <code>UniqueId</code> properties</a> instead of <code>NamingContainer</code>.</p>
<p>In a standard web control, the two properties <code>ClientID</code> and <code>UniqueID</code> are mapped, respectively, to the <code>id</code> and <code>name</code> properties of the HTML control generated. </p>
<p>Since most (all? ) JS frameworks use the <code>id</code> property to access the varius HTML elements and the PostBack mechanism uses the <code>name</code> property, I think the “best of both worlds” solution is to only override the ClientId:</p>
</p>
<pre class="csharpcode">

<span class="kwrd">public</span> <span class="kwrd">class</span> NiceTextBox : System.Web.UI.WebControls.TextBox
{
    <span class="kwrd">public</span> <span class="kwrd">bool</span> UseNamingContainer { get; set; }


    <span class="kwrd">public</span> <span class="kwrd">override</span> <span class="kwrd">string</span> ClientID
    {
        get
        {
            <span class="kwrd">if</span> (<span class="kwrd">this</span>.UseNamingContainer)
                <span class="kwrd">return</span> <span class="kwrd">base</span>.ClientID;
            <span class="kwrd">else</span>
                <span class="kwrd">return</span> <span class="kwrd">this</span>.ID;
        }
    }
}

</pre>
<style type="text/css">
<p>.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p>Now our NiceTextBox works even during post-back scenarios <img src='http://www.gljakal.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  </p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fwww.gljakal.com%2Fblog%2F2009%2F10%2F06%2Fgetting-rid-of-the-naming-container-in-asp-net-2-0-update%2F';
  addthis_title  = 'Getting+rid+of+the+Naming+container+in+ASP.Net+2.0+%26%238211%3B+update';
  addthis_pub    = 'gljakal';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://www.gljakal.com/blog/2009/10/06/getting-rid-of-the-naming-container-in-asp-net-2-0-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The game: baby steps</title>
		<link>http://www.gljakal.com/blog/2009/08/27/the-game-baby-steps/</link>
		<comments>http://www.gljakal.com/blog/2009/08/27/the-game-baby-steps/#comments</comments>
		<pubDate>Thu, 27 Aug 2009 11:16:41 +0000</pubDate>
		<dc:creator>glJakaL</dc:creator>
				<category><![CDATA[game]]></category>

		<guid isPermaLink="false">http://www.gljakal.com/blog/2009/08/27/the-game-baby-steps/</guid>
		<description><![CDATA[
Here is an early screenshot from the game I’m working on. Obviously all the programmer art you see is temporary and will be replaced by something better  

  addthis_url    = 'http%3A%2F%2Fwww.gljakal.com%2Fblog%2F2009%2F08%2F27%2Fthe-game-baby-steps%2F';
  addthis_title  = 'The+game%3A+baby+steps';
  addthis_pub    = 'gljakal';

]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.gljakal.com/blog/wp-content/uploads/2009/08/pastedpic-01212009-132627.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="pastedpic_01212009_132627" border="0" alt="pastedpic_01212009_132627" src="http://www.gljakal.com/blog/wp-content/uploads/2009/08/pastedpic-01212009-132627-thumb.png" width="370" height="288" /></a></p>
<p>Here is an early screenshot from the game I’m working on. Obviously all the <em>programmer art</em> you see is temporary and will be replaced by something better <img src='http://www.gljakal.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fwww.gljakal.com%2Fblog%2F2009%2F08%2F27%2Fthe-game-baby-steps%2F';
  addthis_title  = 'The+game%3A+baby+steps';
  addthis_pub    = 'gljakal';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://www.gljakal.com/blog/2009/08/27/the-game-baby-steps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Still alive + Working on a game&#8230;</title>
		<link>http://www.gljakal.com/blog/2009/07/28/still-alive-working-on-a-game/</link>
		<comments>http://www.gljakal.com/blog/2009/07/28/still-alive-working-on-a-game/#comments</comments>
		<pubDate>Tue, 28 Jul 2009 15:58:52 +0000</pubDate>
		<dc:creator>glJakaL</dc:creator>
				<category><![CDATA[game]]></category>
		<category><![CDATA[gljakal software]]></category>

		<guid isPermaLink="false">http://www.gljakal.com/blog/2009/07/28/still-alive-working-on-a-game/</guid>
		<description><![CDATA[…and I’m going to document the whole process on this blog  
It will be a 2D mario-style platformer, whith a twist: the game is set on a physically realistic world. More details to come soon!
I also have a very cool productivity (“serious”) application to release. Testing is complete, I just need to get the [...]]]></description>
			<content:encoded><![CDATA[<p>…and I’m going to document the whole process on this blog <img src='http://www.gljakal.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>It will be a 2D mario-style platformer, whith a twist: the game is set on a physically realistic world. More details to come soon!</p>
<p>I also have a very cool productivity (“serious”) application to release. Testing is complete, I just need to get the boring part done (creating setups, writing web pages…).</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fwww.gljakal.com%2Fblog%2F2009%2F07%2F28%2Fstill-alive-working-on-a-game%2F';
  addthis_title  = 'Still+alive+%2B+Working+on+a+game%26hellip%3B';
  addthis_pub    = 'gljakal';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://www.gljakal.com/blog/2009/07/28/still-alive-working-on-a-game/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
