<?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>michi&#039;s log</title>
	<atom:link href="http://michi.ist.inspirationslos.de/feed/" rel="self" type="application/rss+xml" />
	<link>http://michi.ist.inspirationslos.de</link>
	<description></description>
	<lastBuildDate>Wed, 07 Dec 2011 17:22:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Fixing the Lunar Lander example: a threaded gameloop for Android</title>
		<link>http://michi.ist.inspirationslos.de/2011/12/05/fixing-the-lunar-lander-example-a-threaded-gameloop-for-android/</link>
		<comments>http://michi.ist.inspirationslos.de/2011/12/05/fixing-the-lunar-lander-example-a-threaded-gameloop-for-android/#comments</comments>
		<pubDate>Mon, 05 Dec 2011 21:38:59 +0000</pubDate>
		<dc:creator>michi</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Gameloop]]></category>
		<category><![CDATA[threading]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://michi.ist.inspirationslos.de/?p=222</guid>
		<description><![CDATA[Recently I am very interested in creating a small game for Android. Since every game needs a proper working gameloop and a underlying drawing mechanism I started to look at some examples from the internet. My first attempt in searching a good example lead me to the Android Developers page. There is a good description [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I am very interested in creating a small game for Android. Since every game needs a proper working gameloop and a underlying drawing mechanism I started to look at some examples from the internet. My first attempt in searching a good example lead me to the <a href="http://http://developer.android.com/guide/topics/graphics/2d-graphics.html" title="Android Developers" target="_blank">Android Developers page</a>. There is a good description on how to get started with 2D graphics. I decided to take the threaded aproach as described there. This means that there is a thread that draws everything into the view as fast as possible while not blocking the UI thread. </p>
<p>Some further poking on the Android Developers page lead me to the <a href="http://http://developer.android.com/resources/samples/LunarLander/index.html" title="Lunar Lander" target="_blank">Lunar Lander</a> example which looked right what I wanted to do. I installed it on my HTC and played around with it a bit when I suddenly received this error message:<br />
<img src="http://michi.ist.inspirationslos.de/files/2011/12/lunar-lander-crash-300x252.png" alt="" title="lunar lander crash" width="300" height="252" class="aligncenter size-medium wp-image-226" /></p>
<p>What happened? To put it simple, there is a bug in Google&#8217;s Lunar Lander example. Let&#8217;s look at the implemenation of the thread that draws the game in LunarView.java and how it&#8217;s started:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> surfaceCreated<span style="color: #009900;">&#40;</span>SurfaceHolder holder<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	thread.<span style="color: #006633;">setRunning</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	thread.<span style="color: #006633;">start</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>The method <code>surfaceCreated()</code> is a callback method from the <code>SurfaceHolder</code> class. It is called whenever the Surface we want to draw on is created, for example when the application starts or when we return from a pause. Respectivly the method <code>surfaceDestroyed()</code> is called whenever the surface is destroyed, for example when the application terminates or another application gets the focus.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> surfaceDestroyed<span style="color: #009900;">&#40;</span>SurfaceHolder holder<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000066; font-weight: bold;">boolean</span> retry <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">true</span><span style="color: #339933;">;</span>
	thread.<span style="color: #006633;">setRunning</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">while</span> <span style="color: #009900;">&#40;</span>retry<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
			thread.<span style="color: #006633;">join</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			retry <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">false</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">InterruptedException</span> e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>In the Lunar Lander implemention the drawing thread is terminated on the first time the surface is destroyed. If we then try to come back to the application, for example with a long click on the home button, the application throws this exception:</p>
<p><code>java.lang.IllegalThreadStateException: Thread already started.</code> </p>
<p>We reached an illegal state because a thread is only allowed to be started a single time! </p>
<p>To fix this issue I don&#8217;t stop the drawing thread in my application if the app looses focus. Instead I just stop drawing and let the thread sleep for a while (and thus save the CPU resources etc). When the app gets focus again, the drawing starts over. In the example below this behaviour is controlled by the <code>paused</code> variable, <code>running</code> is the variable that is set to true when the game starts and is set to false when the app is terminated and the thread really needs to stop:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
</pre></td><td class="code"><pre class="java" style="font-family:monospace;">@Override
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> run<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">while</span> <span style="color: #009900;">&#40;</span>running<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">while</span> <span style="color: #009900;">&#40;</span>paused<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #003399;">Thread</span>.<span style="color: #006633;">sleep</span><span style="color: #009900;">&#40;</span>50L<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">InterruptedException</span> ignore<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #003399;">Canvas</span> canvas <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
			canvas <span style="color: #339933;">=</span> holder.<span style="color: #006633;">lockCanvas</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			draw<span style="color: #009900;">&#40;</span>canvas<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">finally</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>canvas <span style="color: #339933;">!=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				holder.<span style="color: #006633;">unlockCanvasAndPost</span><span style="color: #009900;">&#40;</span>canvas<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>I&#8217;ve implemented this gameloop in a small example that displays Conway&#8217;s Game of Life:<br />
<img src="http://michi.ist.inspirationslos.de/files/2011/12/gameoflife01-200x300.png" alt="" title="gameoflife01" width="200" height="300" class="aligncenter size-medium wp-image-236" /></p>
<p>Of course my implementation has a fixed timestep as suggested by the famous article <a href="http://http://gafferongames.com/game-physics/fix-your-timestep/" title="Fix Your Timestep!">Fix Your Timestep!</a></p>
<p>Download my example sourcecode here: <a href='http://michi.ist.inspirationslos.de/files/2011/12/android-gameloop-example-v1.zip'><strong>android-gameloop-example-v1.zip</strong></a><br />
App in the Android Market: <a href="https://market.android.com/details?id=de.qx.gameoflife" title="Gameloop Example in the Android Market"><strong>Gameloop Tutorial</strong></a></p>
]]></content:encoded>
			<wfw:commentRss>http://michi.ist.inspirationslos.de/2011/12/05/fixing-the-lunar-lander-example-a-threaded-gameloop-for-android/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Prevent timeouts with putty</title>
		<link>http://michi.ist.inspirationslos.de/2011/08/10/prevent-timeouts-with-putty/</link>
		<comments>http://michi.ist.inspirationslos.de/2011/08/10/prevent-timeouts-with-putty/#comments</comments>
		<pubDate>Wed, 10 Aug 2011 19:57:21 +0000</pubDate>
		<dc:creator>michi</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[putty]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[timeout]]></category>

		<guid isPermaLink="false">http://michi.ist.inspirationslos.de/?p=216</guid>
		<description><![CDATA[There is a really useful setting hidden in the shallows of putty&#8217;s configuration menu. It allows to set an interval after which a keepalive message is sent to the server to prevent random disconnects. That saved me a lot of reconnecting&#8230;]]></description>
			<content:encoded><![CDATA[<p>There is a really useful setting hidden in the shallows of putty&#8217;s configuration menu. It allows to set an interval after which a keepalive message is sent to the server to prevent random disconnects. That saved me a lot of reconnecting&#8230;<br />
<a href="http://michi.ist.inspirationslos.de/files/2011/08/putty-timeout.png"><img class="aligncenter size-medium wp-image-217" title="putty timeout" src="http://michi.ist.inspirationslos.de/files/2011/08/putty-timeout-300x287.png" alt="" width="300" height="287" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://michi.ist.inspirationslos.de/2011/08/10/prevent-timeouts-with-putty/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LWJGL and Logging</title>
		<link>http://michi.ist.inspirationslos.de/2011/03/20/lwjgl-and-logging/</link>
		<comments>http://michi.ist.inspirationslos.de/2011/03/20/lwjgl-and-logging/#comments</comments>
		<pubDate>Sun, 20 Mar 2011 20:54:52 +0000</pubDate>
		<dc:creator>michi</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://michi.ist.inspirationslos.de/?p=207</guid>
		<description><![CDATA[In my current project I make heavy use of logging. To be able to customize logging I am using log4j. Unfortunately LWJGL doesn&#8217;t use a log framework of any kind and just outputs on the console via System.out.println(). To add these outputs to the logfile or a log4j console appender one has to reroute the [...]]]></description>
			<content:encoded><![CDATA[<p>In my current project I make heavy use of logging. To be able to customize logging I am using <a href="http://logging.apache.org/log4j/">log4j</a>. Unfortunately LWJGL doesn&#8217;t use a log framework of any kind and just outputs on the console via <code>System.out.println()</code>. To add these outputs to the logfile or a log4j console appender one has to reroute the output through log4j. Luckily there is a pretty easy way, I found it in a <a href="http://stackoverflow.com/questions/1200175/log4j-redirect-stdout-to-dailyrollingfileappender">stackoverflow posting</a>. So how does it work? There is a Java API that allows to set a new <code>PrintStream</code> for <code>System.out</code> and <code>System.err</code>:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #003399;">System</span>.<span style="color: #006633;">setOut</span><span style="color: #009900;">&#40;</span><span style="color: #003399;">PrintStream</span> stream<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #003399;">System</span>.<span style="color: #006633;">setErr</span><span style="color: #009900;">&#40;</span><span style="color: #003399;">PrintStream</span> stream<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>So we simply have to add our own <code>PrintStream</code> implementation that calls the logger and we are done:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">PrintStream</span><span style="color: #009900;">&#40;</span>realPrintStream<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> print<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">final</span> <span style="color: #003399;">String</span> message<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        LOG.<span style="color: #006633;">info</span><span style="color: #009900;">&#40;</span>message<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p><code>LOG</code> would be our log4j <code>Logger</code>.</p>
]]></content:encoded>
			<wfw:commentRss>http://michi.ist.inspirationslos.de/2011/03/20/lwjgl-and-logging/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Humble Indie Bundle #2</title>
		<link>http://michi.ist.inspirationslos.de/2010/12/24/humble-indie-bundle-2/</link>
		<comments>http://michi.ist.inspirationslos.de/2010/12/24/humble-indie-bundle-2/#comments</comments>
		<pubDate>Fri, 24 Dec 2010 11:20:59 +0000</pubDate>
		<dc:creator>michi</dc:creator>
				<category><![CDATA[Games]]></category>
		<category><![CDATA[humble indie bundle]]></category>

		<guid isPermaLink="false">http://michi.ist.inspirationslos.de/?p=201</guid>
		<description><![CDATA[Hurry up! There is not much time left to buy the awesome Humble Indie Bundle #2. It&#8217;s a bundle of five awesome indie games: Braid, Cortex Command, Machinarium, Osmos and Revenge of the Titans. One very cool thing about this bundle is that you can pay as much as you like for it and even [...]]]></description>
			<content:encoded><![CDATA[<p>Hurry up! There is not much time left to buy the awesome <a href="http://www.humblebundle.com/">Humble Indie Bundle #2</a>. It&#8217;s a bundle of five awesome indie games: Braid, Cortex Command, Machinarium, Osmos and Revenge of the Titans. One very cool thing about this bundle is that you can pay as much as you like for it and even decide to donate a part of the money! Or just make a friend happy: It&#8217;s also possible to give it away as a gift. If you pay more than the average, which is around 7.68$ at the moment, you also get all the games from the first bundle. What an incredible deal!<br />
There is a teaser video:<br />
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="640" height="390" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="src" value="http://www.youtube.com/v/orzQ2J-oDpc&amp;rel=0&amp;hl=en_US&amp;feature=player_embedded&amp;version=3" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="640" height="390" src="http://www.youtube.com/v/orzQ2J-oDpc&amp;rel=0&amp;hl=en_US&amp;feature=player_embedded&amp;version=3" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://michi.ist.inspirationslos.de/2010/12/24/humble-indie-bundle-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding Javadoc Links in IntelliJ Idea with Live Templates</title>
		<link>http://michi.ist.inspirationslos.de/2010/01/26/adding-javadoc-links-in-intellij-idea-with-live-templates/</link>
		<comments>http://michi.ist.inspirationslos.de/2010/01/26/adding-javadoc-links-in-intellij-idea-with-live-templates/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 21:55:48 +0000</pubDate>
		<dc:creator>michi</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[helper]]></category>
		<category><![CDATA[intellij idea]]></category>
		<category><![CDATA[javadoc]]></category>
		<category><![CDATA[live template]]></category>

		<guid isPermaLink="false">http://michi.ist.inspirationslos.de/?p=187</guid>
		<description><![CDATA[In Eclipse there is this wonderful little helper for adding Javadoc links while you&#8217;re typing a class name. It looks like this: It suggests not just to put the classes name there but also use a @link tag so one can navigate the Javadoc sources later on. The finished comment: Unfortunately this functionality is not [...]]]></description>
			<content:encoded><![CDATA[<p>In Eclipse there is this wonderful little helper for adding Javadoc links while you&#8217;re typing a class name. It looks like this: </p>
<p><img src="http://michi.ist.inspirationslos.de/files/2010/01/eclipse-javadoc-links-1-300x76.png" alt="auto completion for Javadoc links in Eclipse" title="auto completion for Javadoc links in Eclipse" width="300" height="76" class="alignnone size-medium wp-image-182" /></p>
<p>It suggests not just to put the classes name there but also use a @link tag so one can navigate the Javadoc sources later on. The finished comment:</p>
<p><img src="http://michi.ist.inspirationslos.de/files/2010/01/eclipse-javadoc-links-2-300x76.png" alt="auto completion for Javadoc links in Eclipse" title="auto completion for Javadoc links in Eclipse" width="300" height="76" class="alignnone size-medium wp-image-183" /></p>
<p>Unfortunately this functionality is not available in JetBrains&#8217; IntelliJ Idea. There is (of course) auto completion for classnames in Idea but it simply doesn&#8217;t put them in a @link tag. A simple trick saves the day: simply create a <a href="http://www.jetbrains.com/idea/features/code_assistance.html">live template</a> with context &#8216;Java comment&#8217; like here:</p>
<p><a href="http://michi.ist.inspirationslos.de/files/2010/01/idea-javadoc-links-1.png"><img src="http://michi.ist.inspirationslos.de/files/2010/01/idea-javadoc-links-1-300x262.png" alt="creating a live template for the javadoc link" title="link live template" width="300" height="262" class="alignnone size-medium wp-image-184" /></a></p>
<p>EDIT: The screenshot is missing the word &#8216;link&#8217;. The complete template should be: &#8216;{@link $LINK$} &#8216;.</p>
<p>Don&#8217;t forget to click on &#8216;Edit variables&#8217; and fill in &#8216;complete()&#8217; as Expression. This activates the auto completion for classnames. </p>
<p>Now everytime a @link in the Javadocs is needed we invoke the Live Templates with Alt + J and enter a classname. The @link tag will be build around that name. It&#8217;s not as simple as with Eclipse, but works pretty well.</p>
<p><img src="http://michi.ist.inspirationslos.de/files/2010/01/idea-javadoc-links-2.png" alt="live template for the javadoc @link" title="live template for the javadoc @link" width="300" height="100" class="alignnone size-full wp-image-185" /></p>
<p><img src="http://michi.ist.inspirationslos.de/files/2010/01/idea-javadoc-links-3.png" alt="live template for the javadoc @link tag" title="live template for the javadoc @link tag" width="300" height="100" class="alignnone size-full wp-image-186" /></p>
]]></content:encoded>
			<wfw:commentRss>http://michi.ist.inspirationslos.de/2010/01/26/adding-javadoc-links-in-intellij-idea-with-live-templates/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>&#8220;Immediate mode rendering is dead&#8221;</title>
		<link>http://michi.ist.inspirationslos.de/2010/01/19/immediate-mode-rendering-is-dead/</link>
		<comments>http://michi.ist.inspirationslos.de/2010/01/19/immediate-mode-rendering-is-dead/#comments</comments>
		<pubDate>Tue, 19 Jan 2010 18:58:31 +0000</pubDate>
		<dc:creator>michi</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://michi.ist.inspirationslos.de/?p=179</guid>
		<description><![CDATA[&#8220;Immediate mode rendering is dead&#8221; is the title of a topic on the Javagaming Forums I&#8217;ve been following the last two days. It is a really insightfull discussion about the use of Vertex Buffer Objects versus Vertex Arrays and the Immediate Mode. One says the internet doesn&#8217;t forget and that is especially true for tutorials [...]]]></description>
			<content:encoded><![CDATA[<p>&#8220;Immediate mode rendering is dead&#8221; is the title of a <a href="http://www.javagaming.org/index.php/topic,21839.0.html">topic on the Javagaming Forums</a> I&#8217;ve been following the last two days. It is a really insightfull discussion about the use of Vertex Buffer Objects versus Vertex Arrays and the Immediate Mode.<br />
One says the internet doesn&#8217;t forget and that is especially true for tutorials concerning OpenGL which have been around for a very long time now. Most of them start by showing how to draw simple geometry using the Immediate Mode and most people posting in the mentioned topic agree that this is the wrong thing to start learning with, at least nowadays.<br />
The topic also includes some example code and benchmarking what methods and ways seem to be the fastest. The contributers just started comparing benchmarks and didn&#8217;t go very deep, but I really hope that there will be deeper insights revealed.<br />
The whole discussion actually started here: <a href="http://www.javagaming.org/index.php/topic,21823.0.html">Sprite!</a>, where princec (from <a href="http://www.puppygames.net/">Puppygames</a>) is writing about his sprite-engine. Also a very interesting read!</p>
]]></content:encoded>
			<wfw:commentRss>http://michi.ist.inspirationslos.de/2010/01/19/immediate-mode-rendering-is-dead/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>new time lapse video</title>
		<link>http://michi.ist.inspirationslos.de/2010/01/09/new-time-lapse-video/</link>
		<comments>http://michi.ist.inspirationslos.de/2010/01/09/new-time-lapse-video/#comments</comments>
		<pubDate>Sat, 09 Jan 2010 17:24:26 +0000</pubDate>
		<dc:creator>michi</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[time lapse]]></category>
		<category><![CDATA[ulm]]></category>
		<category><![CDATA[uni ulm]]></category>
		<category><![CDATA[uniklinikum]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://michi.ist.inspirationslos.de/?p=175</guid>
		<description><![CDATA[Almost two years ago I started saving the pictures of a webcam that shows the construction site of a new building at the university of Ulm. Meanwhile I got a collection of almost 50.000 pictures that take up 12 gb of my harddisk. I decided to make a new video. Like the last one this [...]]]></description>
			<content:encoded><![CDATA[<p>Almost two years ago I started saving the pictures of a webcam that shows the construction site of a new building at the university of Ulm. Meanwhile I got a collection of almost 50.000 pictures that take up 12 gb of my harddisk. I decided to make a new video. Like the last one this is only generated by a fraction of  that pictures, namely the ones taken at 10 and 12 o&#8217;clock in the morning each day. Have a look:</p>
<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/7_ls7LrnQt0&#038;hl=de_DE&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/7_ls7LrnQt0&#038;hl=de_DE&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://michi.ist.inspirationslos.de/2010/01/09/new-time-lapse-video/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Trouble with Vertex Buffer Objects solved</title>
		<link>http://michi.ist.inspirationslos.de/2009/10/25/trouble-with-vertex-buffer-objects-solved/</link>
		<comments>http://michi.ist.inspirationslos.de/2009/10/25/trouble-with-vertex-buffer-objects-solved/#comments</comments>
		<pubDate>Sun, 25 Oct 2009 17:29:59 +0000</pubDate>
		<dc:creator>michi</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[lwjgl]]></category>
		<category><![CDATA[sleepless nights debugging]]></category>

		<guid isPermaLink="false">http://michi.ist.inspirationslos.de/?p=162</guid>
		<description><![CDATA[It has been a while since I last used Vertex Buffer Objects (VBO) with LWJGL. It seemed as if they had changed some of the method signatures since I used them last time. I couldn&#8217;t even get the simplest example running. After experimenting for a while I finally figured it out. Have a look at [...]]]></description>
			<content:encoded><![CDATA[<p>It has been a while since I last used Vertex Buffer Objects (VBO) with <a href="http://www.lwjgl.org" target="_self">LWJGL</a>. It seemed as if they had changed some of the method signatures since I used them last time. I couldn&#8217;t even get the simplest example running. After experimenting for a while I finally figured it out. Have a look at the signature of the VertexPointer method:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> glVertexPointer<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> size, <span style="color: #000066; font-weight: bold;">int</span> type, <span style="color: #000066; font-weight: bold;">int</span> stride, <span style="color: #000066; font-weight: bold;">long</span> pointer_buffer_offset<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>With the last offset one can specify where the vertex information starts in the buffer given to the VBO management. Well, I could/should have guessed that this offset has to be in <strong>bytes</strong> since I am dealing with a buffer here but instead I used the number of <strong>floats</strong>.. So next time I see an operation dealing with buffers that takes a long argument I&#8217;ll try the byte-count from the beginning..</p>
]]></content:encoded>
			<wfw:commentRss>http://michi.ist.inspirationslos.de/2009/10/25/trouble-with-vertex-buffer-objects-solved/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ein Jahr Uniklinkikbau &#8211; Zeitraffer</title>
		<link>http://michi.ist.inspirationslos.de/2009/04/18/1-jahr-uniklinkikbau-zeitraffer/</link>
		<comments>http://michi.ist.inspirationslos.de/2009/04/18/1-jahr-uniklinkikbau-zeitraffer/#comments</comments>
		<pubDate>Sat, 18 Apr 2009 10:06:16 +0000</pubDate>
		<dc:creator>michi</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[time lapse]]></category>
		<category><![CDATA[uni ulm]]></category>
		<category><![CDATA[uniklinikum]]></category>

		<guid isPermaLink="false">http://michi.ist.inspirationslos.de/?p=125</guid>
		<description><![CDATA[Seit nunmehr einem Jahr speichere ich die Bilder, die eine Webcam über der Baustelle der neuen Uniklinik in Ulm macht. Das letzte Zeitraffervideo habe ich im Dezember 2008 erstellt und nun war es Zeit nochmal eines zu machen. Diesmal ist es etwas kürzer, da ich nur zwei Bilder pro Tag verwende. Für die volle Pracht [...]]]></description>
			<content:encoded><![CDATA[<p>Seit nunmehr einem Jahr speichere ich die Bilder, die eine Webcam über der Baustelle der neuen Uniklinik in Ulm macht. Das <a href="http://michi.ist.inspirationslos.de/2008/12/22/time-lapse-video/">letzte Zeitraffervideo</a> habe ich im Dezember 2008 erstellt und nun war es Zeit nochmal eines zu machen. Diesmal ist es etwas kürzer, da ich nur zwei Bilder pro Tag verwende. </p>
<p><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/VZbxU3tQ6eE&#038;hl=de&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/VZbxU3tQ6eE&#038;hl=de&#038;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></p>
<p>Für die volle Pracht auf den HD Button drücken!</p>
]]></content:encoded>
			<wfw:commentRss>http://michi.ist.inspirationslos.de/2009/04/18/1-jahr-uniklinkikbau-zeitraffer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Arduino/Meggy Jr Upload Fehler&#124;Arduino/Meggy Jr Upload Error</title>
		<link>http://michi.ist.inspirationslos.de/2009/04/07/arduinomeggy-jr-upload-fehler/</link>
		<comments>http://michi.ist.inspirationslos.de/2009/04/07/arduinomeggy-jr-upload-fehler/#comments</comments>
		<pubDate>Tue, 07 Apr 2009 19:32:41 +0000</pubDate>
		<dc:creator>michi</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[meggy]]></category>
		<category><![CDATA[meggy jr rgb]]></category>
		<category><![CDATA[sleepless nights debugging]]></category>

		<guid isPermaLink="false">http://michi.ist.inspirationslos.de/?p=120</guid>
		<description><![CDATA[If you are using Meggy Jr with the Serial-to-USB Cable provided in the Evil Mad Scientist shop you might encounter the following error: avrdude: stk500_getsync(): not in sync: resp=0&#215;00 avrdude: stk500_disable(): protocol error, expect=0&#215;14, resp=0&#215;51 The error manifest while uploading a new sketch to Meggy. If you pull out the USB cable and plug it [...]]]></description>
			<content:encoded><![CDATA[<p>If you are using Meggy Jr with the Serial-to-USB Cable provided in the Evil Mad Scientist shop you might encounter the following error:</p>
<blockquote><p><em>avrdude: stk500_getsync(): not in sync: resp=0&#215;00<br />
avrdude: stk500_disable(): protocol error, expect=0&#215;14, resp=0&#215;51</em></p></blockquote>
<p>The error manifest while uploading a new sketch to Meggy. If you pull out the USB cable and plug it in again you can upload a sketch successful. But on the next time you try you&#8217;ll get the error again. Luckily there is a pretty simple solution. I found it while digging through the Evil Mad Scientist Forums. It involves setting the &#8220;Set RTS on close&#8221; flag of the COM Port. You can do this in the Device Manager. Find the COM Port that was installed when you first plugged in the USB-to-Serial cable. For me it&#8217;s COM3. In the connection settings click on details and mark the flag selected. That&#8217;s it. I tried this on Windows XP with Service Pack 3, but it should work similiarily on other Windows versions.</p>
<div id="attachment_121" class="wp-caption alignnone" style="width: 310px"><a href="http://michi.ist.inspirationslos.de/files/2009/04/comeinstellungen02.jpg"><img class="size-medium wp-image-121" title="COMPortEinstellungenMeggyJr" src="http://michi.ist.inspirationslos.de/files/2009/04/comeinstellungen02-300x214.jpg" alt="RTS Flag" width="300" height="214" /></a><p class="wp-caption-text">RTS Flag</p></div>
]]></content:encoded>
			<wfw:commentRss>http://michi.ist.inspirationslos.de/2009/04/07/arduinomeggy-jr-upload-fehler/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

